Class: Skeem::SkmBuilder
- Inherits:
-
Rley::ParseRep::ASTBaseBuilder
- Object
- Rley::ParseRep::ASTBaseBuilder
- Skeem::SkmBuilder
- Defined in:
- lib/skeem/s_expr_builder.rb
Overview
The purpose of a ASTBuilder is to build piece by piece an AST (Abstract Syntax Tree) from a sequence of input tokens and visit events produced by walking over a GFGParsing object. Uses the Builder GoF pattern. The Builder pattern creates a complex object (say, a parse tree) from simpler objects (terminal and non-terminal nodes) and using a step by step approach.
Constant Summary collapse
- Terminal2NodeClass =
{ 'BOOLEAN' => SkmBoolean, 'CHAR' => SkmChar, 'IDENTIFIER' => SkmIdentifier, 'INTEGER' => SkmInteger, 'RATIONAL' => SkmRational, 'REAL' => SkmReal, 'STRING_LIT' => SkmString }.freeze