Class: Dhaka::LexerSupport::LeafNode
- Defined in:
- lib/dhaka/lexer/regex_grammar.rb
Instance Attribute Summary collapse
-
#character ⇒ Object
readonly
Returns the value of attribute character.
-
#follow_set ⇒ Object
readonly
Returns the value of attribute follow_set.
Instance Method Summary collapse
- #calculate_follow_sets ⇒ Object
- #first ⇒ Object
-
#initialize(character) ⇒ LeafNode
constructor
A new instance of LeafNode.
- #last ⇒ Object
- #nullable ⇒ Object
- #to_dot(graph) ⇒ Object
Methods inherited from ASTNode
Constructor Details
#initialize(character) ⇒ LeafNode
Returns a new instance of LeafNode.
323 324 325 326 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 323 def initialize character @character = character @follow_set = Set.new end |
Instance Attribute Details
#character ⇒ Object (readonly)
Returns the value of attribute character.
322 323 324 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 322 def character @character end |
#follow_set ⇒ Object (readonly)
Returns the value of attribute follow_set.
322 323 324 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 322 def follow_set @follow_set end |
Instance Method Details
#calculate_follow_sets ⇒ Object
344 345 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 344 def calculate_follow_sets end |
#first ⇒ Object
336 337 338 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 336 def first Set.new([self]) end |
#last ⇒ Object
340 341 342 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 340 def last Set.new([self]) end |
#nullable ⇒ Object
332 333 334 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 332 def nullable false end |
#to_dot(graph) ⇒ Object
328 329 330 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 328 def to_dot(graph) graph.node(self, :label => character) end |