Class: StarlarkCompiler::AST
- Inherits:
-
Object
- Object
- StarlarkCompiler::AST
- Defined in:
- lib/starlark_compiler/ast.rb
Defined Under Namespace
Classes: Array, BinaryOperator, Dictionary, False, FunctionCall, FunctionDeclaration, MethodCall, Node, None, Number, PlusOperator, String, True, VariableAssignment, VariableReference
Instance Attribute Summary collapse
-
#toplevel ⇒ Object
readonly
Returns the value of attribute toplevel.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(node) ⇒ Object
-
#initialize(toplevel:) ⇒ AST
constructor
A new instance of AST.
Constructor Details
#initialize(toplevel:) ⇒ AST
Returns a new instance of AST.
7 8 9 |
# File 'lib/starlark_compiler/ast.rb', line 7 def initialize(toplevel:) @toplevel = toplevel end |
Instance Attribute Details
#toplevel ⇒ Object (readonly)
Returns the value of attribute toplevel.
5 6 7 |
# File 'lib/starlark_compiler/ast.rb', line 5 def toplevel @toplevel end |
Class Method Details
.build(&blk) ⇒ Object
44 45 46 |
# File 'lib/starlark_compiler/ast.rb', line 44 def self.build(&blk) Builder.new.instance_exec(&blk) end |
Instance Method Details
#<<(node) ⇒ Object
11 12 13 |
# File 'lib/starlark_compiler/ast.rb', line 11 def <<(node) @toplevel << node end |