-
Notifications
You must be signed in to change notification settings - Fork 31
fpp to json
Note: This tool is in development.
This tool parses an FPP model, performs semantic checking on it, and writes out the model in Javascript Object Notation (JSON) format.
Options:
-
-d
dir: Set the output directory to dir. If this option is not present, then the output directory is the current directory. -
-s
: Emit syntax only (location map and abstract syntax tree).
Input:
-
A list fl of files to translate: either the single file stdin or a list of files specified on the command line.
Output:
Fpp-to-json generates the following files:
-
A file
fpp-ast.json
containing a JSON representation of the abstract syntax tree (AST). -
A file
fpp-loc.json
containing a JSON representation of the location map. -
If the flag
-s
is not present, then a filefpp-analysis.json
containing a JSON representation of the Analysis Data Structure.
Procedure:
-
Parse each of the files in fl, generating a list tul of translation units. When parsing, recursively resolve include specifiers.
-
Convert the abstract syntax tree (AST) and the location map to JSON objects.
-
If
-s
is not present, then-
Perform semantic checking on tul.
-
Convert the Analysis Data Structure to a JSON object.
-
-
Write the JSON objects to files.