Class: SbuilderSexp::FunctionExpression
- Inherits:
-
AbstactExpression
- Object
- Treetop::Runtime::SyntaxNode
- Root
- AbstactExpression
- SbuilderSexp::FunctionExpression
- Defined in:
- lib/parser/parser_nodes.rb
Instance Method Summary collapse
- #binds_node ⇒ Object
-
#expression_val ⇒ Object
AbstactExpression.traverse calls in yield.
- #function_expression ⇒ Object
- #lhs_node ⇒ Object
-
#name ⇒ String
For documentation purposes symbol table context needs a name (For procedures, and macros name is ovbious. For a set expression we define name set a string “Set+<generator set>”.
-
#symbol_definitions ⇒ Hash:Array
Some variables in ‘set_expression’ (most likely) refer to variable defined in set constructor generate.
Methods inherited from AbstactExpression
#expression_postfix, #expression_prefix, #expressions, #has_rhs, #node_value, #rhs_node, #traverse
Methods inherited from Treetop::Runtime::SyntaxNode
#node_type, #node_value, #recursive_inject, #recursive_inject_parent, #recursive_select, #value
Instance Method Details
#binds_node ⇒ Object
674 675 676 677 678 679 680 |
# File 'lib/parser/parser_nodes.rb', line 674 def binds_node ret = recursive_select( SbuilderSexp::BoundInExpression ).first # return nil unless ret # ret = ret.recursive_select( SbuilderSexp::BoundInExpression ).first # # puts ret # ret end |
#expression_val ⇒ Object
AbstactExpression.traverse calls in yield
670 671 672 |
# File 'lib/parser/parser_nodes.rb', line 670 def expression_val true end |
#function_expression ⇒ Object
682 683 684 |
# File 'lib/parser/parser_nodes.rb', line 682 def function_expression elements[1] end |
#lhs_node ⇒ Object
664 665 666 |
# File 'lib/parser/parser_nodes.rb', line 664 def lhs_node nil end |
#name ⇒ String
For documentation purposes symbol table context needs a name (For procedures, and macros name is ovbious. For a set expression we define name set a string “Set+<generator set>”
691 692 693 |
# File 'lib/parser/parser_nodes.rb', line 691 def name "Func-#{binds_node.bind_set.text_value}" end |
#symbol_definitions ⇒ Hash:Array
Some variables in ‘set_expression’ (most likely) refer to variable defined in set constructor generate. Return name of this variables.
701 702 703 704 |
# File 'lib/parser/parser_nodes.rb', line 701 def symbol_definitions return [] unless binds_node [ { :node_type => node_type, :value => binds_node.bind_var.expression_val, :tree=>binds_node } ] end |