Sha256: 2d921a9d954dd9e0219914700f130eaf21dfffd403000f64e43947802e120177

Contents?: true

Size: 858 Bytes

Versions: 15

Compression:

Stored size: 858 Bytes

Contents

# frozen_string_literal: true

require_relative '../syntax/grammar'
require_relative 'grm_items_builder' # Use mix-in module



module Rley # This module is used as a namespace
  module Base # This module is used as a namespace
    # Abstract class for Earley parser.
    class BaseParser
      include GrmItemsBuilder # Mix-in for creating dotted items of grammar

      # The grammar of the language.
      # @return [Syntax::Grammar]
      attr_reader(:grammar)

      # The dotted items/rules for the productions of the grammar
      attr_reader(:dotted_items)

      # Constructor.
      # @param aGrammar [Syntax::Grammar] The grammar of the language.
      def initialize(aGrammar)
        @grammar = aGrammar
        @dotted_items = build_dotted_items(grammar) # Method from mixin
      end
    end # class
  end # module
end # module

# End of file

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rley-0.8.11 lib/rley/base/base_parser.rb
rley-0.8.10 lib/rley/base/base_parser.rb
rley-0.8.09 lib/rley/base/base_parser.rb
rley-0.8.08 lib/rley/base/base_parser.rb
rley-0.8.06 lib/rley/base/base_parser.rb
rley-0.8.05 lib/rley/base/base_parser.rb
rley-0.8.03 lib/rley/base/base_parser.rb
rley-0.8.02 lib/rley/base/base_parser.rb
rley-0.8.01 lib/rley/base/base_parser.rb
rley-0.8.00 lib/rley/base/base_parser.rb
rley-0.7.08 lib/rley/base/base_parser.rb
rley-0.7.07 lib/rley/base/base_parser.rb
rley-0.7.06 lib/rley/base/base_parser.rb
rley-0.7.05 lib/rley/base/base_parser.rb
rley-0.7.04 lib/rley/base/base_parser.rb