mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-03-11 01:40:01 +01:00
Replace yydebug flag with separate debug parser "ParserDebug"
Debugging shouldn't be necessairy normally, but carries a 25% performance overhead.
This commit is contained in:
parent
489f8c8b56
commit
df82e3db45
@ -41,17 +41,12 @@ class YYParser
|
||||
protected $yysp;
|
||||
protected $yyaccept;
|
||||
|
||||
@if -t
|
||||
/** Debug mode flag **/
|
||||
public $yydebug = true;
|
||||
@endif
|
||||
|
||||
@if -t
|
||||
private static $yyterminals = array(
|
||||
@listvar terminals
|
||||
, "???"
|
||||
);
|
||||
|
||||
@if -t
|
||||
private static $yyproduction = array(
|
||||
@production-strings;
|
||||
);
|
||||
@ -117,40 +112,32 @@ class YYParser
|
||||
@if -t
|
||||
/* Traditional Debug Mode */
|
||||
private function YYTRACE_NEWSTATE($state, $sym) {
|
||||
if ($this->yydebug) {
|
||||
$this->yyprintln('% State ' . $state . ', Lookahead '
|
||||
. ($sym < 0 ? '--none--' : self::$yyterminals[$sym]));
|
||||
}
|
||||
$this->yyprintln('% State ' . $state . ', Lookahead '
|
||||
. ($sym < 0 ? '--none--' : self::$yyterminals[$sym]));
|
||||
}
|
||||
|
||||
private function YYTRACE_READ($sym) {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Reading ' . self::$yyterminals[$sym]);
|
||||
$this->yyprintln('% Reading ' . self::$yyterminals[$sym]);
|
||||
}
|
||||
|
||||
private function YYTRACE_SHIFT($sym) {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Shift ' . self::$yyterminals[$sym]);
|
||||
$this->yyprintln('% Shift ' . self::$yyterminals[$sym]);
|
||||
}
|
||||
|
||||
private function YYTRACE_ACCEPT() {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Accepted.');
|
||||
$this->yyprintln('% Accepted.');
|
||||
}
|
||||
|
||||
private function YYTRACE_REDUCE($n) {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Reduce by (' . $n . ') ' . self::$yyproduction[$n]);
|
||||
$this->yyprintln('% Reduce by (' . $n . ') ' . self::$yyproduction[$n]);
|
||||
}
|
||||
|
||||
private function YYTRACE_POP($state) {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Recovering, uncovers state ' . $state);
|
||||
$this->yyprintln('% Recovering, uncovers state ' . $state);
|
||||
}
|
||||
|
||||
private function YYTRACE_DISCARD($sym) {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Discard ' . self::$yyterminals[$sym]);
|
||||
$this->yyprintln('% Discard ' . self::$yyterminals[$sym]);
|
||||
}
|
||||
@endif
|
||||
|
@ -3,24 +3,13 @@
|
||||
echo '<pre>';
|
||||
|
||||
echo 'Building parser. Output: "',
|
||||
`kmyacc -l -v -t -m kmyacc.class.php.parser -L c zend_language_parser.phpy`,
|
||||
`kmyacc -l -v -L c -m php.kmyacc -p Parser zend_language_parser.phpy`,
|
||||
'"', "\n";
|
||||
|
||||
echo 'Reading parser.', "\n";
|
||||
$source = file_get_contents('y.tab.c');
|
||||
|
||||
echo 'Replacing "YYParser" -> "Parser", "$EOF" -> \'$EOF\', "$start : start" -> \'$start : start\'.', "\n";
|
||||
$source = str_replace(
|
||||
array(
|
||||
'YYParser',
|
||||
'"$EOF"',
|
||||
'"$start : start"'
|
||||
),
|
||||
array(
|
||||
'Parser',
|
||||
'\'$EOF\'',
|
||||
'\'$start : start\''
|
||||
),
|
||||
'"$EOF"',
|
||||
'\'$EOF\'',
|
||||
$source
|
||||
);
|
||||
|
||||
@ -28,6 +17,27 @@ echo 'Moving parser to lib/Parser.php.', "\n";
|
||||
file_put_contents(dirname(__DIR__) . '/lib/Parser.php', $source);
|
||||
unlink(__DIR__ . '/y.tab.c');
|
||||
|
||||
echo 'Building debug parser. Output: "',
|
||||
`kmyacc -l -v -t -L c -m php.kmyacc -p ParserDebug zend_language_parser.phpy`,
|
||||
'"', "\n";
|
||||
|
||||
$source = file_get_contents('y.tab.c');
|
||||
$source = str_replace(
|
||||
array(
|
||||
'"$EOF"',
|
||||
'"$start : start"'
|
||||
),
|
||||
array(
|
||||
'\'$EOF\'',
|
||||
'\'$start : start\''
|
||||
),
|
||||
$source
|
||||
);
|
||||
|
||||
echo 'Moving debug parser to lib/ParserDebug.php.', "\n";
|
||||
file_put_contents(dirname(__DIR__) . '/lib/ParserDebug.php', $source);
|
||||
unlink(__DIR__ . '/y.tab.c');
|
||||
|
||||
echo 'Done.';
|
||||
|
||||
echo '</pre>';
|
@ -933,8 +933,8 @@ state 9
|
||||
. error
|
||||
|
||||
state 10
|
||||
(24) inner_statement_list : inner_statement_list . inner_statement
|
||||
(235) expr_without_variable : T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars '{' inner_statement_list . '}'
|
||||
(24) inner_statement_list : inner_statement_list . inner_statement
|
||||
|
||||
T_INCLUDE shift 57
|
||||
T_INCLUDE_ONCE shift 58
|
||||
@ -1239,8 +1239,8 @@ state 12
|
||||
. error
|
||||
|
||||
state 13
|
||||
(24) inner_statement_list : inner_statement_list . inner_statement
|
||||
(139) method_body : '{' inner_statement_list . '}'
|
||||
(24) inner_statement_list : inner_statement_list . inner_statement
|
||||
|
||||
T_INCLUDE shift 57
|
||||
T_INCLUDE_ONCE shift 58
|
||||
@ -10458,7 +10458,6 @@ state 135
|
||||
. error
|
||||
|
||||
state 136
|
||||
(93) case_list : case_list T_CASE expr . case_separator inner_statement_list
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -10486,6 +10485,7 @@ state 136
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(93) case_list : case_list T_CASE expr . case_separator inner_statement_list
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -10519,7 +10519,6 @@ state 136
|
||||
. error
|
||||
|
||||
state 137
|
||||
(48) statement : expr . ';'
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -10547,6 +10546,7 @@ state 137
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(48) statement : expr . ';'
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -10578,7 +10578,6 @@ state 137
|
||||
. error
|
||||
|
||||
state 138
|
||||
(38) statement : T_BREAK expr . ';'
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -10606,6 +10605,7 @@ state 138
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(38) statement : T_BREAK expr . ';'
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -10637,7 +10637,6 @@ state 138
|
||||
. error
|
||||
|
||||
state 139
|
||||
(40) statement : T_CONTINUE expr . ';'
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -10665,6 +10664,7 @@ state 139
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(40) statement : T_CONTINUE expr . ';'
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -10696,7 +10696,6 @@ state 139
|
||||
. error
|
||||
|
||||
state 140
|
||||
(56) statement : T_THROW expr . ';'
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -10724,6 +10723,7 @@ state 140
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(56) statement : T_THROW expr . ';'
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -10932,8 +10932,6 @@ state 143
|
||||
. error
|
||||
|
||||
state 144
|
||||
(31) statement : T_IF '(' expr . ')' statement elseif_list else_single
|
||||
(32) statement : T_IF '(' expr . ')' ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';'
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -10961,6 +10959,8 @@ state 144
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(31) statement : T_IF '(' expr . ')' statement elseif_list else_single
|
||||
(32) statement : T_IF '(' expr . ')' ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';'
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -10992,7 +10992,6 @@ state 144
|
||||
. error
|
||||
|
||||
state 145
|
||||
(33) statement : T_WHILE '(' expr . ')' while_statement
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -11020,6 +11019,7 @@ state 145
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(33) statement : T_WHILE '(' expr . ')' while_statement
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -11051,9 +11051,6 @@ state 145
|
||||
. error
|
||||
|
||||
state 146
|
||||
(50) statement : T_FOREACH '(' expr . T_AS variable ')' foreach_statement
|
||||
(51) statement : T_FOREACH '(' expr . T_AS '&' variable ')' foreach_statement
|
||||
(52) statement : T_FOREACH '(' expr . T_AS variable T_DOUBLE_ARROW optional_ref variable ')' foreach_statement
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -11081,6 +11078,9 @@ state 146
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(50) statement : T_FOREACH '(' expr . T_AS variable ')' foreach_statement
|
||||
(51) statement : T_FOREACH '(' expr . T_AS '&' variable ')' foreach_statement
|
||||
(52) statement : T_FOREACH '(' expr . T_AS variable T_DOUBLE_ARROW optional_ref variable ')' foreach_statement
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -11112,7 +11112,6 @@ state 146
|
||||
. error
|
||||
|
||||
state 147
|
||||
(36) statement : T_SWITCH '(' expr . ')' switch_case_list
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -11140,6 +11139,7 @@ state 147
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(36) statement : T_SWITCH '(' expr . ')' switch_case_list
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -11763,7 +11763,6 @@ state 157
|
||||
. error
|
||||
|
||||
state 158
|
||||
(34) statement : T_DO statement T_WHILE '(' expr . ')' ';'
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -11791,6 +11790,7 @@ state 158
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(34) statement : T_DO statement T_WHILE '(' expr . ')' ';'
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -12061,7 +12061,6 @@ state 162
|
||||
. error
|
||||
|
||||
state 163
|
||||
(100) elseif_list : elseif_list T_ELSEIF '(' expr . ')' statement
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -12089,6 +12088,7 @@ state 163
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(100) elseif_list : elseif_list T_ELSEIF '(' expr . ')' statement
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -12120,7 +12120,6 @@ state 163
|
||||
. error
|
||||
|
||||
state 164
|
||||
(102) new_elseif_list : new_elseif_list T_ELSEIF '(' expr . ')' ':' inner_statement_list
|
||||
(183) expr_without_variable : expr . T_BOOLEAN_OR expr
|
||||
(184) expr_without_variable : expr . T_BOOLEAN_AND expr
|
||||
(185) expr_without_variable : expr . T_LOGICAL_OR expr
|
||||
@ -12148,6 +12147,7 @@ state 164
|
||||
(211) expr_without_variable : expr . T_INSTANCEOF class_name_reference
|
||||
(213) expr_without_variable : expr . '?' expr ':' expr
|
||||
(214) expr_without_variable : expr . '?' ':' expr
|
||||
(102) new_elseif_list : new_elseif_list T_ELSEIF '(' expr . ')' ':' inner_statement_list
|
||||
|
||||
T_LOGICAL_OR shift 84
|
||||
T_LOGICAL_XOR shift 85
|
||||
@ -14864,7 +14864,6 @@ state 222
|
||||
. reduce (300)
|
||||
|
||||
state 223
|
||||
(43) statement : T_RETURN variable . ';'
|
||||
(163) expr_without_variable : variable . '=' expr
|
||||
(164) expr_without_variable : variable . '=' '&' variable
|
||||
(165) expr_without_variable : variable . '=' '&' T_NEW class_name_reference ctor_arguments
|
||||
@ -14884,6 +14883,7 @@ state 223
|
||||
(300) expr : variable .
|
||||
(307) object_access : variable . T_OBJECT_OPERATOR object_property '(' function_call_argument_list ')'
|
||||
(308) object_access_arrayable : variable . T_OBJECT_OPERATOR object_property
|
||||
(43) statement : T_RETURN variable . ';'
|
||||
|
||||
'=' shift 44
|
||||
T_PLUS_EQUAL shift 108
|
||||
@ -15122,8 +15122,8 @@ state 228
|
||||
. reduce (210)
|
||||
|
||||
state 229
|
||||
(68) class_declaration_statement : T_INTERFACE T_STRING interface_extends_list '{' class_statement_list . '}'
|
||||
(133) class_statement_list : class_statement_list . class_statement
|
||||
(68) class_declaration_statement : T_INTERFACE T_STRING interface_extends_list '{' class_statement_list . '}'
|
||||
(142) method_modifiers : .
|
||||
|
||||
T_CONST shift 495
|
||||
@ -15144,8 +15144,8 @@ state 229
|
||||
. reduce (142)
|
||||
|
||||
state 230
|
||||
(67) class_declaration_statement : class_entry_type T_STRING extends_from implements_list '{' class_statement_list . '}'
|
||||
(133) class_statement_list : class_statement_list . class_statement
|
||||
(67) class_declaration_statement : class_entry_type T_STRING extends_from implements_list '{' class_statement_list . '}'
|
||||
(142) method_modifiers : .
|
||||
|
||||
T_CONST shift 495
|
||||
@ -16189,10 +16189,10 @@ state 279
|
||||
. error
|
||||
|
||||
state 280
|
||||
(249) name : T_NAMESPACE . T_NS_SEPARATOR namespace_name
|
||||
(11) top_statement : T_NAMESPACE . namespace_name ';'
|
||||
(12) top_statement : T_NAMESPACE . namespace_name '{' top_statement_list '}'
|
||||
(13) top_statement : T_NAMESPACE . '{' top_statement_list '}'
|
||||
(249) name : T_NAMESPACE . T_NS_SEPARATOR namespace_name
|
||||
|
||||
T_STRING shift 582 and reduce (5)
|
||||
T_NS_SEPARATOR shift 346
|
||||
@ -16412,10 +16412,10 @@ state 298
|
||||
. reduce (315)
|
||||
|
||||
state 299
|
||||
(50) statement : T_FOREACH '(' expr T_AS variable . ')' foreach_statement
|
||||
(52) statement : T_FOREACH '(' expr T_AS variable . T_DOUBLE_ARROW optional_ref variable ')' foreach_statement
|
||||
(307) object_access : variable . T_OBJECT_OPERATOR object_property '(' function_call_argument_list ')'
|
||||
(308) object_access_arrayable : variable . T_OBJECT_OPERATOR object_property
|
||||
(50) statement : T_FOREACH '(' expr T_AS variable . ')' foreach_statement
|
||||
(52) statement : T_FOREACH '(' expr T_AS variable . T_DOUBLE_ARROW optional_ref variable ')' foreach_statement
|
||||
|
||||
T_OBJECT_OPERATOR shift 266
|
||||
T_DOUBLE_ARROW shift 365
|
||||
@ -16581,16 +16581,16 @@ state 316
|
||||
. reduce (316)
|
||||
|
||||
state 317
|
||||
(46) statement : T_ECHO expr_list . ';'
|
||||
(158) expr_list : expr_list . ',' expr
|
||||
(46) statement : T_ECHO expr_list . ';'
|
||||
|
||||
',' shift 123
|
||||
';' shift 619 and reduce (46)
|
||||
. error
|
||||
|
||||
state 318
|
||||
(66) function_declaration_statement : T_FUNCTION optional_ref . T_STRING '(' parameter_list ')' '{' inner_statement_list '}'
|
||||
(235) expr_without_variable : T_FUNCTION optional_ref . '(' parameter_list ')' lexical_vars '{' inner_statement_list '}'
|
||||
(66) function_declaration_statement : T_FUNCTION optional_ref . T_STRING '(' parameter_list ')' '{' inner_statement_list '}'
|
||||
|
||||
T_STRING shift 421
|
||||
'(' shift 258
|
||||
@ -16605,17 +16605,17 @@ state 319
|
||||
. error
|
||||
|
||||
state 320
|
||||
(44) statement : T_GLOBAL global_var_list . ';'
|
||||
(124) global_var_list : global_var_list . ',' global_var
|
||||
(44) statement : T_GLOBAL global_var_list . ';'
|
||||
|
||||
',' shift 307
|
||||
';' shift 627 and reduce (44)
|
||||
. error
|
||||
|
||||
state 321
|
||||
(45) statement : T_STATIC static_var_list . ';'
|
||||
(129) static_var_list : static_var_list . ',' T_VARIABLE
|
||||
(130) static_var_list : static_var_list . ',' T_VARIABLE '=' static_scalar
|
||||
(45) statement : T_STATIC static_var_list . ';'
|
||||
|
||||
',' shift 425
|
||||
';' shift 628 and reduce (45)
|
||||
@ -16674,8 +16674,8 @@ state 327
|
||||
. error
|
||||
|
||||
state 328
|
||||
(63) variables_list : variables_list . ',' variable
|
||||
(215) expr_without_variable : T_ISSET '(' variables_list . ')'
|
||||
(63) variables_list : variables_list . ',' variable
|
||||
|
||||
',' shift 248
|
||||
')' shift 662 and reduce (215)
|
||||
@ -16769,9 +16769,9 @@ state 338
|
||||
. reduce (301)
|
||||
|
||||
state 339
|
||||
(51) statement : T_FOREACH '(' expr T_AS '&' variable . ')' foreach_statement
|
||||
(307) object_access : variable . T_OBJECT_OPERATOR object_property '(' function_call_argument_list ')'
|
||||
(308) object_access_arrayable : variable . T_OBJECT_OPERATOR object_property
|
||||
(51) statement : T_FOREACH '(' expr T_AS '&' variable . ')' foreach_statement
|
||||
|
||||
T_OBJECT_OPERATOR shift 266
|
||||
')' shift 22
|
||||
@ -16795,9 +16795,9 @@ state 341
|
||||
. error
|
||||
|
||||
state 342
|
||||
(52) statement : T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW optional_ref variable . ')' foreach_statement
|
||||
(307) object_access : variable . T_OBJECT_OPERATOR object_property '(' function_call_argument_list ')'
|
||||
(308) object_access_arrayable : variable . T_OBJECT_OPERATOR object_property
|
||||
(52) statement : T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW optional_ref variable . ')' foreach_statement
|
||||
|
||||
T_OBJECT_OPERATOR shift 266
|
||||
')' shift 24
|
||||
@ -16862,8 +16862,8 @@ state 349
|
||||
. reduce (260)
|
||||
|
||||
state 350
|
||||
(66) function_declaration_statement : T_FUNCTION . optional_ref T_STRING '(' parameter_list ')' '{' inner_statement_list '}'
|
||||
(235) expr_without_variable : T_FUNCTION . optional_ref '(' parameter_list ')' lexical_vars '{' inner_statement_list '}'
|
||||
(66) function_declaration_statement : T_FUNCTION . optional_ref T_STRING '(' parameter_list ')' '{' inner_statement_list '}'
|
||||
(64) optional_ref : .
|
||||
|
||||
'&' shift 603 and reduce (65)
|
||||
@ -16871,8 +16871,8 @@ state 350
|
||||
. reduce (64)
|
||||
|
||||
state 351
|
||||
(45) statement : T_STATIC . static_var_list ';'
|
||||
(246) class_name : T_STATIC .
|
||||
(45) statement : T_STATIC . static_var_list ';'
|
||||
|
||||
T_VARIABLE shift 409
|
||||
static_var_list goto 321
|
||||
@ -17303,8 +17303,8 @@ state 406
|
||||
. error
|
||||
|
||||
state 407
|
||||
(42) statement : T_RETURN expr_without_variable . ';'
|
||||
(301) expr : expr_without_variable .
|
||||
(42) statement : T_RETURN expr_without_variable . ';'
|
||||
|
||||
';' shift 623 and reduce (42)
|
||||
. reduce (301)
|
||||
@ -17426,9 +17426,9 @@ state 425
|
||||
. error
|
||||
|
||||
state 426
|
||||
(62) variables_list : variable .
|
||||
(307) object_access : variable . T_OBJECT_OPERATOR object_property '(' function_call_argument_list ')'
|
||||
(308) object_access_arrayable : variable . T_OBJECT_OPERATOR object_property
|
||||
(62) variables_list : variable .
|
||||
|
||||
T_OBJECT_OPERATOR shift 266
|
||||
. reduce (62)
|
||||
@ -17714,9 +17714,9 @@ state 457
|
||||
. error
|
||||
|
||||
state 458
|
||||
(107) parameter_list : non_empty_parameter_list .
|
||||
(111) non_empty_parameter_list : non_empty_parameter_list . ',' optional_class_type optional_ref T_VARIABLE
|
||||
(112) non_empty_parameter_list : non_empty_parameter_list . ',' optional_class_type optional_ref T_VARIABLE '=' static_scalar
|
||||
(107) parameter_list : non_empty_parameter_list .
|
||||
|
||||
',' shift 264
|
||||
. reduce (107)
|
||||
@ -17858,9 +17858,9 @@ state 479
|
||||
. error
|
||||
|
||||
state 480
|
||||
(63) variables_list : variables_list ',' variable .
|
||||
(307) object_access : variable . T_OBJECT_OPERATOR object_property '(' function_call_argument_list ')'
|
||||
(308) object_access_arrayable : variable . T_OBJECT_OPERATOR object_property
|
||||
(63) variables_list : variables_list ',' variable .
|
||||
|
||||
T_OBJECT_OPERATOR shift 266
|
||||
. reduce (63)
|
||||
|
410
lib/Parser.php
410
lib/Parser.php
@ -151,9 +151,6 @@ class Parser
|
||||
protected $yysp;
|
||||
protected $yyaccept;
|
||||
|
||||
/** Debug mode flag **/
|
||||
public $yydebug = true;
|
||||
|
||||
private static $yyterminals = array(
|
||||
'$EOF',
|
||||
"error",
|
||||
@ -303,368 +300,6 @@ class Parser
|
||||
, "???"
|
||||
);
|
||||
|
||||
private static $yyproduction = array(
|
||||
'$start : start',
|
||||
"start : top_statement_list",
|
||||
"top_statement_list : top_statement_list top_statement",
|
||||
"top_statement_list : /* empty */",
|
||||
"namespace_name : namespace_name_sub",
|
||||
"namespace_name_sub : T_STRING",
|
||||
"namespace_name_sub : namespace_name_sub T_NS_SEPARATOR T_STRING",
|
||||
"top_statement : statement",
|
||||
"top_statement : function_declaration_statement",
|
||||
"top_statement : class_declaration_statement",
|
||||
"top_statement : T_HALT_COMPILER '(' ')' ';'",
|
||||
"top_statement : T_NAMESPACE namespace_name ';'",
|
||||
"top_statement : T_NAMESPACE namespace_name '{' top_statement_list '}'",
|
||||
"top_statement : T_NAMESPACE '{' top_statement_list '}'",
|
||||
"top_statement : T_USE use_declarations ';'",
|
||||
"top_statement : constant_declaration ';'",
|
||||
"use_declarations : use_declarations ',' use_declaration",
|
||||
"use_declarations : use_declaration",
|
||||
"use_declaration : namespace_name",
|
||||
"use_declaration : namespace_name T_AS T_STRING",
|
||||
"use_declaration : T_NS_SEPARATOR namespace_name",
|
||||
"use_declaration : T_NS_SEPARATOR namespace_name T_AS T_STRING",
|
||||
"constant_declaration : constant_declaration ',' T_STRING '=' static_scalar",
|
||||
"constant_declaration : T_CONST T_STRING '=' static_scalar",
|
||||
"inner_statement_list : inner_statement_list inner_statement",
|
||||
"inner_statement_list : /* empty */",
|
||||
"inner_statement : statement",
|
||||
"inner_statement : function_declaration_statement",
|
||||
"inner_statement : class_declaration_statement",
|
||||
"inner_statement : T_HALT_COMPILER '(' ')' ';'",
|
||||
"statement : '{' inner_statement_list '}'",
|
||||
"statement : T_IF '(' expr ')' statement elseif_list else_single",
|
||||
"statement : T_IF '(' expr ')' ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';'",
|
||||
"statement : T_WHILE '(' expr ')' while_statement",
|
||||
"statement : T_DO statement T_WHILE '(' expr ')' ';'",
|
||||
"statement : T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement",
|
||||
"statement : T_SWITCH '(' expr ')' switch_case_list",
|
||||
"statement : T_BREAK ';'",
|
||||
"statement : T_BREAK expr ';'",
|
||||
"statement : T_CONTINUE ';'",
|
||||
"statement : T_CONTINUE expr ';'",
|
||||
"statement : T_RETURN ';'",
|
||||
"statement : T_RETURN expr_without_variable ';'",
|
||||
"statement : T_RETURN variable ';'",
|
||||
"statement : T_GLOBAL global_var_list ';'",
|
||||
"statement : T_STATIC static_var_list ';'",
|
||||
"statement : T_ECHO expr_list ';'",
|
||||
"statement : T_INLINE_HTML",
|
||||
"statement : expr ';'",
|
||||
"statement : T_UNSET '(' variables_list ')' ';'",
|
||||
"statement : T_FOREACH '(' expr T_AS variable ')' foreach_statement",
|
||||
"statement : T_FOREACH '(' expr T_AS '&' variable ')' foreach_statement",
|
||||
"statement : T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW optional_ref variable ')' foreach_statement",
|
||||
"statement : T_DECLARE '(' declare_list ')' declare_statement",
|
||||
"statement : ';'",
|
||||
"statement : T_TRY '{' inner_statement_list '}' catches",
|
||||
"statement : T_THROW expr ';'",
|
||||
"statement : T_GOTO T_STRING ';'",
|
||||
"statement : T_STRING ':'",
|
||||
"catches : catch",
|
||||
"catches : catches catch",
|
||||
"catch : T_CATCH '(' name T_VARIABLE ')' '{' inner_statement_list '}'",
|
||||
"variables_list : variable",
|
||||
"variables_list : variables_list ',' variable",
|
||||
"optional_ref : /* empty */",
|
||||
"optional_ref : '&'",
|
||||
"function_declaration_statement : T_FUNCTION optional_ref T_STRING '(' parameter_list ')' '{' inner_statement_list '}'",
|
||||
"class_declaration_statement : class_entry_type T_STRING extends_from implements_list '{' class_statement_list '}'",
|
||||
"class_declaration_statement : T_INTERFACE T_STRING interface_extends_list '{' class_statement_list '}'",
|
||||
"class_entry_type : T_CLASS",
|
||||
"class_entry_type : T_ABSTRACT T_CLASS",
|
||||
"class_entry_type : T_FINAL T_CLASS",
|
||||
"extends_from : /* empty */",
|
||||
"extends_from : T_EXTENDS name",
|
||||
"interface_extends_list : /* empty */",
|
||||
"interface_extends_list : T_EXTENDS interface_list",
|
||||
"implements_list : /* empty */",
|
||||
"implements_list : T_IMPLEMENTS interface_list",
|
||||
"interface_list : name",
|
||||
"interface_list : interface_list ',' name",
|
||||
"for_statement : statement",
|
||||
"for_statement : ':' inner_statement_list T_ENDFOR ';'",
|
||||
"foreach_statement : statement",
|
||||
"foreach_statement : ':' inner_statement_list T_ENDFOREACH ';'",
|
||||
"declare_statement : statement",
|
||||
"declare_statement : ':' inner_statement_list T_ENDDECLARE ';'",
|
||||
"declare_list : T_STRING '=' static_scalar",
|
||||
"declare_list : declare_list ',' T_STRING '=' static_scalar",
|
||||
"switch_case_list : '{' case_list '}'",
|
||||
"switch_case_list : '{' ';' case_list '}'",
|
||||
"switch_case_list : ':' case_list T_ENDSWITCH ';'",
|
||||
"switch_case_list : ':' ';' case_list T_ENDSWITCH ';'",
|
||||
"case_list : /* empty */",
|
||||
"case_list : case_list T_CASE expr case_separator inner_statement_list",
|
||||
"case_list : case_list T_DEFAULT case_separator inner_statement_list",
|
||||
"case_separator : ':'",
|
||||
"case_separator : ';'",
|
||||
"while_statement : statement",
|
||||
"while_statement : ':' inner_statement_list T_ENDWHILE ';'",
|
||||
"elseif_list : /* empty */",
|
||||
"elseif_list : elseif_list T_ELSEIF '(' expr ')' statement",
|
||||
"new_elseif_list : /* empty */",
|
||||
"new_elseif_list : new_elseif_list T_ELSEIF '(' expr ')' ':' inner_statement_list",
|
||||
"else_single : /* empty */",
|
||||
"else_single : T_ELSE statement",
|
||||
"new_else_single : /* empty */",
|
||||
"new_else_single : T_ELSE ':' inner_statement_list",
|
||||
"parameter_list : non_empty_parameter_list",
|
||||
"parameter_list : /* empty */",
|
||||
"non_empty_parameter_list : optional_class_type optional_ref T_VARIABLE",
|
||||
"non_empty_parameter_list : optional_class_type optional_ref T_VARIABLE '=' static_scalar",
|
||||
"non_empty_parameter_list : non_empty_parameter_list ',' optional_class_type optional_ref T_VARIABLE",
|
||||
"non_empty_parameter_list : non_empty_parameter_list ',' optional_class_type optional_ref T_VARIABLE '=' static_scalar",
|
||||
"optional_class_type : /* empty */",
|
||||
"optional_class_type : name",
|
||||
"optional_class_type : T_ARRAY",
|
||||
"function_call_argument_list : non_empty_function_call_argument_list",
|
||||
"function_call_argument_list : /* empty */",
|
||||
"non_empty_function_call_argument_list : expr_without_variable",
|
||||
"non_empty_function_call_argument_list : variable",
|
||||
"non_empty_function_call_argument_list : '&' variable",
|
||||
"non_empty_function_call_argument_list : non_empty_function_call_argument_list ',' expr_without_variable",
|
||||
"non_empty_function_call_argument_list : non_empty_function_call_argument_list ',' variable",
|
||||
"non_empty_function_call_argument_list : non_empty_function_call_argument_list ',' '&' variable",
|
||||
"global_var_list : global_var_list ',' global_var",
|
||||
"global_var_list : global_var",
|
||||
"global_var : T_VARIABLE",
|
||||
"global_var : '$' variable",
|
||||
"global_var : '$' '{' expr '}'",
|
||||
"static_var_list : static_var_list ',' T_VARIABLE",
|
||||
"static_var_list : static_var_list ',' T_VARIABLE '=' static_scalar",
|
||||
"static_var_list : T_VARIABLE",
|
||||
"static_var_list : T_VARIABLE '=' static_scalar",
|
||||
"class_statement_list : class_statement_list class_statement",
|
||||
"class_statement_list : /* empty */",
|
||||
"class_statement : variable_modifiers class_variable_declaration ';'",
|
||||
"class_statement : class_constant_declaration ';'",
|
||||
"class_statement : method_modifiers T_FUNCTION optional_ref T_STRING '(' parameter_list ')' method_body",
|
||||
"method_body : ';'",
|
||||
"method_body : '{' inner_statement_list '}'",
|
||||
"variable_modifiers : non_empty_member_modifiers",
|
||||
"variable_modifiers : T_VAR",
|
||||
"method_modifiers : /* empty */",
|
||||
"method_modifiers : non_empty_member_modifiers",
|
||||
"non_empty_member_modifiers : member_modifier",
|
||||
"non_empty_member_modifiers : non_empty_member_modifiers member_modifier",
|
||||
"member_modifier : T_PUBLIC",
|
||||
"member_modifier : T_PROTECTED",
|
||||
"member_modifier : T_PRIVATE",
|
||||
"member_modifier : T_STATIC",
|
||||
"member_modifier : T_ABSTRACT",
|
||||
"member_modifier : T_FINAL",
|
||||
"class_variable_declaration : class_variable_declaration ',' T_VARIABLE",
|
||||
"class_variable_declaration : class_variable_declaration ',' T_VARIABLE '=' static_scalar",
|
||||
"class_variable_declaration : T_VARIABLE",
|
||||
"class_variable_declaration : T_VARIABLE '=' static_scalar",
|
||||
"class_constant_declaration : class_constant_declaration ',' T_STRING '=' static_scalar",
|
||||
"class_constant_declaration : T_CONST T_STRING '=' static_scalar",
|
||||
"expr_list : expr_list ',' expr",
|
||||
"expr_list : expr",
|
||||
"for_expr : /* empty */",
|
||||
"for_expr : expr_list",
|
||||
"expr_without_variable : T_LIST '(' assignment_list ')' '=' expr",
|
||||
"expr_without_variable : variable '=' expr",
|
||||
"expr_without_variable : variable '=' '&' variable",
|
||||
"expr_without_variable : variable '=' '&' T_NEW class_name_reference ctor_arguments",
|
||||
"expr_without_variable : T_NEW class_name_reference ctor_arguments",
|
||||
"expr_without_variable : T_CLONE expr",
|
||||
"expr_without_variable : variable T_PLUS_EQUAL expr",
|
||||
"expr_without_variable : variable T_MINUS_EQUAL expr",
|
||||
"expr_without_variable : variable T_MUL_EQUAL expr",
|
||||
"expr_without_variable : variable T_DIV_EQUAL expr",
|
||||
"expr_without_variable : variable T_CONCAT_EQUAL expr",
|
||||
"expr_without_variable : variable T_MOD_EQUAL expr",
|
||||
"expr_without_variable : variable T_AND_EQUAL expr",
|
||||
"expr_without_variable : variable T_OR_EQUAL expr",
|
||||
"expr_without_variable : variable T_XOR_EQUAL expr",
|
||||
"expr_without_variable : variable T_SL_EQUAL expr",
|
||||
"expr_without_variable : variable T_SR_EQUAL expr",
|
||||
"expr_without_variable : variable T_INC",
|
||||
"expr_without_variable : T_INC variable",
|
||||
"expr_without_variable : variable T_DEC",
|
||||
"expr_without_variable : T_DEC variable",
|
||||
"expr_without_variable : expr T_BOOLEAN_OR expr",
|
||||
"expr_without_variable : expr T_BOOLEAN_AND expr",
|
||||
"expr_without_variable : expr T_LOGICAL_OR expr",
|
||||
"expr_without_variable : expr T_LOGICAL_AND expr",
|
||||
"expr_without_variable : expr T_LOGICAL_XOR expr",
|
||||
"expr_without_variable : expr '|' expr",
|
||||
"expr_without_variable : expr '&' expr",
|
||||
"expr_without_variable : expr '^' expr",
|
||||
"expr_without_variable : expr '.' expr",
|
||||
"expr_without_variable : expr '+' expr",
|
||||
"expr_without_variable : expr '-' expr",
|
||||
"expr_without_variable : expr '*' expr",
|
||||
"expr_without_variable : expr '/' expr",
|
||||
"expr_without_variable : expr '%' expr",
|
||||
"expr_without_variable : expr T_SL expr",
|
||||
"expr_without_variable : expr T_SR expr",
|
||||
"expr_without_variable : '+' expr",
|
||||
"expr_without_variable : '-' expr",
|
||||
"expr_without_variable : '!' expr",
|
||||
"expr_without_variable : '~' expr",
|
||||
"expr_without_variable : expr T_IS_IDENTICAL expr",
|
||||
"expr_without_variable : expr T_IS_NOT_IDENTICAL expr",
|
||||
"expr_without_variable : expr T_IS_EQUAL expr",
|
||||
"expr_without_variable : expr T_IS_NOT_EQUAL expr",
|
||||
"expr_without_variable : expr '<' expr",
|
||||
"expr_without_variable : expr T_IS_SMALLER_OR_EQUAL expr",
|
||||
"expr_without_variable : expr '>' expr",
|
||||
"expr_without_variable : expr T_IS_GREATER_OR_EQUAL expr",
|
||||
"expr_without_variable : expr T_INSTANCEOF class_name_reference",
|
||||
"expr_without_variable : '(' expr ')'",
|
||||
"expr_without_variable : expr '?' expr ':' expr",
|
||||
"expr_without_variable : expr '?' ':' expr",
|
||||
"expr_without_variable : T_ISSET '(' variables_list ')'",
|
||||
"expr_without_variable : T_EMPTY '(' variable ')'",
|
||||
"expr_without_variable : T_INCLUDE expr",
|
||||
"expr_without_variable : T_INCLUDE_ONCE expr",
|
||||
"expr_without_variable : T_EVAL '(' expr ')'",
|
||||
"expr_without_variable : T_REQUIRE expr",
|
||||
"expr_without_variable : T_REQUIRE_ONCE expr",
|
||||
"expr_without_variable : T_INT_CAST expr",
|
||||
"expr_without_variable : T_DOUBLE_CAST expr",
|
||||
"expr_without_variable : T_STRING_CAST expr",
|
||||
"expr_without_variable : T_ARRAY_CAST expr",
|
||||
"expr_without_variable : T_OBJECT_CAST expr",
|
||||
"expr_without_variable : T_BOOL_CAST expr",
|
||||
"expr_without_variable : T_UNSET_CAST expr",
|
||||
"expr_without_variable : T_EXIT exit_expr",
|
||||
"expr_without_variable : '@' expr",
|
||||
"expr_without_variable : scalar",
|
||||
"expr_without_variable : T_ARRAY '(' array_pair_list ')'",
|
||||
"expr_without_variable : '`' backticks_expr '`'",
|
||||
"expr_without_variable : T_PRINT expr",
|
||||
"expr_without_variable : T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars '{' inner_statement_list '}'",
|
||||
"lexical_vars : /* empty */",
|
||||
"lexical_vars : T_USE '(' lexical_var_list ')'",
|
||||
"lexical_var_list : lexical_var_list ',' optional_ref T_VARIABLE",
|
||||
"lexical_var_list : optional_ref T_VARIABLE",
|
||||
"function_call : name '(' function_call_argument_list ')'",
|
||||
"function_call : class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' function_call_argument_list ')'",
|
||||
"function_call : class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects '(' function_call_argument_list ')'",
|
||||
"function_call : reference_variable T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' function_call_argument_list ')'",
|
||||
"function_call : reference_variable T_PAAMAYIM_NEKUDOTAYIM variable_without_objects '(' function_call_argument_list ')'",
|
||||
"function_call : variable_without_objects '(' function_call_argument_list ')'",
|
||||
"class_name : T_STATIC",
|
||||
"class_name : name",
|
||||
"name : namespace_name",
|
||||
"name : T_NAMESPACE T_NS_SEPARATOR namespace_name",
|
||||
"name : T_NS_SEPARATOR namespace_name",
|
||||
"class_name_reference : class_name",
|
||||
"class_name_reference : dynamic_class_name_reference",
|
||||
"dynamic_class_name_reference : object_access_for_dcnr",
|
||||
"dynamic_class_name_reference : base_variable",
|
||||
"object_access_for_dcnr : /* empty */",
|
||||
"object_access_for_dcnr : base_variable T_OBJECT_OPERATOR object_property",
|
||||
"object_access_for_dcnr : object_access_for_dcnr T_OBJECT_OPERATOR object_property",
|
||||
"object_access_for_dcnr : object_access_for_dcnr '[' dim_offset ']'",
|
||||
"object_access_for_dcnr : object_access_for_dcnr '{' expr '}'",
|
||||
"exit_expr : /* empty */",
|
||||
"exit_expr : '(' ')'",
|
||||
"exit_expr : '(' expr ')'",
|
||||
"backticks_expr : /* empty */",
|
||||
"backticks_expr : T_ENCAPSED_AND_WHITESPACE",
|
||||
"backticks_expr : encaps_list",
|
||||
"ctor_arguments : /* empty */",
|
||||
"ctor_arguments : '(' function_call_argument_list ')'",
|
||||
"common_scalar : T_LNUMBER",
|
||||
"common_scalar : T_DNUMBER",
|
||||
"common_scalar : T_CONSTANT_ENCAPSED_STRING",
|
||||
"common_scalar : T_LINE",
|
||||
"common_scalar : T_FILE",
|
||||
"common_scalar : T_DIR",
|
||||
"common_scalar : T_CLASS_C",
|
||||
"common_scalar : T_METHOD_C",
|
||||
"common_scalar : T_FUNC_C",
|
||||
"common_scalar : T_NS_C",
|
||||
"common_scalar : T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC",
|
||||
"common_scalar : T_START_HEREDOC T_END_HEREDOC",
|
||||
"static_scalar : common_scalar",
|
||||
"static_scalar : name",
|
||||
"static_scalar : '+' static_scalar",
|
||||
"static_scalar : '-' static_scalar",
|
||||
"static_scalar : T_ARRAY '(' static_array_pair_list ')'",
|
||||
"static_scalar : class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING",
|
||||
"scalar : T_STRING_VARNAME",
|
||||
"scalar : class_constant",
|
||||
"scalar : name",
|
||||
"scalar : common_scalar",
|
||||
"scalar : '\"' encaps_list '\"'",
|
||||
"scalar : T_START_HEREDOC encaps_list T_END_HEREDOC",
|
||||
"static_array_pair_list : /* empty */",
|
||||
"static_array_pair_list : non_empty_static_array_pair_list optional_comma",
|
||||
"optional_comma : /* empty */",
|
||||
"optional_comma : ','",
|
||||
"non_empty_static_array_pair_list : non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar",
|
||||
"non_empty_static_array_pair_list : non_empty_static_array_pair_list ',' static_scalar",
|
||||
"non_empty_static_array_pair_list : static_scalar T_DOUBLE_ARROW static_scalar",
|
||||
"non_empty_static_array_pair_list : static_scalar",
|
||||
"expr : variable",
|
||||
"expr : expr_without_variable",
|
||||
"variable : object_access",
|
||||
"variable : base_variable",
|
||||
"variable : function_call",
|
||||
"object_access : object_access_arrayable",
|
||||
"object_access : object_access_arrayable '(' function_call_argument_list ')'",
|
||||
"object_access : variable T_OBJECT_OPERATOR object_property '(' function_call_argument_list ')'",
|
||||
"object_access_arrayable : variable T_OBJECT_OPERATOR object_property",
|
||||
"object_access_arrayable : object_access_arrayable '[' dim_offset ']'",
|
||||
"object_access_arrayable : object_access_arrayable '{' expr '}'",
|
||||
"variable_without_objects : reference_variable",
|
||||
"variable_without_objects : '$' reference_variable",
|
||||
"base_variable : variable_without_objects",
|
||||
"base_variable : class_name T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable",
|
||||
"base_variable : reference_variable T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable",
|
||||
"base_variable : static_property_with_arrays",
|
||||
"static_property_with_arrays : class_name T_PAAMAYIM_NEKUDOTAYIM T_VARIABLE",
|
||||
"static_property_with_arrays : reference_variable T_PAAMAYIM_NEKUDOTAYIM '$' '{' expr '}'",
|
||||
"static_property_with_arrays : static_property_with_arrays '[' dim_offset ']'",
|
||||
"static_property_with_arrays : static_property_with_arrays '{' expr '}'",
|
||||
"reference_variable : reference_variable '[' dim_offset ']'",
|
||||
"reference_variable : reference_variable '{' expr '}'",
|
||||
"reference_variable : T_VARIABLE",
|
||||
"reference_variable : '$' '{' expr '}'",
|
||||
"dim_offset : /* empty */",
|
||||
"dim_offset : expr",
|
||||
"object_property : T_STRING",
|
||||
"object_property : '{' expr '}'",
|
||||
"object_property : variable_without_objects",
|
||||
"assignment_list : assignment_list ',' assignment_list_element",
|
||||
"assignment_list : assignment_list_element",
|
||||
"assignment_list_element : variable",
|
||||
"assignment_list_element : T_LIST '(' assignment_list ')'",
|
||||
"assignment_list_element : /* empty */",
|
||||
"array_pair_list : /* empty */",
|
||||
"array_pair_list : non_empty_array_pair_list optional_comma",
|
||||
"non_empty_array_pair_list : non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr",
|
||||
"non_empty_array_pair_list : non_empty_array_pair_list ',' expr",
|
||||
"non_empty_array_pair_list : expr T_DOUBLE_ARROW expr",
|
||||
"non_empty_array_pair_list : expr",
|
||||
"non_empty_array_pair_list : non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' variable",
|
||||
"non_empty_array_pair_list : non_empty_array_pair_list ',' '&' variable",
|
||||
"non_empty_array_pair_list : expr T_DOUBLE_ARROW '&' variable",
|
||||
"non_empty_array_pair_list : '&' variable",
|
||||
"encaps_list : encaps_list encaps_var",
|
||||
"encaps_list : encaps_list T_ENCAPSED_AND_WHITESPACE",
|
||||
"encaps_list : encaps_var",
|
||||
"encaps_list : T_ENCAPSED_AND_WHITESPACE encaps_var",
|
||||
"encaps_var : T_VARIABLE",
|
||||
"encaps_var : T_VARIABLE '[' encaps_var_offset ']'",
|
||||
"encaps_var : T_VARIABLE T_OBJECT_OPERATOR T_STRING",
|
||||
"encaps_var : T_DOLLAR_OPEN_CURLY_BRACES expr '}'",
|
||||
"encaps_var : T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}'",
|
||||
"encaps_var : T_CURLY_OPEN variable '}'",
|
||||
"encaps_var_offset : T_STRING",
|
||||
"encaps_var_offset : T_NUM_STRING",
|
||||
"encaps_var_offset : T_VARIABLE",
|
||||
"class_constant : class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING",
|
||||
"class_constant : reference_variable T_PAAMAYIM_NEKUDOTAYIM T_STRING"
|
||||
);
|
||||
|
||||
private static $yytranslate = array(
|
||||
0, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
||||
@ -1286,43 +921,6 @@ class Parser
|
||||
);
|
||||
}
|
||||
|
||||
/* Traditional Debug Mode */
|
||||
private function YYTRACE_NEWSTATE($state, $sym) {
|
||||
if ($this->yydebug) {
|
||||
$this->yyprintln('% State ' . $state . ', Lookahead '
|
||||
. ($sym < 0 ? '--none--' : self::$yyterminals[$sym]));
|
||||
}
|
||||
}
|
||||
|
||||
private function YYTRACE_READ($sym) {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Reading ' . self::$yyterminals[$sym]);
|
||||
}
|
||||
|
||||
private function YYTRACE_SHIFT($sym) {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Shift ' . self::$yyterminals[$sym]);
|
||||
}
|
||||
|
||||
private function YYTRACE_ACCEPT() {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Accepted.');
|
||||
}
|
||||
|
||||
private function YYTRACE_REDUCE($n) {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Reduce by (' . $n . ') ' . self::$yyproduction[$n]);
|
||||
}
|
||||
|
||||
private function YYTRACE_POP($state) {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Recovering, uncovers state ' . $state);
|
||||
}
|
||||
|
||||
private function YYTRACE_DISCARD($sym) {
|
||||
if ($this->yydebug)
|
||||
$this->yyprintln('% Discard ' . self::$yyterminals[$sym]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parser entry point
|
||||
@ -1343,7 +941,6 @@ class Parser
|
||||
$yyerrflag = 0;
|
||||
|
||||
for (;;) {
|
||||
$this->YYTRACE_NEWSTATE($yystate, $yychar);
|
||||
if (self::$yybase[$yystate] == 0) {
|
||||
$yyn = self::$yydefault[$yystate];
|
||||
} else {
|
||||
@ -1352,7 +949,6 @@ class Parser
|
||||
$yychar = 0;
|
||||
$yychar = $yychar < self::YYMAXLEX ?
|
||||
self::$yytranslate[$yychar] : self::YYBADCH;
|
||||
$this->YYTRACE_READ($yychar);
|
||||
}
|
||||
if ((($yyn = self::$yybase[$yystate] + $yychar) >= 0
|
||||
&& $yyn < self::YYLAST && self::$yycheck[$yyn] == $yychar
|
||||
@ -1371,7 +967,6 @@ class Parser
|
||||
*/
|
||||
if ($yyn > 0) {
|
||||
/* shift */
|
||||
$this->YYTRACE_SHIFT($yychar);
|
||||
++$this->yysp;
|
||||
|
||||
$yysstk[$this->yysp] = $yystate = $yyn;
|
||||
@ -1397,11 +992,9 @@ class Parser
|
||||
/* reduce/error */
|
||||
if ($yyn == 0) {
|
||||
/* accept */
|
||||
$this->YYTRACE_ACCEPT();
|
||||
return $this->yyval;
|
||||
} elseif ($yyn != self::YYUNEXPECTED) {
|
||||
/* reduce */
|
||||
$this->YYTRACE_REDUCE($yyn);
|
||||
$this->{'yyn' . $yyn}();
|
||||
|
||||
/* Goto - shift nonterminal */
|
||||
@ -1439,15 +1032,12 @@ class Parser
|
||||
return false;
|
||||
}
|
||||
$yystate = $yysstk[--$this->yysp];
|
||||
$this->YYTRACE_POP($yystate);
|
||||
}
|
||||
$yyn = self::$yyaction[$yyn];
|
||||
$this->YYTRACE_SHIFT(self::YYINTERRTOK);
|
||||
$yysstk[++$this->yysp] = $yystate = $yyn;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$this->YYTRACE_DISCARD($yychar);
|
||||
if ($yychar == 0) {
|
||||
return false;
|
||||
}
|
||||
|
2895
lib/ParserDebug.php
Normal file
2895
lib/ParserDebug.php
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user