Class: Dhaka::LexerSupport::CatNode
Instance Attribute Summary
Attributes inherited from BinaryNode
#left, #right
Instance Method Summary
collapse
Methods inherited from BinaryNode
#initialize, #to_dot
Methods inherited from ASTNode
#accepting, #checkpoint
Instance Method Details
#calculate_follow_sets ⇒ Object
221
222
223
224
225
226
|
# File 'lib/dhaka/lexer/regex_grammar.rb', line 221
def calculate_follow_sets
super
left.last.each do |leaf_node|
leaf_node.follow_set.merge right.first
end
end
|
#first ⇒ Object
213
214
215
|
# File 'lib/dhaka/lexer/regex_grammar.rb', line 213
def first
left.nullable ? (left.first | right.first) : left.first
end
|
#label ⇒ Object
205
206
207
|
# File 'lib/dhaka/lexer/regex_grammar.rb', line 205
def label
"cat"
end
|
#last ⇒ Object
217
218
219
|
# File 'lib/dhaka/lexer/regex_grammar.rb', line 217
def last
right.nullable ? (left.last | right.last) : right.last
end
|
#nullable ⇒ Object
209
210
211
|
# File 'lib/dhaka/lexer/regex_grammar.rb', line 209
def nullable
left.nullable && right.nullable
end
|