Skip to content

fpp syntax

Rob Bocchino edited this page Jun 28, 2023 · 2 revisions

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:

  1. -a: Print the AST.

  2. -i: Resolve include specifiers.

Input: A list fl of files: either the single file stdin or a list of files specified on the command line.

Output:

  1. By default, no output if the parsing succeeds; otherwise an error message.

  2. If option -a is present, then a text representation of the AST.

Procedure:

  1. Parse each of the files in fl to a translation unit tu, reporting any errors that occur.

  2. If -i is present, then recursively resolve include specifiers. Check for include cycles. Upon detecting an include cycle, halt with an error message.

  3. If -a is present, then write out the AST as text.