Class: Antelope::Grammar::Token::Error
- Inherits:
-
Terminal
- Object
- Antelope::Grammar::Token
- Terminal
- Antelope::Grammar::Token::Error
- Defined in:
- lib/antelope/grammar/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::Grammar::Token
Instance Method Summary collapse
-
#error? ⇒ Boolean
abstract
Whether or not the token is an error token.
-
#initialize ⇒ Error
constructor
Initialize the error token.
Methods inherited from Terminal
Methods inherited from Antelope::Grammar::Token
#<=>, #===, #epsilon?, #hash, #inspect, #invalidate_cache!, #nonterminal?, #terminal?, #to_a, #to_s, #without_transitions
Constructor Details
#initialize ⇒ Error
Initialize the error token. Technically takes no arguments.
Sets the name to be :$error
.
13 14 15 |
# File 'lib/antelope/grammar/token/error.rb', line 13 def initialize(*) super :$error end |
Instance Method Details
#error? ⇒ Boolean
This method is abstract.
Whether or not the token is an error token.
18 19 20 |
# File 'lib/antelope/grammar/token/error.rb', line 18 def error? true end |