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

Class: ParseyyParser

Source Location: /PHP_ParserGenerator-0.1.7/oops.php

Class Overview


The state of the parser is completely contained in an instance of


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 30]
The state of the parser is completely contained in an instance of

the following structure



[ Top ]


Class Variables

$yyerrcnt =

[line 212]

  • Access: public

Type:   int


[ Top ]

$yyFallback = array(
    )

[line 171]

The next table maps tokens into fallback tokens. If a construct like the following:

%fallback ID X Y Z.

appears in the grammer, then ID becomes a fallback token for X, Y, and Z. Whenever one of the tokens X, Y, or Z is input to the parser but it does not parse, the type of the token is changed to ID and the parse is retried before an error is thrown.

  • Access: public

Type:   mixed


[ Top ]

$yyidx =

[line 208]

  • Access: public

Type:   int


[ Top ]

$yyReduceMap = array(
        0 => 0,
    )

[line 454]

The following table contains a mapping of reduce action to method name that handles the reduction.

If a rule is not set, it has no handler.

  • Access: public

Type:   mixed


[ Top ]

$yyRuleInfo = array(
  array( 'lhs' => 10, 'rhs' => 1 ),)

[line 444]

The following table contains information about every rule that is used during the reduce.

static const struct { YYCODETYPE lhs; Symbol on the left-hand side of the rule unsigned char nrhs; Number of right-hand side symbols in the rule }

  • Access: public

Type:   mixed


[ Top ]

$yyRuleName = array(
 /*   0 */ "common_scalar ::= T_LNUMBER|T_DNUMBER|T_CONSTANT_ENCAPSED_STRING|T_LINE|T_FILE|T_CLASS_C|T_METHOD_C|T_FUNC_C",
    )

[line 234]

For tracing reduce actions, the names of all rules are required.
  • Access: public

Type:   array


[ Top ]

$yystack = array()

[line 217]

  • Access: public

Type:   array


[ Top ]

$yyTokenName = array( 
  '$',             'T_LNUMBER',     'T_DNUMBER',     'T_CONSTANT_ENCAPSED_STRING',
  'T_LINE',        'T_FILE',        'T_CLASS_C',     'T_METHOD_C',  
  'T_FUNC_C',      'error',         'common_scalar',
    )

[line 224]

For tracing shifts, the names of all terminals and nonterminals

are required. The following table supplies these names

  • Access: public

Type:   array


[ Top ]

$yyTraceFILE =

[line 203]

  • Access: public

Type:   mixed


[ Top ]

$yyTracePrompt =

[line 204]

  • Access: public

Type:   mixed


[ Top ]

$yy_action = array(
 /*     0 */     1,    1,    1,    1,    1,    1,    1,    1,    4,
    )

[line 105]

  • Access: public

Type:   mixed


[ Top ]

$yy_default = array(
 /*     0 */     3,    2,
)

[line 121]

  • Access: public

Type:   mixed


[ Top ]

$yy_lookahead = array(
 /*     0 */     1,    2,    3,    4,    5,    6,    7,    8,   10,
)

[line 108]

  • Access: public

Type:   mixed


[ Top ]

$yy_reduce_ofst = array(
 /*     0 */    -2,
)

[line 118]

  • Access: public

Type:   mixed


[ Top ]

$yy_shift_ofst = array(
 /*     0 */    -1,
)

[line 113]

  • Access: public

Type:   mixed


[ Top ]



Method Detail

__destruct (Destructor)   [line 311]

void __destruct( )

Deallocate and destroy a parser. Destructors are all called for all stack elements before shutting the parser down.

[ Top ]

doParse   [line 626]

void doParse( int $yymajor, mixed $yytokenvalue, [mixed $extraargument = null])

The main parser program.

The first argument is a pointer to a structure obtained from "ParseAlloc" which describes the current state of the parser. The second argument is the major token number. The third is the minor token. The fourth optional argument is whatever the user wants (and specified in the grammar) and is available for use by the action routines.

