Class: SbuilderSexp::LetExpression

Inherits:
SimpleExpression show all
Defined in:
lib/parser/parser_nodes.rb

Instance Method Summary collapse

Methods inherited from SimpleExpression

#expression_val, #lhs_node

Methods inherited from AbstactExpression

#expression_postfix, #expression_prefix, #expression_val, #expressions, #has_rhs, #lhs_node, #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

#letExpressionObject



363
364
365
# File 'lib/parser/parser_nodes.rb', line 363

def letExpression
  elements[1]
end

#nameString

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>”

Returns:

  • (String)

    name identifying context in symbol table



380
381
382
# File 'lib/parser/parser_nodes.rb', line 380

def name
  "LetExpr-??"
end

#operatorDefObject



359
360
361
# File 'lib/parser/parser_nodes.rb', line 359

def operatorDef
  recursive_select( SbuilderSexp::OperatorDef ).first
end

#symbol_definitionsArray

Return entries for symbol table. In this case, add just variable in operator definition

Returns:

  • (Array)

    of 1 hash with :node_type,:value



371
372
373
# File 'lib/parser/parser_nodes.rb', line 371

def symbol_definitions
  [ { :node_type => node_type, :value => operatorDef.name } ]
end