Class: RLTK::Parser::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/rltk/parser.rb

Overview

The Action class is used to indicate what action the parser should take given a current state and input token.

Direct Known Subclasses

Accept, GoTo, Reduce, Shift

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id = nil) ⇒ Action

Returns a new instance of Action.

Parameters:

  • id (Integer) (defaults to: nil)

    ID of this action.



1653
1654
1655
# File 'lib/rltk/parser.rb', line 1653

def initialize(id = nil)
  @id = id
end

Instance Attribute Details

#idInteger (readonly)

Returns ID of this action.

Returns:

  • (Integer)

    ID of this action.



1650
1651
1652
# File 'lib/rltk/parser.rb', line 1650

def id
  @id
end