Source for file PHP.php
Documentation is available at PHP.php
/* Driver template for the LEMON parser generator.
** The author disclaims copyright to this source code.
/** The following structure represents a single element of the
* parser's stack. Information stored includes:
* + The state number for the parser at this level of the stack.
* + The value of the token stored at this level of the stack.
* (In other words, the "major" token.)
* + The semantic value stored at this level of the stack. This is
* the information used by the action routines in the grammar.
* It is sometimes called the "minor" token.
public $stateno; /* The state-number */
public $major; /* The major token value. This is the code
** number for the token at this stack level */
public $minor; /* The user-supplied minor token value. This
** is the value of the token */
* The state of the parser is completely contained in an instance of
* the following structure
/* First off, code is include which follows the "include" declaration
static public $transTable = array ();
if (!count(self ::$transTable)) {
$start = 240; // start nice and low to be sure
while (token_name ($start) == 'UNKNOWN') {
ord('=') => self ::EQUALS ,
ord('?') => self ::QUESTION ,
ord('&') => self ::AMPERSAND ,
ord('<') => self ::LESSTHAN ,
ord('>') => self ::GREATERTHAN ,
ord('/') => self ::DIVIDE ,
ord('%') => self ::PERCENT ,
ord('!') => self ::EXCLAM ,
ord('[') => self ::LBRACKET ,
ord('(') => self ::LPAREN ,
ord(')') => self ::RPAREN ,
ord('{') => self ::LCURLY ,
ord('}') => self ::RCURLY ,
ord('`') => self ::BACKQUOTE ,
ord('$') => self ::DOLLAR ,
ord(']') => self ::RBRACKET ,
ord('"') => self ::DOUBLEQUOTE ,
ord("'") => self ::SINGLEQUOTE ,
for ($i = $start; $i < self ::YYERRORSYMBOL + $start; $i++ ) {
if (!isset ($hash[$lt])) {
$lt = ($lt == 'T_ML_COMMENT') ? 'T_COMMENT' : $lt;
$lt = ($lt == 'T_DOUBLE_COLON') ? 'T_PAAMAYIM_NEKUDOTAYIM' : $lt;
// echo "$lt has hash? ".$hash[$lt]."\n";
//echo "compare $lt with {$tokens[$i]}\n";
// set the map to false if nothing in there.
self ::$transTable = $map;
/* Next is all token values, in a form suitable for use by makeheaders.
** This section will be null unless lemon is run with the -m switch.
** These constants (all generated automatically by the parser generator)
** specify the various kinds of tokens (terminals) that the parser
** Each symbol here is a terminal symbol in the grammar.
const T_INCLUDE_ONCE = 2;
const T_REQUIRE_ONCE = 5;
const T_MINUS_EQUAL = 13;
const T_CONCAT_EQUAL = 16;
const T_BOOLEAN_AND = 26;
const T_IS_NOT_EQUAL = 31;
const T_IS_IDENTICAL = 32;
const T_IS_NOT_IDENTICAL = 33;
const T_IS_SMALLER_OR_EQUAL = 35;
const T_IS_GREATER_OR_EQUAL = 37;
const T_DOUBLE_CAST = 52;
const T_STRING_CAST = 53;
const T_OBJECT_CAST = 55;
const T_HALT_COMPILER = 71;
const T_INLINE_HTML = 87;
const T_IMPLEMENTS = 102;
const T_CONSTANT_ENCAPSED_STRING = 109;
const T_DOUBLE_ARROW = 115;
const T_PAAMAYIM_NEKUDOTAYIM = 116;
const T_ENDFOREACH = 118;
const T_ENDDECLARE = 119;
const T_OBJECT_OPERATOR = 127;
const T_NUM_STRING = 129;
const T_ENCAPSED_AND_WHITESPACE = 130;
const T_BAD_CHARACTER = 132;
const T_DOLLAR_OPEN_CURLY_BRACES = 133;
const T_STRING_VARNAME = 134;
const T_CURLY_OPEN = 135;
const T_START_HEREDOC = 140;
const T_END_HEREDOC = 141;
const YY_NO_ACTION = 1040;
const YY_ACCEPT_ACTION = 1039;
const YY_ERROR_ACTION = 1038;
/* Next are that tables used to determine what action to take based on the
** current state and lookahead token. These tables are used to implement
** functions that take a state number and lookahead value and return an
** Suppose the action integer is N. Then the action is determined as
** 0 <= N < YYNSTATE Shift N. That is, push the lookahead
** token onto the stack and goto state N.
** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE.
** N == YYNSTATE+YYNRULE A syntax error has occurred.
** N == YYNSTATE+YYNRULE+1 The parser accepts its input.
** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused
** slots in the yy_action[] table.
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as
** yy_action[ yy_shift_ofst[S] + X ]
** If the index value yy_shift_ofst[S]+X is out of range or if the value
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
** and that yy_default[S] should be used instead.
** The formula above is for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
** The following are the tables generated in this section:
** yy_action[] A single table containing all actions.
** yy_lookahead[] A table containing the lookahead for each entry in
** yy_action. Used to detect hash collisions.
** yy_shift_ofst[] For each state, the offset into yy_action for
** yy_reduce_ofst[] For each state, the offset into yy_action for
** shifting non-terminals after a reduce.
** yy_default[] Default action for each state.
Documentation generated on Mon, 11 Mar 2019 15:41:04 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|