5 ms·
Correct. The C/C++ grammar is not complete; it only encodes the subset of the language that was needed to bootstrap langcc itself. As far as I am aware, howeve
by jzimmerman64 4y ago
Correct. The C/C++ grammar is not complete; it only encodes the subset of the language that was needed to bootstrap langcc itself.
As far as I am aware, however, the Python grammar parses the full industrial language Python 3.9.12.
- defen 4y agoDo you think it would be possible to use this tool to create a full C frontend (including preprocessor)? I imagine the difficult part would be passing preprocessed text (including generated source e.g. pasted tokens, and expansion locations) into the C parser.
- jzimmerman64 4y agoThe preprocessor would likely have to be a separate ad-hoc step, but it is possible that langcc could be used to generate a full C frontend if one is willing to run two passes (needed to deal with ambiguous cases such as "x * y", which can be either a multiplication expression or a variable declaration, depending on the contents of the symbol table).