Class: Rley::Parser::BaseParser
- Inherits:
-
Object
- Object
- Rley::Parser::BaseParser
- Includes:
- GrmItemsBuilder
- Defined in:
- lib/rley/parser/base_parser.rb
Overview
Abstract class for Earley parser.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#dotted_items ⇒ Object
readonly
The dotted items/rules for the productions of the grammar.
-
#grammar ⇒ Object
readonly
The grammar of the language.
Instance Method Summary collapse
-
#initialize(aGrammar) ⇒ BaseParser
constructor
A new instance of BaseParser.
Methods included from GrmItemsBuilder
Constructor Details
#initialize(aGrammar) ⇒ BaseParser
Returns a new instance of BaseParser.
19 20 21 22 |
# File 'lib/rley/parser/base_parser.rb', line 19 def initialize(aGrammar) @grammar = aGrammar @dotted_items = build_dotted_items(grammar) # Method from mixin end |
Instance Attribute Details
#dotted_items ⇒ Object (readonly)
The dotted items/rules for the productions of the grammar
16 17 18 |
# File 'lib/rley/parser/base_parser.rb', line 16 def dotted_items @dotted_items end |
#grammar ⇒ Object (readonly)
The grammar of the language.
13 14 15 |
# File 'lib/rley/parser/base_parser.rb', line 13 def grammar @grammar end |