Inputs:

  • A pointer to the parser (an opaque structure.)
  • The major token number.
  • The minor token number (token value).
  • An option argument of a grammar-specified type.
Outputs: None.


Parameters:

int   $yymajor   —  the token number
mixed   $yytokenvalue   —  the token value
mixed   $extraargument   —  any extra arguments that should be passed to handlers

[ Top ]

ParseTokenName   [line 244]

string ParseTokenName( int $tokenType)

This function returns the symbolic name associated with a token value.

Parameters:

int   $tokenType   — 

[ Top ]

Trace   [line 192]

void Trace( resource $TraceFILE, string $zTracePrompt)

Turn parser tracing on by giving a stream to which to write the trace and a prompt to preface each trace message. Tracing is turned off by making either argument NULL

Inputs:

  • A stream resource to which trace output should be written. If NULL, then tracing is turned off.
  • A prefix string written at the beginning of every line of trace output. If NULL, then tracing is turned off.
Outputs:

  • None.


Parameters:

resource   $TraceFILE   — 
string   $zTracePrompt   — 

[ Top ]

yy_accept   [line 589]

void yy_accept( [ $extraargument = null])


Parameters:

   $extraargument   — 

[ Top ]

yy_destructor   [line 258]

void yy_destructor( $yymajor, $yypminor)


Parameters:

   $yymajor   — 
   $yypminor   — 

[ Top ]

yy_find_reduce_action   [line 371]

void yy_find_reduce_action( int $stateno, int $iLookAhead)

Find the appropriate action for a parser given the non-terminal look-ahead token iLookAhead.

If the look-ahead token is YYNOCODE, then check to see if the action is independent of the look-ahead. If it is, return the action, otherwise return YY_NO_ACTION.


Parameters:

int   $stateno   —  Current state number
int   $iLookAhead   —  The look-ahead token

[ Top ]

yy_find_shift_action   [line 327]

void yy_find_shift_action( int $iLookAhead)

Find the appropriate action for a parser given the terminal look-ahead token iLookAhead.

If the look-ahead token is YYNOCODE, then check to see if the action is independent of the look-ahead. If it is, return the action, otherwise return YY_NO_ACTION.


Parameters:

int   $iLookAhead   —  The look-ahead token

[ Top ]

yy_parse_failed   [line 558]

void yy_parse_failed( [ $extraargument = null])

The following code executes when the parse fails

Parameters:

   $extraargument   — 

[ Top ]

yy_pop_parser_stack   [line 285]

int yy_pop_parser_stack( ParseyyParser 0)

Pop the parser's stack once.

If there is a destructor routine associated with the token which is popped from the stack, then call it.

Return the major token number for the symbol popped.


Parameters:

ParseyyParser   0   — 

[ Top ]

yy_r0   [line 465]

void yy_r0( )


[ Top ]

yy_reduce   [line 503]

void yy_reduce( int $yyruleno, [ $extraargument = null])

Perform a reduce action and the shift that must immediately follow the reduce.

For a rule such as:

 A ::= B blah C. { dosomething(); }

This function will first call the action, if any, ("dosomething();" in our example), and then it will pop three states from the stack, one for each entry on the right-hand side of the expression (B, blah, and C in our example rule), and then push the result of the action back on to the stack with the resulting state reduced to (as described in the .out file)


Parameters:

int   $yyruleno   —  Number of the rule by which to reduce
   $extraargument   — 

[ Top ]

yy_shift   [line 400]

void yy_shift( int $yyNewState, int $yyMajor, mixed $yypMinor, [ $extraargument = null])

Perform a shift action.

Parameters:

int   $yyNewState   —  The new state to shift in
int   $yyMajor   —  The major token to shift in
mixed   $yypMinor   —  the minor token to shift in
   $extraargument   — 

[ Top ]

yy_syntax_error   [line 578]

void yy_syntax_error( int $yymajor, mixed $yyminor, [ $extraargument = null])

The following code executes when a syntax error first occurs.

Parameters:

int   $yymajor   —  The major type of the error token
mixed   $yyminor   —  The minor type of the error token
   $extraargument   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:41:00 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.