Sha256: 486a430b1635ef79b7ee73ad403234dc8ba7d22009f14a4a3d1ef590b628607c

Contents?: true

Size: 715 Bytes

Versions: 26

Compression:

Stored size: 715 Bytes

Contents

require_relative 'terminal' # Load superclass

module Rley # This module is used as a namespace
  module Syntax # This module is used as a namespace
    # A verbatim word is terminal symbol that represents one unique word
    # in the language defined the grammar.
    class VerbatimSymbol < Terminal
      # The exact text representation of the word.
      attr_reader(:text)

      def initialize(aText)
        super(aText)  # Do we need to separate the text from the name?
        @text = aText.dup
      end
      
      # The String representation of the verbatim symbol
      # @return [String]
      def to_s()
        return "'#{text}'"
      end
    end # class
  end # module
end # module

# End of file

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
rley-0.1.02 lib/rley/syntax/verbatim_symbol.rb
rley-0.1.01 lib/rley/syntax/verbatim_symbol.rb
rley-0.1.00 lib/rley/syntax/verbatim_symbol.rb
rley-0.0.18 lib/rley/syntax/verbatim_symbol.rb
rley-0.0.17 lib/rley/syntax/verbatim_symbol.rb
rley-0.0.16 lib/rley/syntax/verbatim_symbol.rb