Repository navigation
fpp syntax
This tool parses FPP source files into an abstract syntax tree (AST) and optionally writes out the AST. It is mainly useful during compiler development.
Options:
-
-a: Print the AST. -
-e: Expand syntax. Resolve include specifiers, add state machine enums, and expand templates.
Input: A list fl of files: either the single file stdin or a list of files specified on the command line.
Output:
-
By default, no output if the parsing succeeds; otherwise an error message.
-
If option
-ais present, then a text representation of the AST. If the input contains multiple source files, then each source file is parsed into an AST, and the output is the AST formed by concatenating the individual ASTs.
Procedure:
-
Parse each of the files in fl to a translation unit tu, reporting any errors that occur.
-
If
-eis present, then expand syntax and enter symbols, yielding a new list tul' of translation units. -
If
-ais present, then form an AST by concatenating the elements of tul' and write it out as text.