Sha256: d8d53aa24b5b1b1464a362d81e2102419bddfaea619ebab155737d424b3d6f4c

Contents?: true

Size: 825 Bytes

Versions: 11

Compression:

Stored size: 825 Bytes

Contents

# frozen_string_literal: true

require_relative 'parse_rep_creator'
require_relative 'parse_forest_builder'

module Rley # This module is used as a namespace
  module ParseRep # This module is used as a namespace
    # Utility class that helps to create a ParseForest from
    # a given Parsing object.
    class ParseForestFactory < ParseRepCreator
      protected

      # Create a Builder, that is, an object
      # that will create piece by piece the forest
      def builder(aParseResult, _builder = nil)
        ParseForestBuilder.new(aParseResult.tokens)
      end

      # When an end vertex is re-visited then jump
      # its corresponding start vertex. This behaviour
      # makes sense for sharing nodes.
      def jump_to_start
        true
      end
    end # class
  end # module
end # module

# End of file

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rley-0.8.11 lib/rley/parse_rep/parse_forest_factory.rb
rley-0.8.10 lib/rley/parse_rep/parse_forest_factory.rb
rley-0.8.09 lib/rley/parse_rep/parse_forest_factory.rb
rley-0.8.08 lib/rley/parse_rep/parse_forest_factory.rb
rley-0.8.06 lib/rley/parse_rep/parse_forest_factory.rb
rley-0.8.05 lib/rley/parse_rep/parse_forest_factory.rb
rley-0.8.03 lib/rley/parse_rep/parse_forest_factory.rb
rley-0.8.02 lib/rley/parse_rep/parse_forest_factory.rb
rley-0.8.01 lib/rley/parse_rep/parse_forest_factory.rb
rley-0.8.00 lib/rley/parse_rep/parse_forest_factory.rb
rley-0.7.08 lib/rley/parse_rep/parse_forest_factory.rb