Sha256: 5b5104e1ce27ab23e8727e1dd09b8980c5aa865d4c922fb0a221ef20b5334f35

Contents?: true

Size: 627 Bytes

Versions: 2

Compression:

Stored size: 627 Bytes

Contents

# encoding: utf-8

module Antelope
  class Grammar
    class Token
      # Defines an error token.  This may be used internally by the
      # parser when it enters panic mode; any tokens following this
      # are the synchronisation tokens.  This is considered a terminal
      # for the purposes of rule definitions.
      class Error < Terminal
        # Initialize the error token.  Technically takes no arguments.
        # Sets the name to be `:$error`.
        def initialize(*)
          super :$error
        end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
antelope-0.4.1 lib/antelope/grammar/token/error.rb
antelope-0.4.0 lib/antelope/grammar/token/error.rb