Class: Dhaka::LexerSupport::BinaryNode

Inherits:
ASTNode
  • Object
show all
Defined in:
lib/dhaka/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.



143
144
145
# File 'lib/dhaka/lexer/regex_grammar.rb', line 143

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

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



142
143
144
# File 'lib/dhaka/lexer/regex_grammar.rb', line 142

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



142
143
144
# File 'lib/dhaka/lexer/regex_grammar.rb', line 142

def right
  @right
end

Instance Method Details

#calculate_follow_setsObject



155
156
157
158
# File 'lib/dhaka/lexer/regex_grammar.rb', line 155

def calculate_follow_sets
  left.calculate_follow_sets
  right.calculate_follow_sets
end

#to_dot(graph) ⇒ Object



147
148
149
150
151
152
153
# File 'lib/dhaka/lexer/regex_grammar.rb', line 147

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