Spicy
Public Member Functions | List of all members
spicy::detail::codegen::GrammarBuilder Class Reference

#include <grammar-builder.h>

Public Member Functions

 GrammarBuilder (CodeGen *cg)
 
Result< Nothingrun (const type::Unit &unit, Node *node, CodeGen *cg)
 
const Grammargrammar (const type::Unit &unit)
 
CodeGencg () const
 

Detailed Description

Generates the grammars for all unit types declared in an AST.

Member Function Documentation

◆ grammar()

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.

◆ run()

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().


The documentation for this class was generated from the following files: