Class: Packrat::RuleRef
- Inherits:
-
GrammarElement
- Object
- GrammarElement
- Packrat::RuleRef
- Defined in:
- lib/packrat/grammar.rb,
lib/packrat/grammar.rb
Instance Attribute Summary collapse
-
#rule_name ⇒ Object
readonly
Returns the value of attribute rule_name.
Attributes inherited from GrammarElement
Instance Method Summary collapse
-
#initialize(ruleName) ⇒ RuleRef
constructor
A new instance of RuleRef.
- #inspect ⇒ Object
- #parse(parser) ⇒ Object
Methods inherited from GrammarElement
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_name ⇒ Object (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
#inspect ⇒ Object
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 |