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

Class: CodeGen_PECL_Tools_ProtoParser

Source Location: /CodeGen_PECL-1.1.0/PECL/Tools/ProtoParser.php

Class Overview




Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 100]


[ Top ]


Class Variables

$extension =

[line 106]

  • Access: protected

Type:   mixed


[ Top ]

$function =

[line 107]

  • Access: protected

Type:   mixed


[ Top ]

$yyerrcnt =

[line 401]

  • Access: public

Type:   int


[ Top ]

$yyExpectedTokens = array(
        /* 0 */ array(5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ),/* 1 */array(5,7,8,9,10,11,12,13,14,15,16,17,19,),/* 2 */array(7,8,9,10,11,12,13,14,15,16,19,),/* 3 */array(7,8,9,10,11,12,13,14,15,16,),/* 4 */array(7,8,9,10,11,12,13,14,15,16,),/* 5 */array(2,11,22,23,24,25,26,),/* 6 */array(17,18,),/* 7 */array(17,18,),/* 8 */array(17,20,),/* 9 */array(6,19,),/* 10 */array(6,19,),/* 11 */array(1,),/* 12 */array(2,),/* 13 */array(6,),/* 14 */array(18,),/* 15 */array(18,),/* 16 */array(20,),/* 17 */array(4,),/* 18 */array(3,),/* 19 */array(21,),/* 20 */array(3,),/* 21 */array(4,),/* 22 */array(2,),/* 23 */array(2,),/* 24 */array(2,),/* 25 */array(),/* 26 */array(),/* 27 */array(),/* 28 */array(),/* 29 */array(),/* 30 */array(),/* 31 */array(),/* 32 */array(),/* 33 */array(),/* 34 */array(),/* 35 */array(),/* 36 */array(),/* 37 */array(),/* 38 */array(),/* 39 */array(),/* 40 */array(),/* 41 */array(),/* 42 */array(),/* 43 */array(),/* 44 */array(),/* 45 */array(),/* 46 */array(),/* 47 */array(),/* 48 */array(),/* 49 */array(),/* 50 */array(),/* 51 */array(),/* 52 */array(),/* 53 */array(),/* 54 */array(),/* 55 */array(),/* 56 */array(),/* 57 */array(),/* 58 */array(),/* 59 */array(),)

[line 242]

  • Access: public

Type:   mixed


[ Top ]

$yyFallback = array(
    )

[line 344]

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

  • Access: public

Type:   int


[ Top ]

$yyReduceMap = array(
        2 => 2,
        3 => 3,
        4 => 4,
        5 => 4,
        36 => 4,
        6 => 6,
        7 => 7,
        8 => 8,
        9 => 9,
        10 => 10,
        11 => 11,
        12 => 12,
        13 => 13,
        14 => 14,
        15 => 15,
        16 => 16,
        18 => 18,
        29 => 18,
        19 => 19,
        30 => 19,
        20 => 20,
        21 => 21,
        24 => 24,
        25 => 25,
        26 => 26,
        28 => 26,
        31 => 31,
        32 => 32,
        33 => 33,
        34 => 34,
        35 => 35,
        37 => 37,
        38 => 38,
        39 => 39,
    )

[line 880]

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' => 28, 'rhs' => 1 ),array('lhs'=>28,'rhs'=>2),array('lhs'=>29,'rhs'=>5),array('lhs'=>30,'rhs'=>1),array('lhs'=>30,'rhs'=>1),array('lhs'=>32,'rhs'=>1),array('lhs'=>32,'rhs'=>2),array('lhs'=>33,'rhs'=>1),array('lhs'=>33,'rhs'=>1),array('lhs'=>33,'rhs'=>1),array('lhs'=>33,'rhs'=>1),array('lhs'=>33,'rhs'=>1),array('lhs'=>33,'rhs'=>2),array('lhs'=>33,'rhs'=>2),array('lhs'=>33,'rhs'=>1),array('lhs'=>33,'rhs'=>1),array('lhs'=>33,'rhs'=>1),array('lhs'=>31,'rhs'=>1),array('lhs'=>31,'rhs'=>3),array('lhs'=>31,'rhs'=>4),array('lhs'=>31,'rhs'=>1),array('lhs'=>31,'rhs'=>2),array('lhs'=>31,'rhs'=>1),array('lhs'=>31,'rhs'=>0),array('lhs'=>34,'rhs'=>3),array('lhs'=>34,'rhs'=>4),array('lhs'=>34,'rhs'=>3),array('lhs'=>34,'rhs'=>2),array('lhs'=>34,'rhs'=>1),array('lhs'=>36,'rhs'=>4),array('lhs'=>36,'rhs'=>5),array('lhs'=>35,'rhs'=>2),array('lhs'=>35,'rhs'=>4),array('lhs'=>37,'rhs'=>1),array('lhs'=>37,'rhs'=>1),array('lhs'=>37,'rhs'=>1),array('lhs'=>37,'rhs'=>1),array('lhs'=>37,'rhs'=>1),array('lhs'=>37,'rhs'=>3),array('lhs'=>37,'rhs'=>1),)

