Class: SbuilderSexp::Callable
Instance Method Summary
collapse
Methods inherited from Define
#name
#node_type, #recursive_inject, #recursive_inject_parent, #recursive_select, #value
Instance Method Details
#body ⇒ Object
1135
1136
1137
1138
|
# File 'lib/parser/parser_nodes.rb', line 1135
def body
node = body_node
node.value if node
end
|
#body_node ⇒ Object
1131
1132
1133
1134
|
# File 'lib/parser/parser_nodes.rb', line 1131
def body_node
ret = recursive_select(SbuilderSexp::Statement).first
ret
end
|
#declaration_definitions ⇒ Object
1156
1157
1158
|
# File 'lib/parser/parser_nodes.rb', line 1156
def declaration_definitions
[]
end
|
#node_value ⇒ Object
1140
1141
1142
1143
1144
1145
1146
|
# File 'lib/parser/parser_nodes.rb', line 1140
def node_value
{
:name => "name",
:parameters => parameters,
:body => body,
}
end
|
#parameter_definitions ⇒ Hash:Array
Returns symbol hash with ‘:node_type’, :value,:tree properties.
1150
1151
1152
1153
1154
|
# File 'lib/parser/parser_nodes.rb', line 1150
def parameter_definitions
parameter_def = parameters
return [] unless parameter_def
parameter_def[:value]
end
|
#parameters ⇒ Object
1125
1126
1127
1128
|
# File 'lib/parser/parser_nodes.rb', line 1125
def parameters
node = parameters_node
return node.value if node
end
|
#parameters_node ⇒ Object
1121
1122
1123
1124
|
# File 'lib/parser/parser_nodes.rb', line 1121
def parameters_node
tree_nodes = recursive_select(SbuilderSexp::Parameters)
return tree_nodes.first if tree_nodes
end
|
#symbol_definitions ⇒ Object
Symbols defined in this node. They include parameters and declarations (normally only in procedure)
1162
1163
1164
1165
|
# File 'lib/parser/parser_nodes.rb', line 1162
def symbol_definitions
return parameter_definitions + declaration_definitions
end
|