Sha256: 85e6b9243f3541265eaa01723d28e71a307f707b0f50bf326a9651c43c115c52

Contents?: true

Size: 815 Bytes

Versions: 17

Compression:

Stored size: 815 Bytes

Contents

require_relative 'grm_symbol' # Load superclass

module Rley # This module is used as a namespace
  module Syntax # This module is used as a namespace
    # A terminal symbol represents a class of words in the language 
    # defined the grammar.
    class Terminal < GrmSymbol
      
      # Constructor.
      # aName [String] The name of the grammar symbol.
      def initialize(aName)
        super(aName)
      end
      
      # Return true iff the symbol is a terminal
      def terminal?()
        return true
      end
      
      # @return [false] Return true if the symbol derives
      # the empty string. As terminal symbol corresponds to a input token
      # it is by definition non-nullable.
      def nullable?() 
        false
      end
    end # class
  end # module
end # module

# End of file

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rley-0.4.05 lib/rley/syntax/terminal.rb
rley-0.4.04 lib/rley/syntax/terminal.rb
rley-0.4.03 lib/rley/syntax/terminal.rb
rley-0.4.02 lib/rley/syntax/terminal.rb
rley-0.4.01 lib/rley/syntax/terminal.rb
rley-0.4.00 lib/rley/syntax/terminal.rb
rley-0.3.12 lib/rley/syntax/terminal.rb
rley-0.3.11 lib/rley/syntax/terminal.rb
rley-0.3.10 lib/rley/syntax/terminal.rb
rley-0.3.09 lib/rley/syntax/terminal.rb
rley-0.3.08 lib/rley/syntax/terminal.rb
rley-0.3.07 lib/rley/syntax/terminal.rb
rley-0.3.06 lib/rley/syntax/terminal.rb
rley-0.3.05 lib/rley/syntax/terminal.rb
rley-0.3.04 lib/rley/syntax/terminal.rb
rley-0.3.01 lib/rley/syntax/terminal.rb
rley-0.3.00 lib/rley/syntax/terminal.rb