![]() |
Spicy
|
#include <grammar-builder.h>
Public Member Functions | |
GrammarBuilder (CodeGen *cg) | |
Result< Nothing > | run (const type::Unit &unit, Node *node, CodeGen *cg) |
const Grammar & | grammar (const type::Unit &unit) |
CodeGen * | cg () const |
Generates the grammars for all unit types declared in an AST.
const Grammar & GrammarBuilder::grammar | ( | const type::Unit & | unit | ) |
Returns the grammar for a unit type. The type must have been computed through run()
already, otherwise this will abort That's generally done for all AST unit types at the beginning of code generation.
Result< Nothing > GrammarBuilder::run | ( | const type::Unit & | unit, |
Node * | node, | ||
CodeGen * | cg | ||
) |
Generates the grammar for a unit type. The grammar will afterwards be available through grammar()
.