[line 831]

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

 array(
  array(
   int $lhs;         Symbol on the left-hand side of the rule
   int $nrhs;     Number of right-hand side symbols in the rule
  ),...
 );

  • Access: public

Type:   mixed


[ Top ]

$yyRuleName = array(
 /*   0 */ "proto_line ::= proto",
 /*   1 */ "proto_line ::= proto SEMICOLON",
 /*   2 */ "proto ::= rettype NAME PAR_OPEN param_spec PAR_CLOSE",
 /*   3 */ "rettype ::= VOID",
 /*   4 */ "rettype ::= typespec",
 /*   5 */ "typespec ::= typename",
 /*   6 */ "typespec ::= typename AMPERSAND",
 /*   7 */ "typename ::= BOOL",
 /*   8 */ "typename ::= INT",
 /*   9 */ "typename ::= FLOAT",
 /*  10 */ "typename ::= STRING",
 /*  11 */ "typename ::= ARRAY_",
 /*  12 */ "typename ::= CLASS_ NAME",
 /*  13 */ "typename ::= RESOURCE NAME",
 /*  14 */ "typename ::= MIXED",
 /*  15 */ "typename ::= CALLBACK",
 /*  16 */ "typename ::= STREAM",
 /*  17 */ "param_spec ::= param_list",
 /*  18 */ "param_spec ::= SQUARE_OPEN param SQUARE_CLOSE",
 /*  19 */ "param_spec ::= SQUARE_OPEN param optional_params SQUARE_CLOSE",
 /*  20 */ "param_spec ::= ELLIPSE",
 /*  21 */ "param_spec ::= typename ELLIPSE",
 /*  22 */ "param_spec ::= VOID",
 /*  23 */ "param_spec ::=",
 /*  24 */ "param_list ::= param_list COMMA ELLIPSE",
 /*  25 */ "param_list ::= param_list COMMA typename ELLIPSE",
 /*  26 */ "param_list ::= param_list COMMA param",
 /*  27 */ "param_list ::= param_list optional_params",
 /*  28 */ "param_list ::= param",
 /*  29 */ "optional_params ::= SQUARE_OPEN COMMA param SQUARE_CLOSE",
 /*  30 */ "optional_params ::= SQUARE_OPEN COMMA param optional_params SQUARE_CLOSE",
 /*  31 */ "param ::= typespec NAME",
 /*  32 */ "param ::= typespec NAME EQ default",
 /*  33 */ "default ::= TRUE_",
 /*  34 */ "default ::= FALSE_",
 /*  35 */ "default ::= NULL_",
 /*  36 */ "default ::= NUMVAL",
 /*  37 */ "default ::= STRVAL",
 /*  38 */ "default ::= ARRAY_ PAR_OPEN PAR_CLOSE",
 /*  39 */ "default ::= NAME",
    )

[line 429]

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

Type:   array


[ Top ]

$yystack = array()

[line 405]

  • Access: public

Type:   array


[ Top ]

$yyTokenName = array( 
  '$',             'SEMICOLON',     'NAME',          'PAR_OPEN',    
  'PAR_CLOSE',     'VOID',          'AMPERSAND',     'BOOL',        
  'INT',           'FLOAT',         'STRING',        'ARRAY_',      
  'CLASS_',        'RESOURCE',      'MIXED',         'CALLBACK',    
  'STREAM',        'SQUARE_OPEN',   'SQUARE_CLOSE',  'ELLIPSE',     
  'COMMA',         'EQ',            'TRUE_',         'FALSE_',      
  'NULL_',         'NUMVAL',        'STRVAL',        'error',       
  'proto_line',    'proto',         'rettype',       'param_spec',  
  'typespec',      'typename',      'param_list',    'param',       
  'optional_params',  'default',     
    )

