Class: Kaiseki::GrammarStub
- Inherits:
-
PackageParser
- Object
- BasicParser
- PackageParser
- Kaiseki::GrammarStub
- Defined in:
- lib/grammar_stub.rb
Instance Attribute Summary collapse
-
#grammar ⇒ Object
readonly
Returns the value of attribute grammar.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Attributes inherited from BasicParser
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(expected, grammar, rule = '(main)') ⇒ GrammarStub
constructor
A new instance of GrammarStub.
Methods inherited from PackageParser
Methods inherited from BasicParser
Methods included from Parseable
#&, #action, #and?, #cast, #filter, #list, #merge, #not!, #one_or_more, #optional, #override, #parse, #predicate?, #protect, #repeat, #set, #skip, #tag_error, #tag_result, #to_parseable, #validate, #zero_or_more, #|
Constructor Details
#initialize(expected, grammar, rule = '(main)') ⇒ GrammarStub
Returns a new instance of GrammarStub.
5 6 7 8 9 |
# File 'lib/grammar_stub.rb', line 5 def initialize expected, grammar, rule = '(main)' super expected @grammar = grammar @rule = rule end |
Instance Attribute Details
#grammar ⇒ Object (readonly)
Returns the value of attribute grammar.
3 4 5 |
# File 'lib/grammar_stub.rb', line 3 def grammar @grammar end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
3 4 5 |
# File 'lib/grammar_stub.rb', line 3 def rule @rule end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
11 12 13 |
# File 'lib/grammar_stub.rb', line 11 def eql? other other.is_a?(self.class) and other.expected == @expected and other.grammar == @grammar end |