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.



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

def initialize child
  @child = child
end

Instance Attribute Details

#childObject (readonly)

Returns the value of attribute child.



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

def child
  @child
end

Instance Method Details

#calculate_follow_setsObject



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

def calculate_follow_sets
  child.calculate_follow_sets
end

#firstObject



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

def first
  child.first
end

#lastObject



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

def last
  child.last
end

#nullableObject



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

def nullable
  child.nullable
end

#to_dot(graph) ⇒ Object



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

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