Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 1.13 KB

README.md

File metadata and controls

36 lines (31 loc) · 1.13 KB

cdecl+

GitHub pages badge screenshot of cdecl+ website cdecl+ is an online utility written in JavaScript, which turns C declarations into prose. It is primarily designed for C, but supports some C++ features such as function qualifiers and references.

Examples

void f(int)
// Declare f as function(int) returning void
int(*)[3]
// pointer to array[3] of int
const x(int[*]) &
// Declare x as &-qualified function(VLA of unspecified size of int) returning const int
typedef struct y {} x
// Declare x as type alias for struct y
void (T::*)() const
// pointer to member of T, with type const-qualified function returning void

Architecture & Technologies

cdecl+ uses a PEG.js grammar to generate a JS parser, which is then called by other JavaScript code which converts to prose. Additional diagnostics are provided, such as errors for syntactically valid, but ill-formed code.

Other than PEG.js, there are no dependencies. The HTML and CSS are hand-written for this project.