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

Class: PHP_ParserGenerator_ActionTable

Source Location: /PHP_ParserGenerator-0.1.7/ParserGenerator/ActionTable.php

Class Overview


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


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2006 Gregory Beaver

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 62]
The state of the yy_action table under construction is an instance of the following structure


[ Top ]


Class Variables

$aAction = array(
        array(
            'lookahead' => -1,
            'action' => -1
        ))

[line 82]

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.   );


Type:   array


[ Top ]

$aLookahead = array(
        array(
            'lookahead' => 0,
            'action' => 0
        ))

[line 94]

A single new transaction set.
  • See: $aAction format of the internal array is described here
  • Access: public

Type:   array


[ Top ]

$mnAction =  0

[line 113]

The action associated with the smallest lookahead token.

Type:   int


[ Top ]

$mnLookahead =  0

[line 107]

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.

  • Access: public

Type:   int


[ Top ]

$mxLookahead =  0

[line 118]

The largest (maximum) value of any lookahead token in $aLookahead
  • Access: public

Type:   int


[ Top ]

$nAction =  0

[line 68]

Number of used slots in $aAction
  • Access: public

Type:   int


[ Top ]

$nLookahead =  0

[line 127]

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.


Type:   int


[ Top ]



Method Detail

acttab_action   [line 137]

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 171]

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.

  • 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)
  • Throws: Exception

[ Top ]


Documentation generated on Mon, 25 Oct 2010 14:00:39 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.