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

Constructor Details

#initialize(child) ⇒ UnaryNode

Returns a new instance of UnaryNode.



240
241
242
# File 'lib/lexer/regex_grammar.rb', line 240

def initialize child
  @child = child
end

Instance Attribute Details

#childObject (readonly)

Returns the value of attribute child.



239
240
241
# File 'lib/lexer/regex_grammar.rb', line 239

def child
  @child
end

Instance Method Details

#calculate_follow_setsObject



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

def calculate_follow_sets
  child.calculate_follow_sets
end

#firstObject



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

def first
  child.first
end

#lastObject



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

def last
  child.last
end

#nullableObject



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

def nullable
  child.nullable
end

#to_dot(graph) ⇒ Object



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

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