[line 412]

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

  • Access: public

Type:   resource|0


[ Top ]

$yyTracePrompt =

[line 393]

String to prepend to debug output
  • Access: public

Type:   string|0


[ Top ]

$yy_action = array(
 /*     0 */    36,   17,   29,   41,   53,   50,   44,   23,   22,   54,
 /*    10 */    47,   48,    4,   34,   37,   29,   41,   53,   50,   44,
 /*    20 */    23,   22,   54,   47,   48,   29,   41,   53,   50,   44,
 /*    30 */    23,   22,   54,   47,   48,   25,    1,   42,   29,   41,
 /*    40 */    53,   50,   44,   23,   22,   54,   47,   48,   40,    3,
 /*    50 */    21,   12,   10,    8,   33,   16,   32,   18,  101,   11,
 /*    60 */    24,   59,   35,   13,   12,    9,   27,   43,   57,   58,
 /*    70 */    56,   55,   52,   12,   13,   27,    6,   12,   13,   45,
 /*    80 */     7,   16,   16,   26,    2,   39,   49,   20,   30,   46,
 /*    90 */    31,    5,   19,   51,   14,   38,   80,   15,   27,   28,
    )

[line 206]

  • Access: public

Type:   mixed


[ Top ]

$yy_default = array(
 /*     0 */   100,   83,  100,  100,  100,  100,  100,  100,   77,   65,
 /*    10 */    65,   60,  100,   65,  100,  100,  100,  100,  100,   91,
 /*    20 */   100,  100,  100,  100,  100,   90,   89,   66,   87,   67,
 /*    30 */    81,   62,   78,   88,   63,   64,   82,   80,   61,   79,
 /*    40 */    99,   68,   84,   86,   71,   85,   72,   75,   76,   73,
 /*    50 */    70,   92,   97,   69,   74,   96,   95,   93,   94,   98,
)

[line 304]

  • Access: public

Type:   mixed


[ Top ]

$yy_lookahead = array(
 /*     0 */     5,    3,    7,    8,    9,   10,   11,   12,   13,   14,
 /*    10 */    15,   16,   17,    5,   19,    7,    8,    9,   10,   11,
 /*    20 */    12,   13,   14,   15,   16,    7,    8,    9,   10,   11,
 /*    30 */    12,   13,   14,   15,   16,   18,    3,   19,    7,    8,
 /*    40 */     9,   10,   11,   12,   13,   14,   15,   16,    2,   20,
 /*    50 */    31,   32,   33,   34,   35,   17,   18,   11,   28,   29,
 /*    60 */    30,    4,   32,   33,   32,   33,    6,   35,   22,   23,
 /*    70 */    24,   25,   26,   32,   33,    6,   35,   32,   33,   19,
 /*    80 */    35,   17,   17,   18,   20,   18,    2,    2,   19,    2,
 /*    90 */     4,   21,    2,   37,   36,    1,   38,   36,    6,   36,
)

[line 218]

  • Access: public

Type:   mixed


[ Top ]

$yy_reduce_ofst = array(
 /*     0 */    30,   19,   32,   45,   41,   56,   58,   61,   63,
)

[line 239]

  • Access: public

Type:   mixed


[ Top ]

$yy_shift_ofst = array(
 /*     0 */     8,   -5,   18,   31,   31,   46,   38,   65,   64,   60,
 /*    10 */    69,   94,   90,   92,   67,   17,   29,   57,   -2,   70,
 /*    20 */    33,   86,   84,   87,   85,
)

[line 232]

  • Access: public

Type:   mixed


[ Top ]



Method Detail

doParse   [line 1209]

void doParse( int $yymajor, mixed $yytokenvalue, mixed 2)

The main parser program.

The first argument is the major token number. The second is the token value string as scanned from the input.


Parameters:

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

[ Top ]

PrintTrace   [line 379]

void PrintTrace( )

