Class: Antelope::Ace::Token::Epsilon

Inherits:
Antelope::Ace::Token show all
Defined in:
lib/antelope/ace/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::Ace::Token

#from, #name, #to

Instance Method Summary collapse

Methods inherited from Antelope::Ace::Token

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

Constructor Details

#initializeEpsilon

Initialize. Technically takes no arguments. Sets the name of the token to be :epsilon.



11
12
13
# File 'lib/antelope/ace/token/epsilon.rb', line 11

def initialize(*)
  super :epsilon
end

Instance Method Details

#epsilon?Boolean

This method is abstract.

Whether or not the token is an epsilon token.

Returns:

  • (Boolean)


16
17
18
# File 'lib/antelope/ace/token/epsilon.rb', line 16

def epsilon?
  true
end