Sha256: 2ade33a85427ca1f4c0f84e51d267f496874013d1d791eeeaed9a4439ff9d40e

Contents?: true

Size: 526 Bytes

Versions: 11

Compression:

Stored size: 526 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

11 entries across 11 versions & 1 rubygems

Version Path
antelope-0.2.0 lib/antelope/ace/token/epsilon.rb
antelope-0.1.11 lib/antelope/ace/token/epsilon.rb
antelope-0.1.10 lib/antelope/ace/token/epsilon.rb
antelope-0.1.9 lib/antelope/ace/token/epsilon.rb
antelope-0.1.8 lib/antelope/ace/token/epsilon.rb
antelope-0.1.7 lib/antelope/ace/token/epsilon.rb
antelope-0.1.6 lib/antelope/ace/token/epsilon.rb
antelope-0.1.5 lib/antelope/ace/token/epsilon.rb
antelope-0.1.4 lib/antelope/ace/token/epsilon.rb
antelope-0.1.3 lib/antelope/ace/token/epsilon.rb
antelope-0.1.2 lib/antelope/ace/token/epsilon.rb