Class: Dhaka::LexerSupport::UnaryNode

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



244
245
246
# File 'lib/dhaka/lexer/regex_grammar.rb', line 244

def initialize child
  @child = child
end

Instance Attribute Details

#childObject (readonly)

Returns the value of attribute child.



243
244
245
# File 'lib/dhaka/lexer/regex_grammar.rb', line 243

def child
  @child
end

Instance Method Details

#calculate_follow_setsObject



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

def calculate_follow_sets
  child.calculate_follow_sets
end

#firstObject



258
259
260
# File 'lib/dhaka/lexer/regex_grammar.rb', line 258

def first
  child.first
end

#lastObject



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

def last
  child.last
end

#nullableObject



254
255
256
# File 'lib/dhaka/lexer/regex_grammar.rb', line 254

def nullable
  child.nullable
end

#to_dot(graph) ⇒ Object



248
249
250
251
252
# File 'lib/dhaka/lexer/regex_grammar.rb', line 248

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