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.



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

#characterObject (readonly)

Returns the value of attribute character.



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

def character
  @character
end

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



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

def calculate_follow_sets
end

#firstObject



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

def first
  Set.new([self])
end

#lastObject



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

def last
  Set.new([self])
end

#nullableObject



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