PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - Zend - zend_language_parser.y (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 642 655 98.0 %
Date: 2014-10-30 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : %{
       2             : /*
       3             :    +----------------------------------------------------------------------+
       4             :    | Zend Engine                                                          |
       5             :    +----------------------------------------------------------------------+
       6             :    | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
       7             :    +----------------------------------------------------------------------+
       8             :    | This source file is subject to version 2.00 of the Zend license,     |
       9             :    | that is bundled with this package in the file LICENSE, and is        |
      10             :    | available through the world-wide-web at the following url:           |
      11             :    | http://www.zend.com/license/2_00.txt.                                |
      12             :    | If you did not receive a copy of the Zend license and are unable to  |
      13             :    | obtain it through the world-wide-web, please send a note to          |
      14             :    | license@zend.com so we can mail you a copy immediately.              |
      15             :    +----------------------------------------------------------------------+
      16             :    | Authors: Andi Gutmans <andi@zend.com>                                |
      17             :    |          Zeev Suraski <zeev@zend.com>                                |
      18             :    |          Nikita Popov <nikic@php.net>                                |
      19             :    +----------------------------------------------------------------------+
      20             : */
      21             : 
      22             : /* $Id$ */
      23             : 
      24             : /*
      25             :  * LALR shift/reduce conflicts and how they are resolved:
      26             :  *
      27             :  * - 2 shift/reduce conflicts due to the dangling elseif/else ambiguity. Solved by shift.
      28             :  *
      29             :  */
      30             : 
      31             : 
      32             : #include "zend_compile.h"
      33             : #include "zend.h"
      34             : #include "zend_list.h"
      35             : #include "zend_globals.h"
      36             : #include "zend_API.h"
      37             : #include "zend_constants.h"
      38             : 
      39             : #define YYSIZE_T size_t
      40             : #define yytnamerr zend_yytnamerr
      41             : static YYSIZE_T zend_yytnamerr(char*, const char*);
      42             : 
      43             : #define YYERROR_VERBOSE
      44             : #define YYSTYPE zend_parser_stack_elem
      45             : 
      46             : %}
      47             : 
      48             : %pure_parser
      49             : %expect 2
      50             : 
      51             : %code requires {
      52             : #ifdef ZTS
      53             : # define YYPARSE_PARAM tsrm_ls
      54             : # define YYLEX_PARAM tsrm_ls
      55             : #endif
      56             : }
      57             : 
      58         110 : %destructor { zend_ast_destroy($$); } <ast>
      59           8 : %destructor { if ($$) zend_string_release($$); } <str>
      60             : 
      61             : %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
      62             : %left ','
      63             : %left T_LOGICAL_OR
      64             : %left T_LOGICAL_XOR
      65             : %left T_LOGICAL_AND
      66             : %right T_PRINT
      67             : %right T_YIELD
      68             : %left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL
      69             : %left '?' ':'
      70             : %right T_COALESCE
      71             : %left T_BOOLEAN_OR
      72             : %left T_BOOLEAN_AND 
      73             : %left '|'
      74             : %left '^'
      75             : %left '&'
      76             : %nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL
      77             : %nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
      78             : %left T_SL T_SR
      79             : %left '+' '-' '.'
      80             : %left '*' '/' '%'
      81             : %right '!'
      82             : %nonassoc T_INSTANCEOF
      83             : %right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
      84             : %right T_POW
      85             : %right '['
      86             : %nonassoc T_NEW T_CLONE
      87             : %left T_ELSEIF
      88             : %left T_ELSE 
      89             : %left T_ENDIF 
      90             : %right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC
      91             : %right T_DOUBLE_ARROW
      92             : 
      93             : %token <ast> T_LNUMBER   "integer number (T_LNUMBER)"
      94             : %token <ast> T_DNUMBER   "floating-point number (T_DNUMBER)"
      95             : %token <ast> T_STRING    "identifier (T_STRING)"
      96             : %token <ast> T_VARIABLE  "variable (T_VARIABLE)"
      97             : %token <ast> T_INLINE_HTML
      98             : %token <ast> T_ENCAPSED_AND_WHITESPACE  "quoted-string and whitespace (T_ENCAPSED_AND_WHITESPACE)"
      99             : %token <ast> T_CONSTANT_ENCAPSED_STRING "quoted-string (T_CONSTANT_ENCAPSED_STRING)"
     100             : %token <ast> T_STRING_VARNAME "variable name (T_STRING_VARNAME)"
     101             : %token <ast> T_NUM_STRING "number (T_NUM_STRING)"
     102             : 
     103             : %token END 0 "end of file"
     104             : %token T_INCLUDE      "include (T_INCLUDE)"
     105             : %token T_INCLUDE_ONCE "include_once (T_INCLUDE_ONCE)"
     106             : %token T_EVAL         "eval (T_EVAL)"
     107             : %token T_REQUIRE      "require (T_REQUIRE)"
     108             : %token T_REQUIRE_ONCE "require_once (T_REQUIRE_ONCE)"
     109             : %token T_LOGICAL_OR   "or (T_LOGICAL_OR)"
     110             : %token T_LOGICAL_XOR  "xor (T_LOGICAL_XOR)"
     111             : %token T_LOGICAL_AND  "and (T_LOGICAL_AND)"
     112             : %token T_PRINT        "print (T_PRINT)"
     113             : %token T_YIELD        "yield (T_YIELD)"
     114             : %token T_PLUS_EQUAL   "+= (T_PLUS_EQUAL)"
     115             : %token T_MINUS_EQUAL  "-= (T_MINUS_EQUAL)"
     116             : %token T_MUL_EQUAL    "*= (T_MUL_EQUAL)"
     117             : %token T_DIV_EQUAL    "/= (T_DIV_EQUAL)"
     118             : %token T_CONCAT_EQUAL ".= (T_CONCAT_EQUAL)"
     119             : %token T_MOD_EQUAL    "%= (T_MOD_EQUAL)"
     120             : %token T_AND_EQUAL    "&= (T_AND_EQUAL)"
     121             : %token T_OR_EQUAL     "|= (T_OR_EQUAL)"
     122             : %token T_XOR_EQUAL    "^= (T_XOR_EQUAL)"
     123             : %token T_SL_EQUAL     "<<= (T_SL_EQUAL)"
     124             : %token T_SR_EQUAL     ">>= (T_SR_EQUAL)"
     125             : %token T_BOOLEAN_OR   "|| (T_BOOLEAN_OR)"
     126             : %token T_BOOLEAN_AND  "&& (T_BOOLEAN_AND)"
     127             : %token T_IS_EQUAL     "== (T_IS_EQUAL)"
     128             : %token T_IS_NOT_EQUAL "!= (T_IS_NOT_EQUAL)"
     129             : %token T_IS_IDENTICAL "=== (T_IS_IDENTICAL)"
     130             : %token T_IS_NOT_IDENTICAL "!== (T_IS_NOT_IDENTICAL)"
     131             : %token T_IS_SMALLER_OR_EQUAL "<= (T_IS_SMALLER_OR_EQUAL)"
     132             : %token T_IS_GREATER_OR_EQUAL ">= (T_IS_GREATER_OR_EQUAL)"
     133             : %token T_SL "<< (T_SL)"
     134             : %token T_SR ">> (T_SR)"
     135             : %token T_INSTANCEOF  "instanceof (T_INSTANCEOF)"
     136             : %token T_INC "++ (T_INC)"
     137             : %token T_DEC "-- (T_DEC)"
     138             : %token T_INT_CAST    "(int) (T_INT_CAST)"
     139             : %token T_DOUBLE_CAST "(double) (T_DOUBLE_CAST)"
     140             : %token T_STRING_CAST "(string) (T_STRING_CAST)"
     141             : %token T_ARRAY_CAST  "(array) (T_ARRAY_CAST)"
     142             : %token T_OBJECT_CAST "(object) (T_OBJECT_CAST)"
     143             : %token T_BOOL_CAST   "(bool) (T_BOOL_CAST)"
     144             : %token T_UNSET_CAST  "(unset) (T_UNSET_CAST)"
     145             : %token T_NEW       "new (T_NEW)"
     146             : %token T_CLONE     "clone (T_CLONE)"
     147             : %token T_EXIT      "exit (T_EXIT)"
     148             : %token T_IF        "if (T_IF)"
     149             : %token T_ELSEIF    "elseif (T_ELSEIF)"
     150             : %token T_ELSE      "else (T_ELSE)"
     151             : %token T_ENDIF     "endif (T_ENDIF)"
     152             : %token T_CHARACTER
     153             : %token T_BAD_CHARACTER
     154             : %token T_ECHO       "echo (T_ECHO)"
     155             : %token T_DO         "do (T_DO)"
     156             : %token T_WHILE      "while (T_WHILE)"
     157             : %token T_ENDWHILE   "endwhile (T_ENDWHILE)"
     158             : %token T_FOR        "for (T_FOR)"
     159             : %token T_ENDFOR     "endfor (T_ENDFOR)"
     160             : %token T_FOREACH    "foreach (T_FOREACH)"
     161             : %token T_ENDFOREACH "endforeach (T_ENDFOREACH)"
     162             : %token T_DECLARE    "declare (T_DECLARE)"
     163             : %token T_ENDDECLARE "enddeclare (T_ENDDECLARE)"
     164             : %token T_AS         "as (T_AS)"
     165             : %token T_SWITCH     "switch (T_SWITCH)"
     166             : %token T_ENDSWITCH  "endswitch (T_ENDSWITCH)"
     167             : %token T_CASE       "case (T_CASE)"
     168             : %token T_DEFAULT    "default (T_DEFAULT)"
     169             : %token T_BREAK      "break (T_BREAK)"
     170             : %token T_CONTINUE   "continue (T_CONTINUE)"
     171             : %token T_GOTO       "goto (T_GOTO)"
     172             : %token T_FUNCTION   "function (T_FUNCTION)"
     173             : %token T_CONST      "const (T_CONST)"
     174             : %token T_RETURN     "return (T_RETURN)"
     175             : %token T_TRY        "try (T_TRY)"
     176             : %token T_CATCH      "catch (T_CATCH)"
     177             : %token T_FINALLY    "finally (T_FINALLY)"
     178             : %token T_THROW      "throw (T_THROW)"
     179             : %token T_USE        "use (T_USE)"
     180             : %token T_INSTEADOF  "insteadof (T_INSTEADOF)"
     181             : %token T_GLOBAL     "global (T_GLOBAL)"
     182             : %token T_STATIC     "static (T_STATIC)"
     183             : %token T_ABSTRACT   "abstract (T_ABSTRACT)"
     184             : %token T_FINAL      "final (T_FINAL)"
     185             : %token T_PRIVATE    "private (T_PRIVATE)"
     186             : %token T_PROTECTED  "protected (T_PROTECTED)"
     187             : %token T_PUBLIC     "public (T_PUBLIC)"
     188             : %token T_VAR        "var (T_VAR)"
     189             : %token T_UNSET      "unset (T_UNSET)"
     190             : %token T_ISSET      "isset (T_ISSET)"
     191             : %token T_EMPTY      "empty (T_EMPTY)"
     192             : %token T_HALT_COMPILER "__halt_compiler (T_HALT_COMPILER)"
     193             : %token T_CLASS      "class (T_CLASS)"
     194             : %token T_TRAIT      "trait (T_TRAIT)"
     195             : %token T_INTERFACE  "interface (T_INTERFACE)"
     196             : %token T_EXTENDS    "extends (T_EXTENDS)"
     197             : %token T_IMPLEMENTS "implements (T_IMPLEMENTS)"
     198             : %token T_OBJECT_OPERATOR "-> (T_OBJECT_OPERATOR)"
     199             : %token T_DOUBLE_ARROW    "=> (T_DOUBLE_ARROW)"
     200             : %token T_LIST            "list (T_LIST)"
     201             : %token T_ARRAY           "array (T_ARRAY)"
     202             : %token T_CALLABLE        "callable (T_CALLABLE)"
     203             : %token T_LINE            "__LINE__ (T_LINE)"
     204             : %token T_FILE            "__FILE__ (T_FILE)"
     205             : %token T_DIR             "__DIR__ (T_DIR)"
     206             : %token T_CLASS_C         "__CLASS__ (T_CLASS_C)"
     207             : %token T_TRAIT_C         "__TRAIT__ (T_TRAIT_C)"
     208             : %token T_METHOD_C        "__METHOD__ (T_METHOD_C)"
     209             : %token T_FUNC_C          "__FUNCTION__ (T_FUNC_C)"
     210             : %token T_COMMENT         "comment (T_COMMENT)"
     211             : %token T_DOC_COMMENT     "doc comment (T_DOC_COMMENT)"
     212             : %token T_OPEN_TAG        "open tag (T_OPEN_TAG)"
     213             : %token T_OPEN_TAG_WITH_ECHO "open tag with echo (T_OPEN_TAG_WITH_ECHO)"
     214             : %token T_CLOSE_TAG       "close tag (T_CLOSE_TAG)"
     215             : %token T_WHITESPACE      "whitespace (T_WHITESPACE)"
     216             : %token T_START_HEREDOC   "heredoc start (T_START_HEREDOC)"
     217             : %token T_END_HEREDOC     "heredoc end (T_END_HEREDOC)"
     218             : %token T_DOLLAR_OPEN_CURLY_BRACES "${ (T_DOLLAR_OPEN_CURLY_BRACES)"
     219             : %token T_CURLY_OPEN      "{$ (T_CURLY_OPEN)"
     220             : %token T_PAAMAYIM_NEKUDOTAYIM ":: (T_PAAMAYIM_NEKUDOTAYIM)"
     221             : %token T_NAMESPACE       "namespace (T_NAMESPACE)"
     222             : %token T_NS_C            "__NAMESPACE__ (T_NS_C)"
     223             : %token T_NS_SEPARATOR    "\\ (T_NS_SEPARATOR)"
     224             : %token T_ELLIPSIS        "... (T_ELLIPSIS)"
     225             : %token T_COALESCE        "?? (T_COALESCE)"
     226             : %token T_POW             "** (T_POW)"
     227             : %token T_POW_EQUAL       "**= (T_POW_EQUAL)"
     228             : 
     229             : %type <ast> top_statement namespace_name name statement function_declaration_statement
     230             : %type <ast> class_declaration_statement use_declaration const_decl inner_statement
     231             : %type <ast> expr optional_expr while_statement for_statement foreach_variable
     232             : %type <ast> foreach_statement declare_statement finally_statement unset_variable variable
     233             : %type <ast> extends_from parameter optional_type argument expr_without_variable global_var
     234             : %type <ast> static_var class_statement trait_adaptation trait_precedence trait_alias
     235             : %type <ast> absolute_trait_method_reference trait_method_reference property echo_expr
     236             : %type <ast> new_expr class_name class_name_reference simple_variable internal_functions_in_yacc
     237             : %type <ast> exit_expr scalar backticks_expr lexical_var function_call member_name
     238             : %type <ast> variable_class_name dereferencable_scalar class_name_scalar constant dereferencable
     239             : %type <ast> callable_expr callable_variable static_member new_variable
     240             : %type <ast> assignment_list_element array_pair encaps_var encaps_var_offset isset_variables
     241             : %type <ast> isset_variable
     242             : %type <ast> top_statement_list use_declarations const_list inner_statement_list if_stmt
     243             : %type <ast> alt_if_stmt for_exprs switch_case_list global_var_list static_var_list
     244             : %type <ast> echo_expr_list unset_variables catch_list parameter_list class_statement_list
     245             : %type <ast> implements_list interface_extends_list case_list if_stmt_without_else
     246             : %type <ast> non_empty_parameter_list argument_list non_empty_argument_list property_list
     247             : %type <ast> class_const_list name_list trait_adaptations method_body non_empty_for_exprs
     248             : %type <ast> ctor_arguments alt_if_stmt_without_else trait_adaptation_list lexical_vars
     249             : %type <ast> lexical_var_list encaps_list array_pair_list non_empty_array_pair_list
     250             : %type <ast> assignment_list
     251             : 
     252             : %type <num> returns_ref function is_reference is_variadic class_type variable_modifiers
     253             : %type <num> method_modifiers trait_modifiers non_empty_member_modifiers member_modifier
     254             : 
     255             : %type <str> backup_doc_comment
     256             : 
     257             : %% /* Rules */
     258             : 
     259             : start:
     260       29451 :         top_statement_list      { CG(ast) = $1; }
     261       29451 : ;
     262             : 
     263             : top_statement_list:
     264      214279 :                 top_statement_list top_statement { $$ = zend_ast_list_add($1, $2); }
     265      214279 :         |       /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     266       29581 : ;
     267             : 
     268             : namespace_name:
     269      369326 :                 T_STRING                                                                { $$ = $1; }
     270      369326 :         |       namespace_name T_NS_SEPARATOR T_STRING  { $$ = zend_ast_append_str($1, $3); }
     271         350 : ;
     272             : 
     273             : name:
     274      368814 :                 namespace_name                                                          { $$ = $1; $$->attr = ZEND_NAME_NOT_FQ; }
     275      368814 :         |       T_NAMESPACE T_NS_SEPARATOR namespace_name       { $$ = $3; $$->attr = ZEND_NAME_RELATIVE; }
     276          49 :         |       T_NS_SEPARATOR namespace_name                           { $$ = $2; $$->attr = ZEND_NAME_FQ; }
     277         194 : ;
     278             : 
     279             : top_statement:
     280      193883 :                 statement                                               { $$ = $1; }
     281      193883 :         |       function_declaration_statement  { $$ = $1; }
     282       13329 :         |       class_declaration_statement             { $$ = $1; }
     283        6339 :         |       T_HALT_COMPILER '(' ')' ';'
     284         550 :                         { $$ = zend_ast_create(ZEND_AST_HALT_COMPILER,
     285         275 :                               zend_ast_create_zval_from_long(zend_get_scanned_file_offset(TSRMLS_C)));
     286         275 :                           zend_stop_lexing(TSRMLS_C); }
     287         275 :         |       T_NAMESPACE namespace_name ';'
     288         132 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, NULL);
     289         132 :                           RESET_DOC_COMMENT(); }
     290         133 :         |       T_NAMESPACE namespace_name { RESET_DOC_COMMENT(); }
     291          44 :                 '{' top_statement_list '}'
     292          42 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, $5); }
     293          42 :         |       T_NAMESPACE { RESET_DOC_COMMENT(); }
     294          33 :                 '{' top_statement_list '}'
     295          33 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, NULL, $4); }
     296          33 :         |       T_USE use_declarations ';'                              { $$ = $2; $$->attr = T_CLASS; }
     297          54 :         |       T_USE T_FUNCTION use_declarations ';'   { $$ = $3; $$->attr = T_FUNCTION; }
     298          17 :         |       T_USE T_CONST use_declarations ';'              { $$ = $3; $$->attr = T_CONST; }
     299          14 :         |       T_CONST const_list ';'                                  { $$ = $2; }
     300         161 : ;
     301             : 
     302             : use_declarations:
     303             :                 use_declarations ',' use_declaration
     304           8 :                         { $$ = zend_ast_list_add($1, $3); }
     305           8 :         |       use_declaration
     306          85 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     307          85 : ;
     308             : 
     309             : use_declaration:
     310             :                 namespace_name
     311          35 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, NULL); }
     312          35 :         |       namespace_name T_AS T_STRING
     313          44 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, $3); }
     314          44 :         |       T_NS_SEPARATOR namespace_name
     315          10 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $2, NULL); }
     316          10 :         |       T_NS_SEPARATOR namespace_name T_AS T_STRING
     317           4 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $2, $4); }
     318           4 : ;
     319             : 
     320             : const_list:
     321           1 :                 const_list ',' const_decl { $$ = zend_ast_list_add($1, $3); }
     322           1 :         |       const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CONST_DECL, $1); }
     323         186 : ;
     324             : 
     325             : inner_statement_list:
     326             :                 inner_statement_list inner_statement
     327      229454 :                         { $$ = zend_ast_list_add($1, $2); }
     328      229454 :         |       /* empty */
     329      109817 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     330      109817 : ;
     331             : 
     332             : 
     333             : inner_statement:
     334      224129 :                 statement { $$ = $1; }
     335      224129 :         |       function_declaration_statement { $$ = $1; }
     336        4393 :         |       class_declaration_statement { $$ = $1; }
     337         932 :         |       T_HALT_COMPILER '(' ')' ';'
     338           1 :                         { $$ = NULL; zend_error_noreturn(E_COMPILE_ERROR,
     339             :                               "__HALT_COMPILER() can only be used from the outermost scope"); }
     340             : ;
     341             : 
     342             : 
     343             : statement:
     344       68881 :                 '{' inner_statement_list '}' { $$ = $2; }
     345       68881 :         |       if_stmt { $$ = $1; }
     346       68271 :         |       alt_if_stmt { $$ = $1; }
     347           4 :         |       T_WHILE '(' expr ')' while_statement
     348        1870 :                         { $$ = zend_ast_create(ZEND_AST_WHILE, $3, $5); }
     349        1870 :         |       T_DO statement T_WHILE '(' expr ')' ';'
     350         289 :                         { $$ = zend_ast_create(ZEND_AST_DO_WHILE, $2, $5); }
     351         289 :         |       T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement
     352        1869 :                         { $$ = zend_ast_create(ZEND_AST_FOR, $3, $5, $7, $9); }
     353        1869 :         |       T_SWITCH '(' expr ')' switch_case_list
     354         449 :                         { $$ = zend_ast_create(ZEND_AST_SWITCH, $3, $5); }
     355         449 :         |       T_BREAK optional_expr ';'               { $$ = zend_ast_create(ZEND_AST_BREAK, $2); }
     356        1826 :         |       T_CONTINUE optional_expr ';'    { $$ = zend_ast_create(ZEND_AST_CONTINUE, $2); }
     357         268 :         |       T_RETURN optional_expr ';'              { $$ = zend_ast_create(ZEND_AST_RETURN, $2); }
     358       43572 :         |       T_GLOBAL global_var_list ';'    { $$ = $2; }
     359        4000 :         |       T_STATIC static_var_list ';'    { $$ = $2; }
     360        1875 :         |       T_ECHO echo_expr_list ';'               { $$ = $2; }
     361       29044 :         |       T_INLINE_HTML { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     362        3503 :         |       expr ';' { $$ = $1; }
     363      251947 :         |       T_UNSET '(' unset_variables ')' ';' { $$ = $3; }
     364        1471 :         |       T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement
     365        5103 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $5, NULL, $7); }
     366        5103 :         |       T_FOREACH '(' expr T_AS foreach_variable T_DOUBLE_ARROW foreach_variable ')'
     367             :                 foreach_statement
     368        4640 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $7, $5, $9); }
     369        4640 :         |       T_DECLARE '(' const_list ')'
     370          25 :                         { zend_handle_encoding_declaration($3 TSRMLS_CC); }
     371          23 :                 declare_statement
     372          23 :                         { $$ = zend_ast_create(ZEND_AST_DECLARE, $3, $6); }
     373          23 :         |       ';'     /* empty statement */ { $$ = NULL; }
     374       27431 :         |       T_TRY '{' inner_statement_list '}' catch_list finally_statement
     375        1990 :                         { $$ = zend_ast_create(ZEND_AST_TRY, $3, $5, $6); }
     376        1990 :         |       T_THROW expr ';' { $$ = zend_ast_create(ZEND_AST_THROW, $2); }
     377         323 :         |       T_GOTO T_STRING ';' { $$ = zend_ast_create(ZEND_AST_GOTO, $2); }
     378          36 :         |       T_STRING ':' { $$ = zend_ast_create(ZEND_AST_LABEL, $1); }
     379          37 : ;
     380             : 
     381             : catch_list:
     382             :                 /* empty */
     383        1990 :                         { $$ = zend_ast_create_list(0, ZEND_AST_CATCH_LIST); }
     384        1990 :         |       catch_list T_CATCH '(' name T_VARIABLE ')' '{' inner_statement_list '}'
     385        1956 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_CATCH, $4, $5, $8)); }
     386        1956 : ;
     387             : 
     388             : finally_statement:
     389        1920 :                 /* empty */ { $$ = NULL; }
     390        1920 :         |       T_FINALLY '{' inner_statement_list '}' { $$ = $3; }
     391          70 : ;
     392             : 
     393             : unset_variables:
     394        1471 :                 unset_variable { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     395        1471 :         |       unset_variables ',' unset_variable { $$ = zend_ast_list_add($1, $3); }
     396         110 : ;
     397             : 
     398             : unset_variable:
     399        1581 :                 variable { $$ = zend_ast_create(ZEND_AST_UNSET, $1); }
     400        1581 : ;
     401             : 
     402             : function_declaration_statement:
     403             :         function returns_ref T_STRING '(' parameter_list ')' backup_doc_comment
     404             :         '{' inner_statement_list '}'
     405       70888 :                 { $$ = zend_ast_create_decl(ZEND_AST_FUNC_DECL, $2, $1, $7,
     406       53166 :                       zend_ast_get_str($3), $5, NULL, $9); }
     407       17722 : ;
     408             : 
     409             : is_reference:
     410       81709 :                 /* empty */     { $$ = 0; }
     411       81709 :         |       '&'                 { $$ = ZEND_PARAM_REF; }
     412         959 : ;
     413             : 
     414             : is_variadic:
     415       82630 :                 /* empty */ { $$ = 0; }
     416       82630 :         |       T_ELLIPSIS  { $$ = ZEND_PARAM_VARIADIC; }
     417          38 : ;
     418             : 
     419             : class_declaration_statement:
     420        7104 :                 class_type { $<num>$ = CG(zend_lineno); }
     421        7104 :                 T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
     422       35425 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, $1, $<num>2, $6,
     423       28340 :                                   zend_ast_get_str($3), $4, $5, $8); }
     424        7085 :         |       T_INTERFACE { $<num>$ = CG(zend_lineno); }
     425         187 :                 T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}'
     426         744 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, ZEND_ACC_INTERFACE, $<num>2, $5,
     427         558 :                                   zend_ast_get_str($3), NULL, $4, $7); }
     428         186 : ;
     429             : 
     430             : class_type:
     431        6788 :                 T_CLASS                         { $$ = 0; }
     432        6788 :         |       T_ABSTRACT T_CLASS      { $$ = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
     433          92 :         |       T_FINAL T_CLASS         { $$ = ZEND_ACC_FINAL_CLASS; }
     434          15 :         |       T_TRAIT                         { $$ = ZEND_ACC_TRAIT; }
     435         209 : ;
     436             : 
     437             : extends_from:
     438        4778 :                 /* empty */             { $$ = NULL; }
     439        4778 :         |       T_EXTENDS name  { $$ = $2; }
     440        2324 : ;
     441             : 
     442             : interface_extends_list:
     443         151 :                 /* empty */                     { $$ = NULL; }
     444         151 :         |       T_EXTENDS name_list     { $$ = $2; }
     445          35 : ;
     446             : 
     447             : implements_list:
     448        6808 :                 /* empty */                             { $$ = NULL; }
     449        6808 :         |       T_IMPLEMENTS name_list  { $$ = $2; }
     450         293 : ;
     451             : 
     452             : foreach_variable:
     453       14295 :                 variable                        { $$ = $1; }
     454       14295 :         |       '&' variable                { $$ = zend_ast_create(ZEND_AST_REF, $2); }
     455          79 :         |       T_LIST '(' assignment_list ')' { $$ = $3; }
     456           9 : ;
     457             : 
     458             : for_statement:
     459        1866 :                 statement { $$ = $1; }
     460        1866 :         |       ':' inner_statement_list T_ENDFOR ';' { $$ = $2; }
     461           3 : ;
     462             : 
     463             : foreach_statement:
     464        9743 :                 statement { $$ = $1; }
     465        9743 :         |       ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; }
     466           0 : ;
     467             : 
     468             : declare_statement:
     469          23 :                 statement { $$ = $1; }
     470          23 :         |       ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; }
     471           0 : ;
     472             : 
     473             : switch_case_list:
     474         448 :                 '{' case_list '}'                                       { $$ = $2; }
     475         448 :         |       '{' ';' case_list '}'                           { $$ = $3; }
     476           0 :         |       ':' case_list T_ENDSWITCH ';'           { $$ = $2; }
     477           1 :         |       ':' ';' case_list T_ENDSWITCH ';'       { $$ = $3; }
     478           0 : ;
     479             : 
     480             : case_list:
     481         449 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_SWITCH_LIST); }
     482         449 :         |       case_list T_CASE expr case_separator inner_statement_list
     483        1587 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, $3, $5)); }
     484        1587 :         |       case_list T_DEFAULT case_separator inner_statement_list
     485         267 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, NULL, $4)); }
     486         267 : ;
     487             : 
     488             : case_separator:
     489             :                 ':'
     490             :         |       ';'
     491             : ;
     492             : 
     493             : 
     494             : while_statement:
     495        1869 :                 statement { $$ = $1; }
     496        1869 :         |       ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; }
     497           1 : ;
     498             : 
     499             : 
     500             : if_stmt_without_else:
     501             :                 T_IF '(' expr ')' statement
     502      136542 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     503       68271 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $5)); }
     504       68271 :         |       if_stmt_without_else T_ELSEIF '(' expr ')' statement
     505        3406 :                         { $$ = zend_ast_list_add($1,
     506        1703 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $6)); }
     507        1703 : ;
     508             : 
     509             : if_stmt:
     510       51325 :                 if_stmt_without_else { $$ = $1; }
     511       51325 :         |       if_stmt_without_else T_ELSE statement
     512       16946 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_IF_ELEM, NULL, $3)); }
     513       16946 : ;
     514             : 
     515             : alt_if_stmt_without_else:
     516             :                 T_IF '(' expr ')' ':' inner_statement_list
     517           8 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     518           4 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $6)); }
     519           4 :         |       alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list
     520           2 :                         { $$ = zend_ast_list_add($1,
     521           1 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $7)); }
     522           1 : ;
     523             : 
     524             : alt_if_stmt:
     525           2 :                 alt_if_stmt_without_else T_ENDIF ';' { $$ = $1; }
     526           2 :         |       alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';'
     527           2 :                         { $$ = zend_ast_list_add($1,
     528           2 :                               zend_ast_create(ZEND_AST_IF_ELEM, NULL, $4)); }
     529           2 : ;
     530             : 
     531             : parameter_list:
     532       26215 :                 non_empty_parameter_list { $$ = $1; }
     533       26215 :         |       /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_PARAM_LIST); }
     534        9009 : ;
     535             : 
     536             : 
     537             : non_empty_parameter_list:
     538             :                 parameter
     539       26215 :                         { $$ = zend_ast_create_list(1, ZEND_AST_PARAM_LIST, $1); }
     540       26215 :         |       non_empty_parameter_list ',' parameter
     541       56453 :                         { $$ = zend_ast_list_add($1, $3); }
     542       56453 : ;
     543             : 
     544             : parameter:
     545             :                 optional_type is_reference is_variadic T_VARIABLE
     546       68526 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, NULL); }
     547       68526 :         |       optional_type is_reference is_variadic T_VARIABLE '=' expr
     548       14142 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, $6); }
     549       14142 : ;
     550             : 
     551             : 
     552             : optional_type:
     553       82261 :                 /* empty */     { $$ = NULL; }
     554       82261 :         |       T_ARRAY         { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_ARRAY); }
     555         221 :         |       T_CALLABLE      { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_CALLABLE); }
     556           8 :         |       name            { $$ = $1; }
     557         178 : ;
     558             : 
     559             : argument_list:
     560       37634 :                 '(' ')' { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
     561       37634 :         |       '(' non_empty_argument_list ')' { $$ = $2; }
     562      274819 : ;
     563             : 
     564             : non_empty_argument_list:
     565             :                 argument
     566      274820 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARG_LIST, $1); }
     567      274820 :         |       non_empty_argument_list ',' argument
     568      267722 :                         { $$ = zend_ast_list_add($1, $3); }
     569      267722 : ;
     570             : 
     571             : argument:
     572      542478 :                 expr                    { $$ = $1; }
     573      542478 :         |       T_ELLIPSIS expr { $$ = zend_ast_create(ZEND_AST_UNPACK, $2); }
     574          64 : ;
     575             : 
     576             : global_var_list:
     577         580 :                 global_var_list ',' global_var { $$ = zend_ast_list_add($1, $3); }
     578         580 :         |       global_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     579        4001 : ;
     580             : 
     581             : global_var:
     582             :         simple_variable
     583        4581 :                 { $$ = zend_ast_create(ZEND_AST_GLOBAL, zend_ast_create(ZEND_AST_VAR, $1)); }
     584        4581 : ;
     585             : 
     586             : 
     587             : static_var_list:
     588           8 :                 static_var_list ',' static_var { $$ = zend_ast_list_add($1, $3); }
     589           8 :         |       static_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     590        1875 : ;
     591             : 
     592             : static_var:
     593          20 :                 T_VARIABLE                      { $$ = zend_ast_create(ZEND_AST_STATIC, $1, NULL); }
     594          20 :         |       T_VARIABLE '=' expr     { $$ = zend_ast_create(ZEND_AST_STATIC, $1, $3); }
     595        1863 : ;
     596             : 
     597             : 
     598             : class_statement_list:
     599             :                 class_statement_list class_statement
     600       19887 :                         { $$ = zend_ast_list_add($1, $2); }
     601       19887 :         |       /* empty */
     602        7285 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     603        7285 : ;
     604             : 
     605             : 
     606             : class_statement:
     607             :                 variable_modifiers property_list ';'
     608        2313 :                         { $$ = zend_ast_append_doc_comment($2 TSRMLS_CC); $$->attr = $1; }
     609        2313 :         |       T_CONST class_const_list ';'
     610         243 :                         { $$ = $2; RESET_DOC_COMMENT(); }
     611         241 :         |       T_USE name_list trait_adaptations
     612         198 :                         { $$ = zend_ast_create(ZEND_AST_USE_TRAIT, $2, $3); }
     613         198 :         |       method_modifiers function returns_ref T_STRING '(' parameter_list ')' backup_doc_comment
     614             :                 method_body
     615       68540 :                         { $$ = zend_ast_create_decl(ZEND_AST_METHOD, $3 | $1, $2, $8,
     616       34270 :                                   zend_ast_get_str($4), $6, NULL, $9); }
     617       17135 : ;
     618             : 
     619             : name_list:
     620         543 :                 name { $$ = zend_ast_create_list(1, ZEND_AST_NAME_LIST, $1); }
     621         543 :         |       name_list ',' name { $$ = zend_ast_list_add($1, $3); }
     622          81 : ;
     623             : 
     624             : trait_adaptations:
     625         141 :                 ';'                                                             { $$ = NULL; }
     626         141 :         |       '{' '}'                                                 { $$ = NULL; }
     627           0 :         |       '{' trait_adaptation_list '}'   { $$ = $2; }
     628          57 : ;
     629             : 
     630             : trait_adaptation_list:
     631             :                 trait_adaptation
     632          57 :                         { $$ = zend_ast_create_list(1, ZEND_AST_TRAIT_ADAPTATIONS, $1); }
     633          57 :         |       trait_adaptation_list trait_adaptation
     634          19 :                         { $$ = zend_ast_list_add($1, $2); }
     635          19 : ;
     636             : 
     637             : trait_adaptation:
     638          17 :                 trait_precedence ';'    { $$ = $1; }
     639          17 :         |       trait_alias ';'                 { $$ = $1; }
     640          59 : ;
     641             : 
     642             : trait_precedence:
     643             :         absolute_trait_method_reference T_INSTEADOF name_list
     644          17 :                 { $$ = zend_ast_create(ZEND_AST_TRAIT_PRECEDENCE, $1, $3); }
     645          17 : ;
     646             : 
     647             : trait_alias:
     648             :                 trait_method_reference T_AS trait_modifiers T_STRING
     649          48 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, $4); }
     650          48 :         |       trait_method_reference T_AS member_modifier
     651          11 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, NULL); }
     652          11 : ;
     653             : 
     654             : trait_method_reference:
     655             :                 T_STRING
     656          36 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, NULL, $1); }
     657          36 :         |       absolute_trait_method_reference { $$ = $1; }
     658          23 : ;
     659             : 
     660             : absolute_trait_method_reference:
     661             :         name T_PAAMAYIM_NEKUDOTAYIM T_STRING
     662          40 :                 { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, $1, $3); }
     663          40 : ;
     664             : 
     665             : trait_modifiers:
     666          44 :                 /* empty */             { $$ = 0; }
     667          44 :         |       member_modifier { $$ = $1; }
     668           4 : ;
     669             : 
     670             : method_body:
     671         169 :                 ';' /* abstract method */               { $$ = NULL; }
     672         169 :         |       '{' inner_statement_list '}'    { $$ = $2; }
     673       16966 : ;
     674             : 
     675             : variable_modifiers:
     676        2202 :                 non_empty_member_modifiers              { $$ = $1; }
     677        2202 :         |       T_VAR                                                   { $$ = ZEND_ACC_PUBLIC; }
     678         111 : ;
     679             : 
     680             : method_modifiers:
     681        6893 :                 /* empty */                                             { $$ = ZEND_ACC_PUBLIC; }
     682        6893 :         |       non_empty_member_modifiers
     683       10245 :                         { $$ = $1; if (!($$ & ZEND_ACC_PPP_MASK)) { $$ |= ZEND_ACC_PUBLIC; } }
     684       10245 : ;
     685             : 
     686             : non_empty_member_modifiers:
     687       12458 :                 member_modifier                 { $$ = $1; }
     688       12458 :         |       non_empty_member_modifiers member_modifier
     689         705 :                         { $$ = zend_add_member_modifier($1, $2); }
     690         694 : ;
     691             : 
     692             : member_modifier:
     693        4519 :                 T_PUBLIC                                { $$ = ZEND_ACC_PUBLIC; }
     694        4519 :         |       T_PROTECTED                             { $$ = ZEND_ACC_PROTECTED; }
     695         573 :         |       T_PRIVATE                               { $$ = ZEND_ACC_PRIVATE; }
     696        1092 :         |       T_STATIC                                { $$ = ZEND_ACC_STATIC; }
     697        6893 :         |       T_ABSTRACT                              { $$ = ZEND_ACC_ABSTRACT; }
     698          75 :         |       T_FINAL                                 { $$ = ZEND_ACC_FINAL; }
     699          26 : ;
     700             : 
     701             : property_list:
     702          41 :                 property_list ',' property { $$ = zend_ast_list_add($1, $3); }
     703          41 :         |       property { $$ = zend_ast_create_list(1, ZEND_AST_PROP_DECL, $1); }
     704        2313 : ;
     705             : 
     706             : property:
     707        1129 :                 T_VARIABLE { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, NULL); }
     708        1129 :         |       T_VARIABLE '=' expr
     709        1225 :                         { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, $3); }
     710        1225 : ;
     711             : 
     712             : class_const_list:
     713           3 :                 class_const_list ',' const_decl { $$ = zend_ast_list_add($1, $3); }
     714           3 :         |       const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CLASS_CONST_DECL, $1); }
     715         241 : ;
     716             : 
     717             : const_decl:
     718         431 :         T_STRING '=' expr { $$ = zend_ast_create(ZEND_AST_CONST_ELEM, $1, $3); }
     719         431 : ;
     720             : 
     721             : echo_expr_list:
     722        1389 :                 echo_expr_list ',' echo_expr { $$ = zend_ast_list_add($1, $3); }
     723        1389 :         |       echo_expr { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     724       29044 : ;
     725             : echo_expr:
     726       30433 :         expr { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     727       30433 : ;
     728             : 
     729             : for_exprs:
     730           7 :                 /* empty */                     { $$ = NULL; }
     731           7 :         |       non_empty_for_exprs     { $$ = $1; }
     732        5600 : ;
     733             : 
     734             : non_empty_for_exprs:
     735           5 :                 non_empty_for_exprs ',' expr { $$ = zend_ast_list_add($1, $3); }
     736           5 :         |       expr { $$ = zend_ast_create_list(1, ZEND_AST_EXPR_LIST, $1); }
     737        5600 : ;
     738             : 
     739             : new_expr:
     740             :                 T_NEW class_name_reference ctor_arguments
     741       14182 :                         { $$ = zend_ast_create(ZEND_AST_NEW, $2, $3); }
     742       14182 : ;
     743             : 
     744             : expr_without_variable:
     745             :                 T_LIST '(' assignment_list ')' '=' expr
     746         148 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $3, $6); }
     747         148 :         |       variable '=' expr
     748      129357 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $1, $3); }
     749      129357 :         |       variable '=' '&' variable
     750         404 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
     751         404 :         |       variable '=' '&' new_expr
     752          10 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
     753          10 :         |       T_CLONE expr { $$ = zend_ast_create(ZEND_AST_CLONE, $2); }
     754         115 :         |       variable T_PLUS_EQUAL expr
     755        1358 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_ADD, $1, $3); }
     756         679 :         |       variable T_MINUS_EQUAL expr
     757         278 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SUB, $1, $3); }
     758         139 :         |       variable T_MUL_EQUAL expr
     759          32 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MUL, $1, $3); }
     760          16 :         |       variable T_POW_EQUAL expr
     761           4 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_POW, $1, $3); }
     762           2 :         |       variable T_DIV_EQUAL expr
     763          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_DIV, $1, $3); }
     764           5 :         |       variable T_CONCAT_EQUAL expr
     765        5608 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_CONCAT, $1, $3); }
     766        2804 :         |       variable T_MOD_EQUAL expr
     767           0 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MOD, $1, $3); }
     768           0 :         |       variable T_AND_EQUAL expr
     769           4 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_AND, $1, $3); }
     770           2 :         |       variable T_OR_EQUAL expr 
     771         190 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_OR, $1, $3); }
     772          95 :         |       variable T_XOR_EQUAL expr 
     773           2 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_XOR, $1, $3); }
     774           1 :         |       variable T_SL_EQUAL expr
     775           8 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SL, $1, $3); }
     776           4 :         |       variable T_SR_EQUAL expr
     777           6 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SR, $1, $3); }
     778           3 :         |       variable T_INC { $$ = zend_ast_create(ZEND_AST_POST_INC, $1); }
     779        5360 :         |       T_INC variable { $$ = zend_ast_create(ZEND_AST_PRE_INC, $2); }
     780         518 :         |       variable T_DEC { $$ = zend_ast_create(ZEND_AST_POST_DEC, $1); }
     781          97 :         |       T_DEC variable { $$ = zend_ast_create(ZEND_AST_PRE_DEC, $2); }
     782          14 :         |       expr T_BOOLEAN_OR expr
     783        4265 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     784        4265 :         |       expr T_BOOLEAN_AND expr
     785        6541 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     786        6541 :         |       expr T_LOGICAL_OR expr
     787         858 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     788         858 :         |       expr T_LOGICAL_AND expr
     789          14 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     790          14 :         |       expr T_LOGICAL_XOR expr
     791           4 :                         { $$ = zend_ast_create_binary_op(ZEND_BOOL_XOR, $1, $3); }
     792         677 :         |       expr '|' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_OR, $1, $3); }
     793        1888 :         |       expr '&' expr       { $$ = zend_ast_create_binary_op(ZEND_BW_AND, $1, $3); }
     794        1237 :         |       expr '^' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_XOR, $1, $3); }
     795       31286 :         |       expr '.' expr   { $$ = zend_ast_create_binary_op(ZEND_CONCAT, $1, $3); }
     796       35059 :         |       expr '+' expr   { $$ = zend_ast_create_binary_op(ZEND_ADD, $1, $3); }
     797        4991 :         |       expr '-' expr   { $$ = zend_ast_create_binary_op(ZEND_SUB, $1, $3); }
     798        4043 :         |       expr '*' expr   { $$ = zend_ast_create_binary_op(ZEND_MUL, $1, $3); }
     799        2860 :         |       expr T_POW expr { $$ = zend_ast_create_binary_op(ZEND_POW, $1, $3); }
     800         536 :         |       expr '/' expr   { $$ = zend_ast_create_binary_op(ZEND_DIV, $1, $3); }
     801         980 :         |       expr '%' expr   { $$ = zend_ast_create_binary_op(ZEND_MOD, $1, $3); }
     802         591 :         |       expr T_SL expr  { $$ = zend_ast_create_binary_op(ZEND_SL, $1, $3); }
     803         205 :         |       expr T_SR expr  { $$ = zend_ast_create_binary_op(ZEND_SR, $1, $3); }
     804          69 :         |       '+' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_PLUS, $2); }
     805         252 :         |       '-' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_MINUS, $2); }
     806        6342 :         |       '!' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BOOL_NOT, $2); }
     807       29106 :         |       '~' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BW_NOT, $2); }
     808          97 :         |       expr T_IS_IDENTICAL expr
     809       10814 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_IDENTICAL, $1, $3); }
     810        5407 :         |       expr T_IS_NOT_IDENTICAL expr
     811       13352 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_IDENTICAL, $1, $3); }
     812        6676 :         |       expr T_IS_EQUAL expr
     813       31824 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_EQUAL, $1, $3); }
     814       15912 :         |       expr T_IS_NOT_EQUAL expr
     815        5364 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_EQUAL, $1, $3); }
     816        2682 :         |       expr '<' expr
     817        3602 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER, $1, $3); }
     818        1801 :         |       expr T_IS_SMALLER_OR_EQUAL expr
     819        3118 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER_OR_EQUAL, $1, $3); }
     820        1559 :         |       expr '>' expr
     821         796 :                         { $$ = zend_ast_create(ZEND_AST_GREATER, $1, $3); }
     822         796 :         |       expr T_IS_GREATER_OR_EQUAL expr
     823         316 :                         { $$ = zend_ast_create(ZEND_AST_GREATER_EQUAL, $1, $3); }
     824         316 :         |       expr T_INSTANCEOF class_name_reference
     825          65 :                         { $$ = zend_ast_create(ZEND_AST_INSTANCEOF, $1, $3); }
     826          65 :         |       '(' expr ')' { $$ = $2; }
     827       26559 :         |       new_expr { $$ = $1; }
     828       14172 :         |       expr '?' expr ':' expr
     829       27184 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, $3, $5); }
     830       27184 :         |       expr '?' ':' expr
     831          40 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, NULL, $4); }
     832          40 :         |       expr T_COALESCE expr
     833          16 :                         { $$ = zend_ast_create(ZEND_AST_COALESCE, $1, $3); }
     834          16 :         |       internal_functions_in_yacc { $$ = $1; }
     835       28857 :         |       T_INT_CAST expr         { $$ = zend_ast_create_cast(IS_LONG, $2); }
     836        4981 :         |       T_DOUBLE_CAST expr      { $$ = zend_ast_create_cast(IS_DOUBLE, $2); }
     837        1354 :         |       T_STRING_CAST expr      { $$ = zend_ast_create_cast(IS_STRING, $2); }
     838        1326 :         |       T_ARRAY_CAST expr       { $$ = zend_ast_create_cast(IS_ARRAY, $2); }
     839         184 :         |       T_OBJECT_CAST expr      { $$ = zend_ast_create_cast(IS_OBJECT, $2); }
     840         232 :         |       T_BOOL_CAST expr        { $$ = zend_ast_create_cast(_IS_BOOL, $2); }
     841          68 :         |       T_UNSET_CAST expr       { $$ = zend_ast_create_cast(IS_NULL, $2); }
     842           0 :         |       T_EXIT exit_expr        { $$ = zend_ast_create(ZEND_AST_EXIT, $2); }
     843       14353 :         |       '@' expr                        { $$ = zend_ast_create(ZEND_AST_SILENCE, $2); }
     844        5519 :         |       scalar { $$ = $1; }
     845      646190 :         |       '`' backticks_expr '`' { $$ = zend_ast_create(ZEND_AST_SHELL_EXEC, $2); }
     846         113 :         |       T_PRINT expr { $$ = zend_ast_create(ZEND_AST_PRINT, $2); }
     847        3393 :         |       T_YIELD { $$ = zend_ast_create(ZEND_AST_YIELD, NULL, NULL); }
     848          36 :         |       T_YIELD expr { $$ = zend_ast_create(ZEND_AST_YIELD, $2, NULL); }
     849          68 :         |       T_YIELD expr T_DOUBLE_ARROW expr { $$ = zend_ast_create(ZEND_AST_YIELD, $4, $2); }
     850          17 :         |       function returns_ref '(' parameter_list ')' lexical_vars backup_doc_comment
     851             :                 '{' inner_statement_list '}'
     852        1404 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $2, $1, $7,
     853             :                                   zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     854        1053 :                               $4, $6, $9); }
     855         351 :         |       T_STATIC function returns_ref '(' parameter_list ')' lexical_vars backup_doc_comment
     856             :                 '{' inner_statement_list '}'
     857          44 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $3 | ZEND_ACC_STATIC, $2, $8,
     858             :                               zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     859          33 :                               $5, $7, $10); }
     860          11 : ;
     861             : 
     862             : function:
     863       35226 :         T_FUNCTION { $$ = CG(zend_lineno); }
     864       35226 : ;
     865             : 
     866             : backup_doc_comment:
     867       42509 :         /* empty */ { $$ = CG(doc_comment); CG(doc_comment) = NULL; }
     868       42509 : ;
     869             : 
     870             : returns_ref:
     871       35157 :                 /* empty */     { $$ = 0; }
     872       35157 :         |       '&'                 { $$ = ZEND_ACC_RETURN_REFERENCE; }
     873          69 : ;
     874             : 
     875             : lexical_vars:
     876         228 :                 /* empty */ { $$ = NULL; }
     877         228 :         |       T_USE '(' lexical_var_list ')' { $$ = $3; }
     878         134 : ;
     879             : 
     880             : lexical_var_list:
     881           7 :                 lexical_var_list ',' lexical_var { $$ = zend_ast_list_add($1, $3); }
     882           7 :         |       lexical_var { $$ = zend_ast_create_list(1, ZEND_AST_CLOSURE_USES, $1); }
     883         134 : ;
     884             : 
     885             : lexical_var:
     886         114 :                 T_VARIABLE              { $$ = $1; }
     887         114 :         |       '&' T_VARIABLE      { $$ = $2; $$->attr = 1; }
     888          27 : ;
     889             : 
     890             : function_call:
     891             :                 name argument_list
     892      253902 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
     893      253902 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
     894       10190 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
     895       10190 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
     896          40 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
     897          40 :         |       callable_expr argument_list
     898        2082 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
     899        2082 : ;
     900             : 
     901             : class_name:
     902             :                 T_STATIC
     903         120 :                         { zval zv; ZVAL_STRINGL(&zv, "static", sizeof("static")-1);
     904          60 :                           $$ = zend_ast_create_zval_ex(&zv, ZEND_NAME_NOT_FQ); }
     905          60 :         |       name { $$ = $1; }
     906       32918 : ;
     907             : 
     908             : class_name_reference:
     909       13117 :                 class_name              { $$ = $1; }
     910       13117 :         |       new_variable    { $$ = $1; }
     911        1130 : ;
     912             : 
     913             : exit_expr:
     914         411 :                 /* empty */                             { $$ = NULL; }
     915         411 :         |       '(' optional_expr ')'   { $$ = $2; }
     916       13942 : ;
     917             : 
     918             : backticks_expr:
     919             :                 /* empty */
     920           0 :                         { $$ = zend_ast_create_zval_from_str(STR_EMPTY_ALLOC()); }
     921           0 :         |       T_ENCAPSED_AND_WHITESPACE { $$ = $1; }
     922           7 :         |       encaps_list { $$ = $1; }
     923         106 : ;
     924             : 
     925             : 
     926             : ctor_arguments:
     927        2666 :                 /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
     928        2666 :         |       argument_list { $$ = $1; }
     929       11516 : ;
     930             : 
     931             : 
     932             : dereferencable_scalar:
     933       24832 :                 T_ARRAY '(' array_pair_list ')' { $$ = $3; }
     934       24832 :         |       '[' array_pair_list ']'                 { $$ = $2; }
     935         574 :         |       T_CONSTANT_ENCAPSED_STRING              { $$ = $1; }
     936      344603 : ;
     937             : 
     938             : scalar:
     939      160908 :                 T_LNUMBER       { $$ = $1; }
     940      160908 :         |       T_DNUMBER       { $$ = $1; }
     941        6845 :         |       T_LINE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_LINE); }
     942          15 :         |       T_FILE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FILE); }
     943        7182 :         |       T_DIR           { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_DIR); }
     944         441 :         |       T_TRAIT_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_TRAIT_C); }
     945           5 :         |       T_METHOD_C      { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_METHOD_C); }
     946         752 :         |       T_FUNC_C        { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FUNC_C); }
     947         105 :         |       T_NS_C          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_NS_C); }
     948          36 :         |       T_CLASS_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C); }
     949          82 :         |       T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = $2; }
     950        1333 :         |       T_START_HEREDOC T_END_HEREDOC
     951         118 :                         { $$ = zend_ast_create_zval_from_str(STR_EMPTY_ALLOC()); }
     952          59 :         |       '"' encaps_list '"'   { $$ = $2; }
     953       12142 :         |       T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; }
     954         141 :         |       dereferencable_scalar   { $$ = $1; }
     955      369980 :         |       class_name_scalar       { $$ = $1; }
     956          29 :         |       constant                        { $$ = $1; }
     957       86135 : ;
     958             : 
     959             : constant:
     960       77113 :                 name { $$ = zend_ast_create(ZEND_AST_CONST, $1); }
     961       77113 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING
     962        9028 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
     963        9028 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING
     964           5 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
     965           5 : ;
     966             : 
     967             : possible_comma:
     968             :                 /* empty */
     969             :         |       ','
     970             : ;
     971             : 
     972             : expr:
     973      695978 :                 variable                                        { $$ = $1; }
     974      695978 :         |       expr_without_variable           { $$ = $1; }
     975     1033159 : ;
     976             : 
     977             : optional_expr:
     978        2830 :                 /* empty */     { $$ = NULL; }
     979        2830 :         |       expr            { $$ = $1; }
     980      178462 : ;
     981             : 
     982             : variable_class_name:
     983          57 :         dereferencable { $$ = $1; }
     984          57 : ;
     985             : 
     986             : dereferencable:
     987      166343 :                 variable                                { $$ = $1; }
     988      166343 :         |       '(' expr ')'                    { $$ = $2; }
     989          40 :         |       dereferencable_scalar   { $$ = $1; }
     990          25 : ;
     991             : 
     992             : callable_expr:
     993        2074 :                 callable_variable               { $$ = $1; }
     994        2074 :         |       '(' expr ')'                    { $$ = $2; }
     995           4 :         |       dereferencable_scalar   { $$ = $1; }
     996           4 : ;
     997             : 
     998             : callable_variable:
     999             :                 simple_variable
    1000      588775 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1001      588775 :         |       dereferencable '[' optional_expr ']'
    1002      121657 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1003      121657 :         |       constant '[' optional_expr ']'
    1004          10 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1005          10 :         |       dereferencable '{' expr '}'
    1006          21 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1007          21 :         |       dereferencable T_OBJECT_OPERATOR member_name argument_list
    1008       34723 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_CALL, $1, $3, $4); }
    1009       34723 :         |       function_call { $$ = $1; }
    1010      266214 : ;
    1011             : 
    1012             : variable:
    1013             :                 callable_variable
    1014     1009326 :                         { $$ = $1; }
    1015     1009326 :         |       static_member
    1016         625 :                         { $$ = $1; }
    1017         625 :         |       dereferencable T_OBJECT_OPERATOR member_name
    1018        9950 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1019        9950 : ;
    1020             : 
    1021             : simple_variable:
    1022      595205 :                 T_VARIABLE                      { $$ = $1; }
    1023      595205 :         |       '$' '{' expr '}'        { $$ = $3; }
    1024          30 :         |       '$' simple_variable     { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1025         159 : ;
    1026             : 
    1027             : static_member:
    1028             :                 class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1029         613 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1030         613 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1031          12 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1032          12 : ;
    1033             : 
    1034             : new_variable:
    1035             :                 simple_variable
    1036        1129 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1037        1129 :         |       new_variable '[' optional_expr ']'
    1038          11 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1039          11 :         |       new_variable '{' expr '}'
    1040           1 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1041           1 :         |       new_variable T_OBJECT_OPERATOR member_name
    1042           4 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1043           4 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1044           1 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1045           1 :         |       new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1046           2 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1047           2 : ;
    1048             : 
    1049             : member_name:
    1050       54715 :                 T_STRING                { $$ = $1; }
    1051       54715 :         |       '{' expr '}'    { $$ = $2; }
    1052          70 :         |       simple_variable { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1053         122 : ;
    1054             : 
    1055             : assignment_list:
    1056             :                 assignment_list ',' assignment_list_element
    1057         219 :                         { $$ = zend_ast_list_add($1, $3); }
    1058         219 :         |       assignment_list_element
    1059         174 :                         { $$ = zend_ast_create_list(1, ZEND_AST_LIST, $1); }
    1060         174 : ;
    1061             : 
    1062             : assignment_list_element:
    1063         355 :                 variable                                                { $$ = $1; }
    1064         355 :         |       T_LIST '(' assignment_list ')'  { $$ = $3; }
    1065          17 :         |       /* empty */                                             { $$ = NULL; }
    1066          21 : ;
    1067             : 
    1068             : 
    1069             : array_pair_list:
    1070        3328 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_ARRAY); }
    1071        3328 :         |       non_empty_array_pair_list possible_comma { $$ = $1; }
    1072       22078 : ;
    1073             : 
    1074             : non_empty_array_pair_list:
    1075             :                 non_empty_array_pair_list ',' array_pair
    1076       74128 :                         { $$ = zend_ast_list_add($1, $3); }
    1077       74128 :         |       array_pair
    1078       22078 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARRAY, $1); }
    1079       22078 : ;
    1080             : 
    1081             : array_pair:
    1082             :                 expr T_DOUBLE_ARROW expr
    1083       26902 :                         { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $3, $1); }
    1084       26902 :         |       expr { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $1, NULL); }
    1085       69153 :         |       expr T_DOUBLE_ARROW '&' variable
    1086          61 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $4, $1); }
    1087          61 :         |       '&' variable
    1088          90 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $2, NULL); }
    1089          90 : ;
    1090             : 
    1091             : encaps_list:
    1092             :                 encaps_list encaps_var
    1093        5959 :                         { $$ = zend_ast_list_add($1, $2); }
    1094        5959 :         |       encaps_list T_ENCAPSED_AND_WHITESPACE
    1095       13908 :                         { $$ = zend_ast_list_add($1, $2); }
    1096       13908 :         |       encaps_var
    1097        3809 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ENCAPS_LIST, $1); }
    1098        3809 :         |       T_ENCAPSED_AND_WHITESPACE encaps_var
    1099        8581 :                         { $$ = zend_ast_create_list(2, ZEND_AST_ENCAPS_LIST, $1, $2); }
    1100        8581 : ;
    1101             : 
    1102             : encaps_var:
    1103             :                 T_VARIABLE
    1104       16036 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1105       16036 :         |       T_VARIABLE '[' encaps_var_offset ']'
    1106        1634 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1107        1634 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1108         817 :         |       T_VARIABLE T_OBJECT_OPERATOR T_STRING
    1109         164 :                         { $$ = zend_ast_create(ZEND_AST_PROP,
    1110          82 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1111          82 :         |       T_DOLLAR_OPEN_CURLY_BRACES expr '}'
    1112           1 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1113           1 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}'
    1114         210 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1115         210 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}'
    1116           0 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1117           0 :                               zend_ast_create(ZEND_AST_VAR, $2), $4); }
    1118           0 :         |       T_CURLY_OPEN variable '}' { $$ = $2; }
    1119        1203 : ;
    1120             : 
    1121             : encaps_var_offset:
    1122           4 :                 T_STRING                { $$ = $1; }
    1123           4 :         |       T_NUM_STRING    { $$ = $1; }
    1124         225 :         |       T_VARIABLE              { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1125         588 : ;
    1126             : 
    1127             : 
    1128             : internal_functions_in_yacc:
    1129        5475 :                 T_ISSET '(' isset_variables ')' { $$ = $3; }
    1130        5475 :         |       T_EMPTY '(' expr ')' { $$ = zend_ast_create(ZEND_AST_EMPTY, $3); }
    1131        7732 :         |       T_INCLUDE expr
    1132        1862 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE, $2); }
    1133        1862 :         |       T_INCLUDE_ONCE expr
    1134         495 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE_ONCE, $2); }
    1135         495 :         |       T_EVAL '(' expr ')'
    1136        1897 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_EVAL, $3); }
    1137        1897 :         |       T_REQUIRE expr
    1138         815 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE, $2); }
    1139         815 :         |       T_REQUIRE_ONCE expr
    1140        5648 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE_ONCE, $2); }
    1141        5648 : ;
    1142             : 
    1143             : isset_variables:
    1144        5475 :                 isset_variable { $$ = $1; }
    1145        5475 :         |       isset_variables ',' isset_variable
    1146          43 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
    1147          43 : ;
    1148             : 
    1149             : isset_variable:
    1150        5518 :                 expr { $$ = zend_ast_create(ZEND_AST_ISSET, $1); }
    1151        5518 : ;
    1152             : 
    1153             : class_name_scalar:
    1154             :         class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS
    1155          29 :                 { $$ = zend_ast_create(ZEND_AST_RESOLVE_CLASS_NAME, $1); }
    1156             : ;
    1157             : 
    1158             : %%
    1159             : 
    1160             : /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
    1161             :    quotes and backslashes, so that it's suitable for yyerror.  The
    1162             :    heuristic is that double-quoting is unnecessary unless the string
    1163             :    contains an apostrophe, a comma, or backslash (other than
    1164             :    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
    1165             :    null, do not copy; instead, return the length of what the result
    1166             :    would have been.  */
    1167         336 : static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
    1168             : {
    1169         336 :         if (!yyres) {
    1170         256 :                 return yystrlen(yystr);
    1171             :         }
    1172             :         {
    1173             :                 TSRMLS_FETCH();
    1174          80 :                 if (CG(parse_error) == 0) {
    1175             :                         char buffer[120];
    1176          39 :                         const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
    1177          39 :                         unsigned int len = 0, toklen = 0, yystr_len;
    1178             :                         
    1179          39 :                         CG(parse_error) = 1;
    1180             : 
    1181          51 :                         if (LANG_SCNG(yy_text)[0] == 0 &&
    1182           6 :                                 LANG_SCNG(yy_leng) == 1 &&
    1183           6 :                                 memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
    1184           6 :                                 yystpcpy(yyres, "end of file");
    1185           6 :                                 return sizeof("end of file")-1;
    1186             :                         }
    1187             :                         
    1188          33 :                         str = LANG_SCNG(yy_text);
    1189          33 :                         end = memchr(str, '\n', LANG_SCNG(yy_leng));
    1190          33 :                         yystr_len = yystrlen(yystr);
    1191             :                         
    1192          79 :                         if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
    1193          23 :                                 && (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
    1194          23 :                                 toklen = (tok2 - tok1) + 1;
    1195             :                         } else {
    1196          10 :                                 tok1 = tok2 = NULL;
    1197          10 :                                 toklen = 0;
    1198             :                         }
    1199             :                         
    1200          33 :                         if (end == NULL) {
    1201          32 :                                 len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
    1202             :                         } else {
    1203           1 :                                 len = (end - str) > 30 ? 30 : (end - str);
    1204             :                         }
    1205          33 :                         if (toklen) {
    1206          23 :                                 snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
    1207             :                         } else {
    1208          10 :                                 snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
    1209             :                         }
    1210          33 :                         yystpcpy(yyres, buffer);
    1211          33 :                         return len + (toklen ? toklen + 1 : 0) + 2;
    1212             :                 }               
    1213             :         }       
    1214          41 :         if (*yystr == '"') {
    1215          24 :                 YYSIZE_T yyn = 0;
    1216          24 :                 const char *yyp = yystr;
    1217             : 
    1218         516 :                 for (; *++yyp != '"'; ++yyn) {
    1219         492 :                         yyres[yyn] = *yyp;
    1220             :                 }
    1221          24 :                 yyres[yyn] = '\0';
    1222          24 :                 return yyn;
    1223             :         }
    1224          17 :         yystpcpy(yyres, yystr);
    1225          17 :         return strlen(yystr);
    1226             : }
    1227             : 
    1228             : /*
    1229             :  * Local variables:
    1230             :  * tab-width: 4
    1231             :  * c-basic-offset: 4
    1232             :  * indent-tabs-mode: t
    1233             :  * End:
    1234             :  */

Generated by: LCOV version 1.10

Generated at Thu, 30 Oct 2014 07:41:27 +0000 (2 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.