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.



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

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

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



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

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



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

def right
  @right
end

Instance Method Details

#calculate_follow_setsObject



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

def calculate_follow_sets
  left.calculate_follow_sets
  right.calculate_follow_sets
end

#to_dot(graph) ⇒ Object



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

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