Class: Dhaka::LexerSupport::UnaryNode

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

Direct Known Subclasses

OneOrMoreNode, ZeroOrMoreNode, ZeroOrOneNode

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ASTNode

#accepting, #checkpoint

Constructor Details

#initialize(child) ⇒ UnaryNode

Returns a new instance of UnaryNode.



262
263
264
# File 'lib/lexer/regex_grammar.rb', line 262

def initialize child
  @child = child
end

Instance Attribute Details

#childObject (readonly)

Returns the value of attribute child.



261
262
263
# File 'lib/lexer/regex_grammar.rb', line 261

def child
  @child
end

Instance Method Details

#calculate_follow_setsObject



284
285
286
# File 'lib/lexer/regex_grammar.rb', line 284

def calculate_follow_sets
  child.calculate_follow_sets
end

#firstObject



276
277
278
# File 'lib/lexer/regex_grammar.rb', line 276

def first
  child.first
end

#lastObject



280
281
282
# File 'lib/lexer/regex_grammar.rb', line 280

def last
  child.last
end

#nullableObject



272
273
274
# File 'lib/lexer/regex_grammar.rb', line 272

def nullable
  child.nullable
end

#to_dot(graph) ⇒ Object



266
267
268
269
270
# File 'lib/lexer/regex_grammar.rb', line 266

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