Class: Dhaka::LexerSupport::LeafNode

Inherits:
ASTNode
  • Object
show all
Defined in:
lib/lexer/regex_grammar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ASTNode

#accepting, #checkpoint

Constructor Details

#initialize(character) ⇒ LeafNode

Returns a new instance of LeafNode.



341
342
343
344
# File 'lib/lexer/regex_grammar.rb', line 341

def initialize character
  @character = character
  @follow_set = Set.new
end

Instance Attribute Details

#characterObject (readonly)

Returns the value of attribute character.



340
341
342
# File 'lib/lexer/regex_grammar.rb', line 340

def character
  @character
end

#follow_setObject (readonly)

Returns the value of attribute follow_set.



340
341
342
# File 'lib/lexer/regex_grammar.rb', line 340

def follow_set
  @follow_set
end

Instance Method Details

#calculate_follow_setsObject



362
363
# File 'lib/lexer/regex_grammar.rb', line 362

def calculate_follow_sets
end

#firstObject



354
355
356
# File 'lib/lexer/regex_grammar.rb', line 354

def first
  Set.new([self])
end

#lastObject



358
359
360
# File 'lib/lexer/regex_grammar.rb', line 358

def last
  Set.new([self])
end

#nullableObject



350
351
352
# File 'lib/lexer/regex_grammar.rb', line 350

def nullable
  false
end

#to_dot(graph) ⇒ Object



346
347
348
# File 'lib/lexer/regex_grammar.rb', line 346

def to_dot(graph)
  graph.node(self, :label => character)
end