Sha256: d4eb23ee956b95dea7bcd94e57d564f86b22c5894ce54d487419a0a889354f46

Contents?: true

Size: 955 Bytes

Versions: 31

Compression:

Stored size: 955 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 non-terminal symbol (sometimes called a syntactic variable) represents
    # a composition of terminal or non-terminal symbols
    class NonTerminal < GrmSymbol
      attr_writer(:nullable)
    
      # Constructor.
      # @param aName [String] The name of the grammar symbol.
      def initialize(aName)
        super(aName)
      end
      
      public
      
      # @return [false/true] Return true if the symbol derives
      # the empty string. As non-terminal symbol is nullable when it can
      # can match to zero input token.
      # The "nullability" of a non-terminal can practically be determined once
      # all the production rules of the grammar are specified.
      def nullable?()
        return @nullable
      end
    end # class
  end # module
end # module
# End of file

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
rley-0.3.04 lib/rley/syntax/non_terminal.rb
rley-0.3.01 lib/rley/syntax/non_terminal.rb
rley-0.3.00 lib/rley/syntax/non_terminal.rb
rley-0.2.15 lib/rley/syntax/non_terminal.rb
rley-0.2.14 lib/rley/syntax/non_terminal.rb
rley-0.2.12 lib/rley/syntax/non_terminal.rb
rley-0.2.11 lib/rley/syntax/non_terminal.rb
rley-0.2.10 lib/rley/syntax/non_terminal.rb
rley-0.2.09 lib/rley/syntax/non_terminal.rb
rley-0.2.08 lib/rley/syntax/non_terminal.rb
rley-0.2.06 lib/rley/syntax/non_terminal.rb
rley-0.2.05 lib/rley/syntax/non_terminal.rb
rley-0.2.04 lib/rley/syntax/non_terminal.rb
rley-0.2.03 lib/rley/syntax/non_terminal.rb
rley-0.2.02 lib/rley/syntax/non_terminal.rb
rley-0.2.01 lib/rley/syntax/non_terminal.rb
rley-0.2.00 lib/rley/syntax/non_terminal.rb
rley-0.1.12 lib/rley/syntax/non_terminal.rb
rley-0.1.11 lib/rley/syntax/non_terminal.rb
rley-0.1.10 lib/rley/syntax/non_terminal.rb