phpDocumentor PHP_ParserGenerator
[ class tree: PHP_ParserGenerator ] [ index: PHP_ParserGenerator ] [ all elements ]

Class: PHP_ParserGenerator_ActionTable

Source Location: /ParserGenerator/ActionTable.php

Class PHP_ParserGenerator_ActionTable

Class Overview

The state of the yy_action table under construction is an instance of

the following structure

Located in /ParserGenerator/ActionTable.php [line 58]



		
				Author(s):
		
		
		
Information Tags:
Since:  Class available since Release 0.1.0
Version:  @package_version@
License:  New BSD License
Copyright:  2006 Gregory Beaver

Properties

Methods

[ Top ]
Property Summary
array   $aAction   The $yy_action table under construction.
array   $aLookahead   A single new transaction set.
int   $mnAction   The action associated with the smallest lookahead token.
int   $mnLookahead   The smallest (minimum) value of any lookahead token in $aLookahead
int   $mxLookahead   The largest (maximum) value of any lookahead token in $aLookahead
int   $nAction   Number of used slots in $aAction
int   $nLookahead   The number of slots used in $aLookahead.

[ Top ]
Method Summary
void   acttab_action()   Add a new action to the current transaction set
int   acttab_insert()   Add the transaction set built up with prior calls to acttab_action() into the current action table. Then reset the transaction set back to an empty set in preparation for a new round of acttab_action() calls.

[ Top ]
Properties
array   $aAction = array(array(
'lookahead' => -1,
'action' => -1
))
[line 78]

The $yy_action table under construction.

Each entry is of format:

  1.   array(
  2.       'lookahead' => -1// Value of the lookahead token (symbol index)
  3.             'action' => -1     // Action to take on the given lookahead (action index)
  4.     );

API Tags:
Access:  public
See:  PHP_ParserGenerator_Data::compute_action()


[ Top ]
array   $aLookahead = array(array(
'lookahead' => 0,
'action' => 0
))
[line 89]

A single new transaction set.

API Tags:
Access:  public
See:  $aAction format of the internal array is described here


[ Top ]
int   $mnAction = 0 [line 107]

The action associated with the smallest lookahead token.

API Tags:
Access:  public
See:  PHP_ParserGenerator_ActionTable::$mnLookahead


[ Top ]
int   $mnLookahead = 0 [line 101]

The smallest (minimum) value of any lookahead token in $aLookahead

The lowest non-terminal is always introduced earlier in the parser file, and is therefore a more significant token.

API Tags:
Access:  public


[ Top ]
int   $mxLookahead = 0 [line 112]

The largest (maximum) value of any lookahead token in $aLookahead

API Tags:
Access:  public


[ Top ]
int   $nAction = 0 [line 64]

Number of used slots in $aAction

API Tags:
Access:  public


[ Top ]
int   $nLookahead = 0 [line 121]

The number of slots used in $aLookahead.

This is the same as count($aLookahead), but there was no pressing reason to change this when porting from C.

API Tags:
Access:  public
See:  PHP_ParserGenerator_ActionTable::$mnLookahead


[ Top ]
Methods
acttab_action  [line 128]

  void acttab_action( int $lookahead, int $action  )

Add a new action to the current transaction set

Parameters:
int   $lookahead: 
int   $action: 


[ Top ]
acttab_insert  [line 161]

  int acttab_insert( )

Add the transaction set built up with prior calls to acttab_action() into the current action table. Then reset the transaction set back to an empty set in preparation for a new round of acttab_action() calls.

Return the offset into the action table of the new transaction.


API Tags:
Return:  Return the offset that should be added to the lookahead in order to get the index into $yy_action of the action. This will be used in generation of $yy_ofst tables (reduce and shift)

Information Tags:
Throws:  Exception

[ Top ]

Documentation generated on Sun, 02 Jul 2006 09:10:57 -0400 by phpDocumentor 1.3.0