Skip to main content

Module parser

Module parser 

Source
Expand description

Lexer and recursive-descent parser for *.bindings.chipi files.

The grammar is brace-based:

file       = (include | target)*
include    = 'include' STRING
target     = 'target' IDENT '{' target_body '}'

Tokens:

  • Ident. Matches [A-Za-z_][A-Za-z0-9_:]*. :: is part of paths.
  • String. Double-quoted.
  • Number. Decimal or 0x... hex.
  • { } < > = ,
  • #-to-EOL comments

Functionsยง

parse
Parse a bindings file (without resolving includes).
parse_file
Parse a bindings file from disk (without resolving includes).
parse_file_with_includes
Parse a bindings file and recursively follow include "*.bindings.chipi" directives. Spec includes (*.chipi) are recorded but not parsed.