Class: Jaina::Parser::AST Private
- Inherits:
-
Object
- Object
- Jaina::Parser::AST
- Extended by:
- Forwardable
- Defined in:
- lib/jaina/parser/ast.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Modules: Evaluator Classes: Context, Tree, TreeBuilder
Instance Attribute Summary collapse
- #ast_tree ⇒ Jaina::Pasrer::AST::Tree readonly private
- #program ⇒ String readonly private
Class Method Summary collapse
Instance Method Summary collapse
- #evaluate(**initial_context) ⇒ Any private
- #initialize(program, ast_tree) ⇒ void constructor private
Constructor Details
#initialize(program, ast_tree) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 50 |
# File 'lib/jaina/parser/ast.rb', line 47 def initialize(program, ast_tree) @program = program.dup.tap(&:freeze) @ast_tree = ast_tree end |
Instance Attribute Details
#ast_tree ⇒ Jaina::Pasrer::AST::Tree (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/jaina/parser/ast.rb', line 30 def ast_tree @ast_tree end |
#program ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
36 37 38 |
# File 'lib/jaina/parser/ast.rb', line 36 def program @program end |
Class Method Details
.build(program) ⇒ Jaina::Parser::AST
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 23 |
# File 'lib/jaina/parser/ast.rb', line 20 def build(program) ast_tree = Jaina::Parser::AST::TreeBuilder.build(program) new(program, ast_tree) end |
Instance Method Details
#evaluate(**initial_context) ⇒ Any
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
57 58 59 |
# File 'lib/jaina/parser/ast.rb', line 57 def evaluate(**initial_context) Jaina::Parser::AST::Evaluator.evaluate(self, **initial_context) end |