Class: Rley::Base::BaseParser

Inherits:
Object
  • Object
show all
Includes:
GrmItemsBuilder
Defined in:
lib/rley/base/base_parser.rb

Overview

Abstract class for Earley parser.

Direct Known Subclasses

Parser::GFGEarleyParser

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GrmItemsBuilder

#build_dotted_items

Constructor Details

#initialize(aGrammar) ⇒ BaseParser

Constructor.

Parameters:



23
24
25
26
# File 'lib/rley/base/base_parser.rb', line 23

def initialize(aGrammar)
  @grammar = aGrammar
  @dotted_items = build_dotted_items(grammar) # Method from mixin
end

Instance Attribute Details

#dotted_itemsObject (readonly)

The dotted items/rules for the productions of the grammar



19
20
21
# File 'lib/rley/base/base_parser.rb', line 19

def dotted_items
  @dotted_items
end

#grammarSyntax::Grammar (readonly)

The grammar of the language.

Returns:



16
17
18
# File 'lib/rley/base/base_parser.rb', line 16

def grammar
  @grammar
end