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
Instance Method Details
#calculate_follow_sets ⇒ Object
230
231
232
233
234
235
|
# File 'lib/lexer/regex_grammar.rb', line 230
def calculate_follow_sets
super
left.last.each do |leaf_node|
leaf_node.follow_set.merge right.first
end
end
|
#first ⇒ Object
222
223
224
|
# File 'lib/lexer/regex_grammar.rb', line 222
def first
left.nullable ? (left.first | right.first) : left.first
end
|
#label ⇒ Object
214
215
216
|
# File 'lib/lexer/regex_grammar.rb', line 214
def label
"cat"
end
|
#last ⇒ Object
226
227
228
|
# File 'lib/lexer/regex_grammar.rb', line 226
def last
right.nullable ? (left.last | right.last) : right.last
end
|
#nullable ⇒ Object
218
219
220
|
# File 'lib/lexer/regex_grammar.rb', line 218
def nullable
left.nullable && right.nullable
end
|