Class: Rley::RGN::ASTBuilder

Inherits:
ParseRep::ASTBaseBuilder show all
Defined in:
lib/rley/rgn/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

Returns:

  • (Hash{String => String})
{
  'COMMA' =>  ',',
  'ELLIPSIS' => '..',
  'LEFT_BRACE' =>  '{',
  'LEFT_PAREN' => '(',
  'PLUS' => '+',
  'QUESTION_MARK' => '?',
  'RIGHT_BRACE' => '}',
  'RIGHT_PAREN' => ')',
  'STAR' => '*'
}.freeze

Instance Attribute Summary

Attributes inherited from ParseRep::ParseTreeBuilder

#result, #tokens

Method Summary

Methods inherited from ParseRep::ASTBaseBuilder

#method_name, #return_epsilon, #return_first_child, #return_last_child, #return_second_child, #terminalnode_class

Methods inherited from ParseRep::ParseTreeBuilder

#done!, #initialize, #receive_event

Constructor Details

This class inherits a constructor from Rley::ParseRep::ParseTreeBuilder