Class: SbuilderSexp::OperatorExpression

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

Instance Method Summary collapse

Methods inherited from AbstactExpression

#expression_postfix, #expression_prefix, #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

#argumentsExpression:Array

Returns list or arguments.

Returns:

  • (Expression:Array)

    list or arguments



272
273
274
# File 'lib/parser/parser_nodes.rb', line 272

def arguments
  recursive_select( SbuilderSexp::Expression )
end

#expression_valString

‘AbstactExpression` traverse yields in-order

Returns:

  • (String)

    operator name as expression value –>



264
265
266
# File 'lib/parser/parser_nodes.rb', line 264

def expression_val
  operator_name
end

#expressionsArray

Returns empty array to quit recursion in ‘AbstactExpression’.

Returns:

  • (Array)

    empty array to quit recursion in ‘AbstactExpression’



287
288
289
# File 'lib/parser/parser_nodes.rb', line 287

def expressions
  []
end

#operator_nameObject



268
269
270
# File 'lib/parser/parser_nodes.rb', line 268

def operator_name
  recursive_select( SbuilderSexp::Identifier ).first.node_value      
end

#record_fieldObject



279
280
281
282
283
# File 'lib/parser/parser_nodes.rb', line 279

def record_field
  node = record_field_node
  return nil unless node
  node.node_value
end

#record_field_nodeObject



276
277
278
# File 'lib/parser/parser_nodes.rb', line 276

def record_field_node
  recursive_select( SbuilderSexp::RecordField ).first
end