Sha256: 8e3ca0692e60f47bdee3a8744e139bf80e497bc9bad17620c3ab01fb8a1d4fc9

Contents?: true

Size: 853 Bytes

Versions: 19

Compression:

Stored size: 853 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.
      # @param aName [String] The name of the grammar symbol.
      def initialize(aName)
        super(aName)
        self.generative = true
      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

19 entries across 19 versions & 1 rubygems

Version Path
rley-0.6.09 lib/rley/syntax/terminal.rb
rley-0.6.08 lib/rley/syntax/terminal.rb
rley-0.6.07 lib/rley/syntax/terminal.rb
rley-0.6.06 lib/rley/syntax/terminal.rb
rley-0.6.05 lib/rley/syntax/terminal.rb
rley-0.6.04 lib/rley/syntax/terminal.rb
rley-0.6.03 lib/rley/syntax/terminal.rb
rley-0.6.02 lib/rley/syntax/terminal.rb
rley-0.6.01 lib/rley/syntax/terminal.rb
rley-0.6.00 lib/rley/syntax/terminal.rb
rley-0.5.14 lib/rley/syntax/terminal.rb
rley-0.5.13 lib/rley/syntax/terminal.rb
rley-0.5.12 lib/rley/syntax/terminal.rb
rley-0.5.11 lib/rley/syntax/terminal.rb
rley-0.5.10 lib/rley/syntax/terminal.rb
rley-0.5.09 lib/rley/syntax/terminal.rb
rley-0.5.08 lib/rley/syntax/terminal.rb
rley-0.5.07 lib/rley/syntax/terminal.rb
rley-0.5.06 lib/rley/syntax/terminal.rb