Class: Antelope::Grammar::Token::Epsilon
- Inherits:
-
Antelope::Grammar::Token
- Object
- Antelope::Grammar::Token
- Antelope::Grammar::Token::Epsilon
- Defined in:
- lib/antelope/grammar/token/epsilon.rb
Overview
Defines an epsilon token. An epsilon token represents nothing. This is used to say that a nonterminal can reduce to nothing.
Instance Attribute Summary
Attributes inherited from Antelope::Grammar::Token
Instance Method Summary collapse
-
#epsilon? ⇒ Boolean
abstract
Whether or not the token is an epsilon token.
-
#initialize ⇒ Epsilon
constructor
Initialize.
Methods inherited from Antelope::Grammar::Token
#<=>, #===, #error?, #hash, #inspect, #invalidate_cache!, #nonterminal?, #terminal?, #to_a, #to_s, #without_transitions
Constructor Details
#initialize ⇒ Epsilon
Initialize. Technically takes no arguments. Sets
the name of the token to be :$empty
.
12 13 14 |
# File 'lib/antelope/grammar/token/epsilon.rb', line 12 def initialize(*) super :"$empty" end |
Instance Method Details
#epsilon? ⇒ Boolean
This method is abstract.
Whether or not the token is an epsilon token.
17 18 19 |
# File 'lib/antelope/grammar/token/epsilon.rb', line 17 def epsilon? true end |