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

Class: PHP_ParserGenerator_ActionTable

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

Class Overview


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


Author(s):

Version:

  • 0.1.5

Copyright:

  • 2006 Gregory Beaver

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 58]
The state of the yy_action table under construction is an instance of

the following structure

  • Author: Gregory Beaver <cellog@php.net>
  • Version: 0.1.5
  • Copyright: 2006 Gregory Beaver
  • Since: Class available since Release 0.1.0
  • License: New BSD License


[ Top ]


Class Variables

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


Type:   array


[ Top ]

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

[line 89]

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

Type:   array


[ Top ]

$mnAction =  0

[line 107]

The action associated with the smallest lookahead token.

Type:   int


[ Top ]

$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.

  • Access: public

Type:   int


[ Top ]

$mxLookahead =  0

[line 112]

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

Type:   int


[ Top ]

$nAction =  0

[line 64]

Number of used slots in $aAction
  • Access: public

Type:   int


[ Top ]

$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.


Type:   int


[ Top ]



Method Detail

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.

  • 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 Thu, 10 Dec 2015 05:43:58 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.