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.
324 325 326 327 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 324 def initialize character @character = character @follow_set = Set.new end |
Instance Attribute Details
#character ⇒ Object (readonly)
Returns the value of attribute character.
323 324 325 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 323 def character @character end |
#follow_set ⇒ Object (readonly)
Returns the value of attribute follow_set.
323 324 325 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 323 def follow_set @follow_set end |
Instance Method Details
#calculate_follow_sets ⇒ Object
345 346 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 345 def calculate_follow_sets end |
#first ⇒ Object
337 338 339 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 337 def first Set.new([self]) end |
#last ⇒ Object
341 342 343 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 341 def last Set.new([self]) end |
#nullable ⇒ Object
333 334 335 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 333 def nullable false end |
#to_dot(graph) ⇒ Object
329 330 331 |
# File 'lib/dhaka/lexer/regex_grammar.rb', line 329 def to_dot(graph) graph.node(self, :label => character) end |