Class: Dhaka::LexerSupport::LeafNode

Inherits:
ASTNode
  • Object
show all
Defined in:
lib/dhaka/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.



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

#characterObject (readonly)

Returns the value of attribute character.



322
323
324
# File 'lib/dhaka/lexer/regex_grammar.rb', line 322

def character
  @character
end

#follow_setObject (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_setsObject



344
345
# File 'lib/dhaka/lexer/regex_grammar.rb', line 344

def calculate_follow_sets
end

#firstObject



336
337
338
# File 'lib/dhaka/lexer/regex_grammar.rb', line 336

def first
  Set.new([self])
end

#lastObject



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

def last
  Set.new([self])
end

#nullableObject



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