Commit Graph

7 Commits

Author SHA1 Message Date
Kenneth Myhra
121fe820d9 cpp-parser: Port to LibMain :^) 2021-12-11 15:10:42 -08:00
Ralf Donau
60a4da8e20 Utilities: Use File.error_string() instead of perror(3) in cpp-* 2021-08-22 02:01:58 +02:00
Itamar
4673a517f6 LibCpp: Do lexing in the Preprocessor
We now call Preprocessor::process_and_lex() and pass the result to the
parser.

Doing the lexing in the preprocessor will allow us to maintain the
original position information of tokens after substituting definitions.
2021-08-07 21:24:11 +02:00
Ali Mohammad Pur
dc68c765b7 LibCpp: Correctly parse lines that end in '\'
Such lines should be considered to be joined into the next line.
This makes multiline preprocessor stuff "work".
2021-08-02 01:03:59 +02:00
Brian Gianforcaro
219d4ba376 Utilities: Remove unused header includes 2021-08-01 08:10:16 +02:00
Itamar
402483ec1f LibCpp: Generalize ASTNode::dump() to support redirecting its output
Previously, ASTNode::dump() used outln() for output, which meant it
always wrote its output to stdout.

After this commit, ASTNode::dump() receives an 'output' argument (which
is stdout by default). This enables writing the output to somewhere
else.

This will be useful for testing the LibCpp Parser with the output of
ASTNode::dump.
2021-05-19 23:19:07 +02:00
Itamar
463a91c4a2 Utilities: Rename CppParserTest => cpp-parser
This is a utility program that runs the LibCpp parser on a program and
dumps out the AST.
2021-05-19 23:19:07 +02:00