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, #inspect, #nonterminal?, #terminal?, #to_a, #to_s, #without_transitions

Constructor Details

#initializeEpsilon

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



13
14
15
# File 'lib/antelope/ace/token/epsilon.rb', line 13

def initialize(*)
  super :"$empty"
end

Instance Method Details

#epsilon?Boolean

This method is abstract.

Whether or not the token is an epsilon token.

Returns:

  • (Boolean)


18
19
20
# File 'lib/antelope/ace/token/epsilon.rb', line 18

def epsilon?
  true
end