Class: Rley::Notation::GroupingNode

Inherits:
SequenceNode show all
Defined in:
lib/rley/notation/grouping_node.rb

Overview

A syntax node representing an expression bracketed by parentheses.

Instance Attribute Summary

Attributes inherited from SequenceNode

#constraints, #subnodes

Attributes inherited from ASTNode

#annotation, #position, #repetition

Instance Method Summary collapse

Methods inherited from SequenceNode

#size

Methods inherited from ASTNode

#done!

Constructor Details

#initialize(aPosition, sequence, theRepetition = nil) ⇒ GroupingNode

Returns a new instance of GroupingNode.

Parameters:

  • aPosition (Rley::Lexical::Position)

    Start position.

  • sequence (Array<ASTNode>)

    sequence of AST nodes

  • theRepetition (Symbol) (defaults to: nil)

    indicates how many times the symbol can be repeated



12
13
14
# File 'lib/rley/notation/grouping_node.rb', line 12

def initialize(aPosition, sequence, theRepetition = nil)
  super(aPosition, sequence, theRepetition)
end

Instance Method Details

#accept(visitor) ⇒ Object

Part of the 'visitee' role in Visitor design pattern.

Parameters:



18
19
20
# File 'lib/rley/notation/grouping_node.rb', line 18

def accept(visitor)
  visitor.visit_grouping_node(self)
end