Class: Loxxy::Ast::ASTBuilder
- Inherits:
-
Rley::ParseRep::ASTBaseBuilder
- Object
- Rley::ParseRep::ASTBaseBuilder
- Loxxy::Ast::ASTBuilder
- Defined in:
- lib/loxxy/ast/ast_builder.rb
Overview
The purpose of 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.
Constant Summary collapse
- Name2special =
Mapping Token name => operator | separator | delimiter characters
{ 'AND' => 'and', 'BANG_EQUAL' => '!=', 'COMMA' => ',', 'DOT' => '.', 'EQUAL' => '=', 'EQUAL_EQUAL' => '==', 'GREATER' => '>', 'GREATER_EQUAL' => '>=', 'LEFT_BRACE' => '{', 'LEFT_PAREN' => '(', 'LESS' => '<', 'LESS_EQUAL' => '<=', 'MINUS' => '-', 'OR' => 'or', 'PLUS' => '+', 'RIGHT_BRACE' => '}', 'RIGHT_PAREN' => ')', 'SEMICOLON' => ';', 'SLASH' => '/', 'STAR' => '*' }.freeze
- Name2unary =
{ 'BANG' => '!', 'MINUS' => '-@' }.freeze
Instance Attribute Summary collapse
-
#strict ⇒ Object
readonly
defined.
Instance Method Summary collapse
-
#initialize(theTokens) ⇒ ASTBuilder
constructor
Create a new AST builder instance.
Constructor Details
#initialize(theTokens) ⇒ ASTBuilder
Create a new AST builder instance.
49 50 51 52 |
# File 'lib/loxxy/ast/ast_builder.rb', line 49 def initialize(theTokens) super(theTokens) @strict = false end |
Instance Attribute Details
#strict ⇒ Object (readonly)
defined
45 46 47 |
# File 'lib/loxxy/ast/ast_builder.rb', line 45 def strict @strict end |