Class: Packrat::RuleRef

Inherits:
GrammarElement show all
Defined in:
lib/packrat/grammar.rb,
lib/packrat/grammar.rb

Instance Attribute Summary collapse

Attributes inherited from GrammarElement

#hidden

Instance Method Summary collapse

Methods inherited from GrammarElement

#to_packrat_grammar_element

Constructor Details

#initialize(ruleName) ⇒ RuleRef

Returns a new instance of RuleRef.



70
71
72
# File 'lib/packrat/grammar.rb', line 70

def initialize(ruleName)
  @rule_name = ruleName 
end

Instance Attribute Details

#rule_nameObject (readonly)

Returns the value of attribute rule_name.



69
70
71
# File 'lib/packrat/grammar.rb', line 69

def rule_name
  @rule_name
end

Instance Method Details

#inspectObject



73
# File 'lib/packrat/grammar.rb', line 73

def inspect; @rule_name.inspect; end

#parse(parser) ⇒ Object



567
568
569
# File 'lib/packrat/grammar.rb', line 567

def parse(parser)
  parser.grammar[@rule_name].parse(parser)
end