Class: SbuilderSexp::QuantifyExpression

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

Instance Method Summary collapse

Methods inherited from PrefixExpression

#expression_prefix, #operator, #operator_node

Methods inherited from AbstactExpression

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



437
438
439
# File 'lib/parser/parser_nodes.rb', line 437

def binds_nodes
  recursive_select( SbuilderSexp::BindsInExpression ).first.recursive_select( SbuilderSexp::BoundInExpression )
end

#lhs_nodeObject

do not automatically recurse during ‘traverse’



433
434
435
# File 'lib/parser/parser_nodes.rb', line 433

def lhs_node
  nil
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



454
455
456
# File 'lib/parser/parser_nodes.rb', line 454

def name
  "Quantification-??"
end

#quantified_expressionAbstractExpression

Quantification defines ‘quantified_expression’ in left hand size in binary tree modeling expression.

Returns:

  • (AbstractExpression)

    synxtax tree node for the quentified expression



445
446
447
# File 'lib/parser/parser_nodes.rb', line 445

def quantified_expression
  expressions.first
end

#symbol_definitionsArray

Some variables in ‘constructor_expression’ (most likely) refer to variable defined in set constructor generate. Return name of this variable.

Returns:

  • (Array)

    of one hash with ‘:node_type’,‘:value’ properties



463
464
465
466
467
# File 'lib/parser/parser_nodes.rb', line 463

def symbol_definitions
  binds_nodes.map do |binds_node|
    { :node_type => node_type, :value => binds_node.bind_var.expression_val, :tree=>binds_node }
  end
end