Sha256: 9d7481a4fe12add89a952c63691333665dc7b4ff06b6842a2fc06bd0c24ab8e4

Contents?: true

Size: 550 Bytes

Versions: 3

Compression:

Stored size: 550 Bytes

Contents

# encoding: utf-8

module Antelope
  module Ace
    class Token

      # Defines an epsilon token.  An epsilon token represents
      # nothing.  This is used to say that a nonterminal can
      # reduce to nothing.
      class Epsilon < Token
        # Initialize.  Technically takes no arguments.  Sets
        # the name of the token to be `:$empty`.
        def initialize(*)
          super :"$empty"
        end

        # (see Token#epsilon?)
        def epsilon?
          true
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
antelope-0.2.4 lib/antelope/ace/token/epsilon.rb
antelope-0.2.3 lib/antelope/ace/token/epsilon.rb
antelope-0.2.2 lib/antelope/ace/token/epsilon.rb