Class: SbuilderSexp::VariableDef
- Inherits:
-
Define
- Object
- Treetop::Runtime::SyntaxNode
- Root
- Define
- SbuilderSexp::VariableDef
- Defined in:
- lib/parser/parser_nodes.rb
Overview
Variable
Instance Method Summary collapse
-
#init ⇒ Expression
Tree node for init expression.
- #name ⇒ Object
-
#symbol_definitions ⇒ Array
Return entries for symbol table.
-
#variable ⇒ Identifier
Tree node for variable defined.
Methods inherited from Treetop::Runtime::SyntaxNode
#node_type, #node_value, #recursive_inject, #recursive_inject_parent, #recursive_select, #value
Instance Method Details
#init ⇒ Expression
Returns tree node for init expression.
1231 1232 1233 |
# File 'lib/parser/parser_nodes.rb', line 1231 def init tree_nodes = recursive_select(SbuilderSexp::Expression).first end |
#name ⇒ Object
1219 1220 1221 1222 |
# File 'lib/parser/parser_nodes.rb', line 1219 def name # recursive_select(SbuilderSexp::Identifier).first.node_value variable.node_value end |
#symbol_definitions ⇒ Array
Return entries for symbol table. In this case, add just variable definition.
1239 1240 1241 |
# File 'lib/parser/parser_nodes.rb', line 1239 def symbol_definitions [ { :node_type => node_type, :value => name } ] end |
#variable ⇒ Identifier
Returns tree node for variable defined.
1225 1226 1227 |
# File 'lib/parser/parser_nodes.rb', line 1225 def variable tree_nodes = recursive_select(SbuilderSexp::Identifier).first end |