Sha256: b695cb412d2d6193386bde095d08cdf2b9b3144d1dc8365c34ec163251417866

Contents?: true

Size: 814 Bytes

Versions: 17

Compression:

Stored size: 814 Bytes

Contents

module Rley # This module is used as a namespace
  module Syntax # This module is used as a namespace
    # Abstract class for grammar symbols.
    # A grammar symbol is an element that appears in grammar rules.
    class GrmSymbol  
      # The name of the grammar symbol
      attr_reader(:name)

      # Constructor.
      # aName [String] The name of the grammar symbol.
      def initialize(aName)
        @name = aName.dup
      end
      
      # Return true iff the symbol is a terminal
      def terminal?()
        # Default implementation to override if necessary
        return false
      end
      
      # The String representation of the grammar symbol
      # @return [String]
      def to_s()
        return name.to_s
      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/grm_symbol.rb
rley-0.4.04 lib/rley/syntax/grm_symbol.rb
rley-0.4.03 lib/rley/syntax/grm_symbol.rb
rley-0.4.02 lib/rley/syntax/grm_symbol.rb
rley-0.4.01 lib/rley/syntax/grm_symbol.rb
rley-0.4.00 lib/rley/syntax/grm_symbol.rb
rley-0.3.12 lib/rley/syntax/grm_symbol.rb
rley-0.3.11 lib/rley/syntax/grm_symbol.rb
rley-0.3.10 lib/rley/syntax/grm_symbol.rb
rley-0.3.09 lib/rley/syntax/grm_symbol.rb
rley-0.3.08 lib/rley/syntax/grm_symbol.rb
rley-0.3.07 lib/rley/syntax/grm_symbol.rb
rley-0.3.06 lib/rley/syntax/grm_symbol.rb
rley-0.3.05 lib/rley/syntax/grm_symbol.rb
rley-0.3.04 lib/rley/syntax/grm_symbol.rb
rley-0.3.01 lib/rley/syntax/grm_symbol.rb
rley-0.3.00 lib/rley/syntax/grm_symbol.rb