Sha256: b9be2e2ec49da28ffa42aa09960dec8931b9e5ee211ff48bf556077b82457776

Contents?: true

Size: 818 Bytes

Versions: 16

Compression:

Stored size: 818 Bytes

Contents

module Rley # This module is used as a namespace
  # Namespace dedicated to parse tree formatters.
  module Formatter
    # Superclass for parse tree formatters.
    class BaseFormatter
      # The IO output stream in which the formatter's result will be sent.
      attr_reader(:output)

      # Constructor.
      # @param anIO [IO] an output IO where the formatter's result will
      # be placed.
      def initialize(anIO)
        @output = anIO
      end

      public

      # Given a parse tree visitor, perform the visit
      # and render the visit events in the output stream.
      # @param aVisitor [ParseTreeVisitor]
      def render(aVisitor)
        aVisitor.subscribe(self)
        aVisitor.start
        aVisitor.unsubscribe(self)
      end
    end # class
  end # module
end # module

# End of file

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rley-0.3.04 lib/rley/formatter/base_formatter.rb
rley-0.3.01 lib/rley/formatter/base_formatter.rb
rley-0.3.00 lib/rley/formatter/base_formatter.rb
rley-0.2.15 lib/rley/formatter/base_formatter.rb
rley-0.2.14 lib/rley/formatter/base_formatter.rb
rley-0.2.12 lib/rley/formatter/base_formatter.rb
rley-0.2.11 lib/rley/formatter/base_formatter.rb
rley-0.2.10 lib/rley/formatter/base_formatter.rb
rley-0.2.09 lib/rley/formatter/base_formatter.rb
rley-0.2.08 lib/rley/formatter/base_formatter.rb
rley-0.2.06 lib/rley/formatter/base_formatter.rb
rley-0.2.05 lib/rley/formatter/base_formatter.rb
rley-0.2.04 lib/rley/formatter/base_formatter.rb
rley-0.2.03 lib/rley/formatter/base_formatter.rb
rley-0.2.02 lib/rley/formatter/base_formatter.rb
rley-0.2.01 lib/rley/formatter/base_formatter.rb