Output debug information to output (php://output stream)

[ Top ]

__construct (Constructor)   [line 109]

CodeGen_PECL_Tools_ProtoParser __construct( CodeGen_PECL_Extension $extension, CodeGen_PECL_Element_Function $function)


Parameters:

CodeGen_PECL_Extension   $extension   — 
CodeGen_PECL_Element_Function   $function   — 

[ Top ]

__destruct (Destructor)   [line 544]

void __destruct( )

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

[ Top ]

tokenName   [line 478]

string tokenName( int $tokenType)

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

Parameters:

int   $tokenType   — 

[ Top ]

Trace   [line 365]

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

void yy_accept( )

The following is executed when the parser accepts

%parse_accept code is inserted here


[ Top ]

yy_destructor   [line 496]

void yy_destructor( int $yymajor, mixed $yypminor)

The following function deletes the value associated with a symbol. The symbol can be either a terminal or nonterminal.

Parameters:

int   $yymajor   —  the symbol code
mixed   $yypminor   —  the symbol's value

[ Top ]

yy_find_reduce_action   [line 757]

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 self::YYNOCODE, then check to see if the action is independent of the look-ahead. If it is, return the action, otherwise return self::YY_NO_ACTION.


Parameters:

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

[ Top ]

yy_find_shift_action   [line 713]

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_get_expected_tokens   [line 560]

array yy_get_expected_tokens( int $token)

Based on the current state and parser stack, get a list of all

possible lookahead tokens


Parameters:

int   $token   — 

[ Top ]

yy_is_expected_token   [line 635]

bool yy_is_expected_token( int $token)

Based on the parser state and current parser stack, determine whether the lookahead token is possible.

The parser will convert the token value to an error token if not. This catches some unusual edge cases where the parser would fail.


Parameters:

int   $token   — 

[ Top ]

yy_parse_failed   [line 1150]

void yy_parse_failed( )

The following code executes when the parse fails

Code from %parse_fail is inserted here


[ Top ]

yy_pop_parser_stack   [line 523]

int yy_pop_parser_stack( CodeGen_PECL_Tools_ProtoParser_yyParser 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:

CodeGen_PECL_Tools_ProtoParser_yyParser   0   — 

[ Top ]

yy_r2   [line 923]

void yy_r2( )


[ Top ]

yy_r3   [line 929]

void yy_r3( )


[ Top ]

yy_r4   [line 932]

void yy_r4( )


[ Top ]

yy_r6   [line 935]

void yy_r6( )


[ Top ]

yy_r7   [line 938]

void yy_r7( )


[ Top ]

yy_r8   [line 941]

void yy_r8( )


[ Top ]

yy_r9   [line 944]

void yy_r9( )


[ Top ]

yy_r10   [line 947]

void yy_r10( )


[ Top ]

yy_r11   [line 950]

void yy_r11( )


[ Top ]

yy_r12   [line 953]

void yy_r12( )


[ Top ]

yy_r13   [line 956]

void yy_r13( )


[ Top ]

yy_r14   [line 959]

void yy_r14( )


[ Top ]

yy_r15   [line 962]

void yy_r15( )


[ Top ]

yy_r16   [line 965]

void yy_r16( )


[ Top ]

yy_r18   [line 968]

void yy_r18( )


[ Top ]

yy_r19   [line 977]

void yy_r19( )


[ Top ]

yy_r20   [line 986]

void yy_r20( )


[ Top ]

yy_r21   [line 991]

void yy_r21( )


[ Top ]

yy_r24   [line 1000]

void yy_r24( )


[ Top ]

yy_r25   [line 1005]

void yy_r25( )


[ Top ]

yy_r26   [line 1014]

void yy_r26( )


[ Top ]

yy_r31   [line 1022]

void yy_r31( )


[ Top ]

yy_r32   [line 1028]

void yy_r32( )


[ Top ]

yy_r33   [line 1036]

void yy_r33( )


[ Top ]

yy_r34   [line 1039]

void yy_r34( )


[ Top ]

yy_r35   [line 1042]

void yy_r35( )


[ Top ]

yy_r37   [line 1045]

void yy_r37( )


[ Top ]

yy_r38   [line 1048]

void yy_r38( )


[ Top ]

yy_r39   [line 1051]

void yy_r39( )


[ Top ]

yy_reduce   [line 1095]

void yy_reduce( int $yyruleno)

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

[ Top ]

yy_shift   [line 786]

void yy_shift( int $yyNewState, int $yyMajor, mixed $yypMinor)

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

[ Top ]

yy_syntax_error   [line 1169]

void yy_syntax_error( int $yymajor, mixed $TOKEN)

The following code executes when a syntax error first occurs.

%syntax_error code is inserted here


Parameters:

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

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:44:26 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.