Class: Dhaka::LexerSupport::BinaryNode

Inherits:
ASTNode
  • Object
show all
Defined in:
lib/lexer/regex_grammar.rb

Direct Known Subclasses

CatNode

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ASTNode

#accepting, #checkpoint

Constructor Details

#initialize(left, right) ⇒ BinaryNode

Returns a new instance of BinaryNode.



160
161
162
# File 'lib/lexer/regex_grammar.rb', line 160

def initialize left, right
  @left, @right = left, right
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



159
160
161
# File 'lib/lexer/regex_grammar.rb', line 159

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



159
160
161
# File 'lib/lexer/regex_grammar.rb', line 159

def right
  @right
end

Instance Method Details

#calculate_follow_setsObject



172
173
174
175
# File 'lib/lexer/regex_grammar.rb', line 172

def calculate_follow_sets
  left.calculate_follow_sets
  right.calculate_follow_sets
end

#to_dot(graph) ⇒ Object



164
165
166
167
168
169
170
# File 'lib/lexer/regex_grammar.rb', line 164

def to_dot(graph)
  graph.node(self, :label => label)
  graph.edge(self, left)
  graph.edge(self, right)
  left.to_dot(graph)
  right.to_dot(graph)
end