Class: Antelope::Ace::Token::Error

Inherits:
Terminal show all
Defined in:
lib/antelope/ace/token/error.rb

Overview

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.

Instance Attribute Summary

Attributes inherited from Antelope::Ace::Token

#from, #name, #to

Instance Method Summary collapse

Methods inherited from Terminal

#terminal?

Methods inherited from Antelope::Ace::Token

#<=>, #===, #epsilon?, #hash, #inspect, #nonterminal?, #terminal?, #to_a, #to_s, #without_transitions

Constructor Details

#initializeError

Initialize the error token. Technically takes no arguments. Sets the name to be :$error.



15
16
17
# File 'lib/antelope/ace/token/error.rb', line 15

def initialize(*)
  super :$error
end

Instance Method Details

#error?Boolean

This method is abstract.

Whether or not the token is an error token.

Returns:

  • (Boolean)


20
21
22
# File 'lib/antelope/ace/token/error.rb', line 20

def error?
  true
end