Sha256: 0f8f8be48c4bcb4f45337239bab5b5a6e2c49f922b88ffb4c24bf0d3f8ac38b4

Contents?: true

Size: 844 Bytes

Versions: 2

Compression:

Stored size: 844 Bytes

Contents

# frozen_string_literal: true

require 'rley'

module Loxxy
  module FrontEnd
    # The superclass for all tokens that have a data value.
    class Literal < Rley::Lexical::Token
      # @return [Datatype] The value expressed in one of the Lox datatype.
      attr_reader :value

      # Constructor.
      # @param aValue [Datatype::BuiltinDatatype] the Lox data value
      # @param theLexeme [String] the lexeme (= piece of text from input)
      # @param aTerminal [Rley::Syntax::Terminal, String]
      #   The terminal symbol corresponding to the lexeme.
      # @param aPosition [Rley::Lexical::Position] The position of lexeme 
      #   in input text.
      def initialize(aValue, aLexeme, aTerminal, aPosition)
        super(aLexeme, aTerminal, aPosition)
        @value = aValue
      end
    end # class
  end # module
end # module

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
loxxy-0.0.4 lib/loxxy/front_end/literal.rb
loxxy-0.0.3 lib/loxxy/front_end/literal.rb