Sha256: 39f24b6db2de5bd17d55e1726f1bee8dc7f2bf60bab87ee8a89ac082c8ff9d57

Contents?: true

Size: 798 Bytes

Versions: 4

Compression:

Stored size: 798 Bytes

Contents

# frozen_string_literal: true

require_relative 'parse_rep_creator'
# require_relative 'parse_tree_builder' # TODO remove this line
require_relative 'cst_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 ParseTree from
    # a given Parsing object.
    class ParseTreeFactory < ParseRepCreator
      protected

      # Create a Builder, that is, an object
      # that will create piece by piece the forest
      def builder(aParseResult, aBuilder = nil)
        if aBuilder
          aBuilder.new(aParseResult.tokens)
        else
          CSTBuilder.new(aParseResult.tokens)
        end
      end     
    end # class
  end # module
end # module

# End of file

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rley-0.7.07 lib/rley/parse_rep/parse_tree_factory.rb
rley-0.7.06 lib/rley/parse_rep/parse_tree_factory.rb
rley-0.7.05 lib/rley/parse_rep/parse_tree_factory.rb
rley-0.7.04 lib/rley/parse_rep/parse_tree_factory.rb