Class: SbuilderSexp::Procedure
- Inherits:
-
Callable
- Object
- Treetop::Runtime::SyntaxNode
- Root
- Define
- Callable
- SbuilderSexp::Procedure
- Defined in:
- lib/parser/parser_nodes.rb
Instance Method Summary collapse
-
#declaration_definitions ⇒ VariableDef:Array
overrides method in parent to return decclartions in.
- #procedure_variables ⇒ Object
-
#procedure_variables_node ⇒ Nil|ProcVariables
Of variable definition node for procedure.
-
#variable_declarations ⇒ VariableDef:Array
Variable declarations.
Methods inherited from Callable
#body, #body_node, #node_value, #parameter_definitions, #parameters, #parameters_node, #symbol_definitions
Methods inherited from Define
Methods inherited from Treetop::Runtime::SyntaxNode
#node_type, #node_value, #recursive_inject, #recursive_inject_parent, #recursive_select, #value
Instance Method Details
#declaration_definitions ⇒ VariableDef:Array
overrides method in parent to return decclartions in
1195 1196 1197 1198 1199 |
# File 'lib/parser/parser_nodes.rb', line 1195 def declaration_definitions declaration_def = procedure_variables return [] unless declaration_def.any? declaration_def end |
#procedure_variables ⇒ Object
1186 1187 1188 1189 1190 |
# File 'lib/parser/parser_nodes.rb', line 1186 def procedure_variables # node = procedure_variables_node # return node.value if node variable_declarations.map { |variable_declaration| variable_declaration.variable.value } end |
#procedure_variables_node ⇒ Nil|ProcVariables
Returns of variable definition node for procedure.
1175 1176 1177 1178 |
# File 'lib/parser/parser_nodes.rb', line 1175 def procedure_variables_node tree_nodes = recursive_select(SbuilderSexp::ProcVariables) return tree_nodes.first if tree_nodes end |
#variable_declarations ⇒ VariableDef:Array
Returns variable declarations.
1181 1182 1183 1184 |
# File 'lib/parser/parser_nodes.rb', line 1181 def variable_declarations return [] unless procedure_variables_node return procedure_variables_node.recursive_select(SbuilderSexp::VariableDef) end |