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: 655 669 97.9 %
Date: 2015-03-28 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-2015 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             : #ifdef _MSC_VER
      47             : #define YYMALLOC malloc
      48             : #define YYFREE free
      49             : #endif
      50             : 
      51             : %}
      52             : 
      53             : %pure_parser
      54             : %expect 2
      55             : 
      56             : %code requires {
      57             : }
      58             : 
      59         107 : %destructor { zend_ast_destroy($$); } <ast>
      60          10 : %destructor { if ($$) zend_string_release($$); } <str>
      61             : 
      62             : %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
      63             : %left ','
      64             : %left T_LOGICAL_OR
      65             : %left T_LOGICAL_XOR
      66             : %left T_LOGICAL_AND
      67             : %right T_PRINT
      68             : %right T_YIELD
      69             : %right T_DOUBLE_ARROW
      70             : %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
      71             : %left '?' ':'
      72             : %right T_COALESCE
      73             : %left T_BOOLEAN_OR
      74             : %left T_BOOLEAN_AND
      75             : %left '|'
      76             : %left '^'
      77             : %left '&'
      78             : %nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL
      79             : %nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
      80             : %left T_SL T_SR
      81             : %left '+' '-' '.'
      82             : %left '*' '/' '%'
      83             : %right '!'
      84             : %nonassoc T_INSTANCEOF
      85             : %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 '@'
      86             : %right T_POW
      87             : %right '['
      88             : %nonassoc T_NEW T_CLONE
      89             : %left T_ELSEIF
      90             : %left T_ELSE
      91             : %left T_ENDIF
      92             : %right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC
      93             : 
      94             : %token <ast> T_LNUMBER   "integer number (T_LNUMBER)"
      95             : %token <ast> T_DNUMBER   "floating-point number (T_DNUMBER)"
      96             : %token <ast> T_STRING    "identifier (T_STRING)"
      97             : %token <ast> T_VARIABLE  "variable (T_VARIABLE)"
      98             : %token <ast> T_INLINE_HTML
      99             : %token <ast> T_ENCAPSED_AND_WHITESPACE  "quoted-string and whitespace (T_ENCAPSED_AND_WHITESPACE)"
     100             : %token <ast> T_CONSTANT_ENCAPSED_STRING "quoted-string (T_CONSTANT_ENCAPSED_STRING)"
     101             : %token <ast> T_STRING_VARNAME "variable name (T_STRING_VARNAME)"
     102             : %token <ast> T_NUM_STRING "number (T_NUM_STRING)"
     103             : 
     104             : %token END 0 "end of file"
     105             : %token T_INCLUDE      "include (T_INCLUDE)"
     106             : %token T_INCLUDE_ONCE "include_once (T_INCLUDE_ONCE)"
     107             : %token T_EVAL         "eval (T_EVAL)"
     108             : %token T_REQUIRE      "require (T_REQUIRE)"
     109             : %token T_REQUIRE_ONCE "require_once (T_REQUIRE_ONCE)"
     110             : %token T_LOGICAL_OR   "or (T_LOGICAL_OR)"
     111             : %token T_LOGICAL_XOR  "xor (T_LOGICAL_XOR)"
     112             : %token T_LOGICAL_AND  "and (T_LOGICAL_AND)"
     113             : %token T_PRINT        "print (T_PRINT)"
     114             : %token T_YIELD        "yield (T_YIELD)"
     115             : %token T_PLUS_EQUAL   "+= (T_PLUS_EQUAL)"
     116             : %token T_MINUS_EQUAL  "-= (T_MINUS_EQUAL)"
     117             : %token T_MUL_EQUAL    "*= (T_MUL_EQUAL)"
     118             : %token T_DIV_EQUAL    "/= (T_DIV_EQUAL)"
     119             : %token T_CONCAT_EQUAL ".= (T_CONCAT_EQUAL)"
     120             : %token T_MOD_EQUAL    "%= (T_MOD_EQUAL)"
     121             : %token T_AND_EQUAL    "&= (T_AND_EQUAL)"
     122             : %token T_OR_EQUAL     "|= (T_OR_EQUAL)"
     123             : %token T_XOR_EQUAL    "^= (T_XOR_EQUAL)"
     124             : %token T_SL_EQUAL     "<<= (T_SL_EQUAL)"
     125             : %token T_SR_EQUAL     ">>= (T_SR_EQUAL)"
     126             : %token T_BOOLEAN_OR   "|| (T_BOOLEAN_OR)"
     127             : %token T_BOOLEAN_AND  "&& (T_BOOLEAN_AND)"
     128             : %token T_IS_EQUAL     "== (T_IS_EQUAL)"
     129             : %token T_IS_NOT_EQUAL "!= (T_IS_NOT_EQUAL)"
     130             : %token T_IS_IDENTICAL "=== (T_IS_IDENTICAL)"
     131             : %token T_IS_NOT_IDENTICAL "!== (T_IS_NOT_IDENTICAL)"
     132             : %token T_IS_SMALLER_OR_EQUAL "<= (T_IS_SMALLER_OR_EQUAL)"
     133             : %token T_IS_GREATER_OR_EQUAL ">= (T_IS_GREATER_OR_EQUAL)"
     134             : %token T_SL "<< (T_SL)"
     135             : %token T_SR ">> (T_SR)"
     136             : %token T_INSTANCEOF  "instanceof (T_INSTANCEOF)"
     137             : %token T_INC "++ (T_INC)"
     138             : %token T_DEC "-- (T_DEC)"
     139             : %token T_INT_CAST    "(int) (T_INT_CAST)"
     140             : %token T_DOUBLE_CAST "(double) (T_DOUBLE_CAST)"
     141             : %token T_STRING_CAST "(string) (T_STRING_CAST)"
     142             : %token T_ARRAY_CAST  "(array) (T_ARRAY_CAST)"
     143             : %token T_OBJECT_CAST "(object) (T_OBJECT_CAST)"
     144             : %token T_BOOL_CAST   "(bool) (T_BOOL_CAST)"
     145             : %token T_UNSET_CAST  "(unset) (T_UNSET_CAST)"
     146             : %token T_NEW       "new (T_NEW)"
     147             : %token T_CLONE     "clone (T_CLONE)"
     148             : %token T_EXIT      "exit (T_EXIT)"
     149             : %token T_IF        "if (T_IF)"
     150             : %token T_ELSEIF    "elseif (T_ELSEIF)"
     151             : %token T_ELSE      "else (T_ELSE)"
     152             : %token T_ENDIF     "endif (T_ENDIF)"
     153             : %token T_ECHO       "echo (T_ECHO)"
     154             : %token T_DO         "do (T_DO)"
     155             : %token T_WHILE      "while (T_WHILE)"
     156             : %token T_ENDWHILE   "endwhile (T_ENDWHILE)"
     157             : %token T_FOR        "for (T_FOR)"
     158             : %token T_ENDFOR     "endfor (T_ENDFOR)"
     159             : %token T_FOREACH    "foreach (T_FOREACH)"
     160             : %token T_ENDFOREACH "endforeach (T_ENDFOREACH)"
     161             : %token T_DECLARE    "declare (T_DECLARE)"
     162             : %token T_ENDDECLARE "enddeclare (T_ENDDECLARE)"
     163             : %token T_AS         "as (T_AS)"
     164             : %token T_SWITCH     "switch (T_SWITCH)"
     165             : %token T_ENDSWITCH  "endswitch (T_ENDSWITCH)"
     166             : %token T_CASE       "case (T_CASE)"
     167             : %token T_DEFAULT    "default (T_DEFAULT)"
     168             : %token T_BREAK      "break (T_BREAK)"
     169             : %token T_CONTINUE   "continue (T_CONTINUE)"
     170             : %token T_GOTO       "goto (T_GOTO)"
     171             : %token T_FUNCTION   "function (T_FUNCTION)"
     172             : %token T_CONST      "const (T_CONST)"
     173             : %token T_RETURN     "return (T_RETURN)"
     174             : %token T_TRY        "try (T_TRY)"
     175             : %token T_CATCH      "catch (T_CATCH)"
     176             : %token T_FINALLY    "finally (T_FINALLY)"
     177             : %token T_THROW      "throw (T_THROW)"
     178             : %token T_USE        "use (T_USE)"
     179             : %token T_INSTEADOF  "insteadof (T_INSTEADOF)"
     180             : %token T_GLOBAL     "global (T_GLOBAL)"
     181             : %token T_STATIC     "static (T_STATIC)"
     182             : %token T_ABSTRACT   "abstract (T_ABSTRACT)"
     183             : %token T_FINAL      "final (T_FINAL)"
     184             : %token T_PRIVATE    "private (T_PRIVATE)"
     185             : %token T_PROTECTED  "protected (T_PROTECTED)"
     186             : %token T_PUBLIC     "public (T_PUBLIC)"
     187             : %token T_VAR        "var (T_VAR)"
     188             : %token T_UNSET      "unset (T_UNSET)"
     189             : %token T_ISSET      "isset (T_ISSET)"
     190             : %token T_EMPTY      "empty (T_EMPTY)"
     191             : %token T_HALT_COMPILER "__halt_compiler (T_HALT_COMPILER)"
     192             : %token T_CLASS      "class (T_CLASS)"
     193             : %token T_TRAIT      "trait (T_TRAIT)"
     194             : %token T_INTERFACE  "interface (T_INTERFACE)"
     195             : %token T_EXTENDS    "extends (T_EXTENDS)"
     196             : %token T_IMPLEMENTS "implements (T_IMPLEMENTS)"
     197             : %token T_OBJECT_OPERATOR "-> (T_OBJECT_OPERATOR)"
     198             : %token T_DOUBLE_ARROW    "=> (T_DOUBLE_ARROW)"
     199             : %token T_LIST            "list (T_LIST)"
     200             : %token T_ARRAY           "array (T_ARRAY)"
     201             : %token T_CALLABLE        "callable (T_CALLABLE)"
     202             : %token T_LINE            "__LINE__ (T_LINE)"
     203             : %token T_FILE            "__FILE__ (T_FILE)"
     204             : %token T_DIR             "__DIR__ (T_DIR)"
     205             : %token T_CLASS_C         "__CLASS__ (T_CLASS_C)"
     206             : %token T_TRAIT_C         "__TRAIT__ (T_TRAIT_C)"
     207             : %token T_METHOD_C        "__METHOD__ (T_METHOD_C)"
     208             : %token T_FUNC_C          "__FUNCTION__ (T_FUNC_C)"
     209             : %token T_COMMENT         "comment (T_COMMENT)"
     210             : %token T_DOC_COMMENT     "doc comment (T_DOC_COMMENT)"
     211             : %token T_OPEN_TAG        "open tag (T_OPEN_TAG)"
     212             : %token T_OPEN_TAG_WITH_ECHO "open tag with echo (T_OPEN_TAG_WITH_ECHO)"
     213             : %token T_CLOSE_TAG       "close tag (T_CLOSE_TAG)"
     214             : %token T_WHITESPACE      "whitespace (T_WHITESPACE)"
     215             : %token T_START_HEREDOC   "heredoc start (T_START_HEREDOC)"
     216             : %token T_END_HEREDOC     "heredoc end (T_END_HEREDOC)"
     217             : %token T_DOLLAR_OPEN_CURLY_BRACES "${ (T_DOLLAR_OPEN_CURLY_BRACES)"
     218             : %token T_CURLY_OPEN      "{$ (T_CURLY_OPEN)"
     219             : %token T_PAAMAYIM_NEKUDOTAYIM ":: (T_PAAMAYIM_NEKUDOTAYIM)"
     220             : %token T_NAMESPACE       "namespace (T_NAMESPACE)"
     221             : %token T_NS_C            "__NAMESPACE__ (T_NS_C)"
     222             : %token T_NS_SEPARATOR    "\\ (T_NS_SEPARATOR)"
     223             : %token T_ELLIPSIS        "... (T_ELLIPSIS)"
     224             : %token T_COALESCE        "?? (T_COALESCE)"
     225             : %token T_POW             "** (T_POW)"
     226             : %token T_POW_EQUAL       "**= (T_POW_EQUAL)"
     227             : 
     228             : %type <ast> top_statement namespace_name name statement function_declaration_statement
     229             : %type <ast> class_declaration_statement trait_declaration_statement
     230             : %type <ast> interface_declaration_statement interface_extends_list
     231             : %type <ast> use_declaration const_decl inner_statement
     232             : %type <ast> expr optional_expr while_statement for_statement foreach_variable
     233             : %type <ast> foreach_statement declare_statement finally_statement unset_variable variable
     234             : %type <ast> extends_from parameter optional_type argument expr_without_variable global_var
     235             : %type <ast> static_var class_statement trait_adaptation trait_precedence trait_alias
     236             : %type <ast> absolute_trait_method_reference trait_method_reference property echo_expr
     237             : %type <ast> new_expr class_name class_name_reference simple_variable internal_functions_in_yacc
     238             : %type <ast> exit_expr scalar backticks_expr lexical_var function_call member_name
     239             : %type <ast> variable_class_name dereferencable_scalar class_name_scalar constant dereferencable
     240             : %type <ast> callable_expr callable_variable static_member new_variable
     241             : %type <ast> assignment_list_element array_pair encaps_var encaps_var_offset isset_variables
     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 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 isset_variable type return_type
     251             : 
     252             : %type <num> returns_ref function is_reference is_variadic variable_modifiers
     253             : %type <num> method_modifiers trait_modifiers non_empty_member_modifiers member_modifier
     254             : %type <num> class_modifiers class_modifier
     255             : 
     256             : %type <str> backup_doc_comment
     257             : 
     258             : %% /* Rules */
     259             : 
     260             : start:
     261       30084 :         top_statement_list      { CG(ast) = $1; }
     262       30084 : ;
     263             : 
     264             : top_statement_list:
     265      218813 :                 top_statement_list top_statement { $$ = zend_ast_list_add($1, $2); }
     266      218813 :         |       /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     267       30223 : ;
     268             : 
     269             : namespace_name:
     270      376009 :                 T_STRING                                                                { $$ = $1; }
     271      376009 :         |       namespace_name T_NS_SEPARATOR T_STRING  { $$ = zend_ast_append_str($1, $3); }
     272         393 : ;
     273             : 
     274             : name:
     275      375467 :                 namespace_name                                                          { $$ = $1; $$->attr = ZEND_NAME_NOT_FQ; }
     276      375467 :         |       T_NAMESPACE T_NS_SEPARATOR namespace_name       { $$ = $3; $$->attr = ZEND_NAME_RELATIVE; }
     277          49 :         |       T_NS_SEPARATOR namespace_name                           { $$ = $2; $$->attr = ZEND_NAME_FQ; }
     278         220 : ;
     279             : 
     280             : top_statement:
     281      197961 :                 statement                                                       { $$ = $1; }
     282      197961 :         |       function_declaration_statement          { $$ = $1; }
     283       13698 :         |       class_declaration_statement                     { $$ = $1; }
     284        6013 :         |       trait_declaration_statement                     { $$ = $1; }
     285         212 :         |       interface_declaration_statement         { $$ = $1; }
     286         194 :         |       T_HALT_COMPILER '(' ')' ';'
     287         550 :                         { $$ = zend_ast_create(ZEND_AST_HALT_COMPILER,
     288         275 :                               zend_ast_create_zval_from_long(zend_get_scanned_file_offset()));
     289         275 :                           zend_stop_lexing(); }
     290         275 :         |       T_NAMESPACE namespace_name ';'
     291         136 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, NULL);
     292         136 :                           RESET_DOC_COMMENT(); }
     293         137 :         |       T_NAMESPACE namespace_name { RESET_DOC_COMMENT(); }
     294          44 :                 '{' top_statement_list '}'
     295          42 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, $5); }
     296          42 :         |       T_NAMESPACE { RESET_DOC_COMMENT(); }
     297          33 :                 '{' top_statement_list '}'
     298          33 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, NULL, $4); }
     299          33 :         |       T_USE use_declarations ';'                              { $$ = $2; $$->attr = T_CLASS; }
     300          54 :         |       T_USE T_FUNCTION use_declarations ';'   { $$ = $3; $$->attr = T_FUNCTION; }
     301          17 :         |       T_USE T_CONST use_declarations ';'              { $$ = $3; $$->attr = T_CONST; }
     302          14 :         |       T_CONST const_list ';'                                  { $$ = $2; }
     303         164 : ;
     304             : 
     305             : use_declarations:
     306             :                 use_declarations ',' use_declaration
     307           8 :                         { $$ = zend_ast_list_add($1, $3); }
     308           8 :         |       use_declaration
     309          85 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     310          85 : ;
     311             : 
     312             : use_declaration:
     313             :                 namespace_name
     314          35 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, NULL); }
     315          35 :         |       namespace_name T_AS T_STRING
     316          44 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, $3); }
     317          44 :         |       T_NS_SEPARATOR namespace_name
     318          10 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $2, NULL); }
     319          10 :         |       T_NS_SEPARATOR namespace_name T_AS T_STRING
     320           4 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $2, $4); }
     321           4 : ;
     322             : 
     323             : const_list:
     324           1 :                 const_list ',' const_decl { $$ = zend_ast_list_add($1, $3); }
     325           1 :         |       const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CONST_DECL, $1); }
     326         196 : ;
     327             : 
     328             : inner_statement_list:
     329             :                 inner_statement_list inner_statement
     330      237003 :                         { $$ = zend_ast_list_add($1, $2); }
     331      237003 :         |       /* empty */
     332      112741 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     333      112741 : ;
     334             : 
     335             : 
     336             : inner_statement:
     337      231671 :                 statement { $$ = $1; }
     338      231671 :         |       function_declaration_statement          { $$ = $1; }
     339        4400 :         |       class_declaration_statement             { $$ = $1; }
     340         932 :         |       trait_declaration_statement                     { $$ = $1; }
     341           0 :         |       interface_declaration_statement         { $$ = $1; }
     342           0 :         |       T_HALT_COMPILER '(' ')' ';'
     343           1 :                         { $$ = NULL; zend_error_noreturn(E_COMPILE_ERROR,
     344             :                               "__HALT_COMPILER() can only be used from the outermost scope"); }
     345             : ;
     346             : 
     347             : 
     348             : statement:
     349       71142 :                 '{' inner_statement_list '}' { $$ = $2; }
     350       71142 :         |       if_stmt { $$ = $1; }
     351       70035 :         |       alt_if_stmt { $$ = $1; }
     352           4 :         |       T_WHILE '(' expr ')' while_statement
     353        1839 :                         { $$ = zend_ast_create(ZEND_AST_WHILE, $3, $5); }
     354        1839 :         |       T_DO statement T_WHILE '(' expr ')' ';'
     355         292 :                         { $$ = zend_ast_create(ZEND_AST_DO_WHILE, $2, $5); }
     356         292 :         |       T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement
     357        2045 :                         { $$ = zend_ast_create(ZEND_AST_FOR, $3, $5, $7, $9); }
     358        2045 :         |       T_SWITCH '(' expr ')' switch_case_list
     359         451 :                         { $$ = zend_ast_create(ZEND_AST_SWITCH, $3, $5); }
     360         451 :         |       T_BREAK optional_expr ';'               { $$ = zend_ast_create(ZEND_AST_BREAK, $2); }
     361        1872 :         |       T_CONTINUE optional_expr ';'    { $$ = zend_ast_create(ZEND_AST_CONTINUE, $2); }
     362         279 :         |       T_RETURN optional_expr ';'              { $$ = zend_ast_create(ZEND_AST_RETURN, $2); }
     363       44555 :         |       T_GLOBAL global_var_list ';'    { $$ = $2; }
     364        4352 :         |       T_STATIC static_var_list ';'    { $$ = $2; }
     365        1890 :         |       T_ECHO echo_expr_list ';'               { $$ = $2; }
     366       29967 :         |       T_INLINE_HTML { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     367        3545 :         |       expr ';' { $$ = $1; }
     368      258675 :         |       T_UNSET '(' unset_variables ')' ';' { $$ = $3; }
     369        1448 :         |       T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement
     370        5377 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $5, NULL, $7); }
     371        5377 :         |       T_FOREACH '(' expr T_AS foreach_variable T_DOUBLE_ARROW foreach_variable ')'
     372             :                 foreach_statement
     373        4705 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $7, $5, $9); }
     374        4705 :         |       T_DECLARE '(' const_list ')'
     375          32 :                         { zend_handle_encoding_declaration($3); }
     376          28 :                 declare_statement
     377          28 :                         { $$ = zend_ast_create(ZEND_AST_DECLARE, $3, $6); }
     378          28 :         |       ';'     /* empty statement */ { $$ = NULL; }
     379       28007 :         |       T_TRY '{' inner_statement_list '}' catch_list finally_statement
     380        2016 :                         { $$ = zend_ast_create(ZEND_AST_TRY, $3, $5, $6); }
     381        2016 :         |       T_THROW expr ';' { $$ = zend_ast_create(ZEND_AST_THROW, $2); }
     382         328 :         |       T_GOTO T_STRING ';' { $$ = zend_ast_create(ZEND_AST_GOTO, $2); }
     383          36 :         |       T_STRING ':' { $$ = zend_ast_create(ZEND_AST_LABEL, $1); }
     384          37 : ;
     385             : 
     386             : catch_list:
     387             :                 /* empty */
     388        2016 :                         { $$ = zend_ast_create_list(0, ZEND_AST_CATCH_LIST); }
     389        2016 :         |       catch_list T_CATCH '(' name T_VARIABLE ')' '{' inner_statement_list '}'
     390        1982 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_CATCH, $4, $5, $8)); }
     391        1982 : ;
     392             : 
     393             : finally_statement:
     394        1946 :                 /* empty */ { $$ = NULL; }
     395        1946 :         |       T_FINALLY '{' inner_statement_list '}' { $$ = $3; }
     396          70 : ;
     397             : 
     398             : unset_variables:
     399        1448 :                 unset_variable { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     400        1448 :         |       unset_variables ',' unset_variable { $$ = zend_ast_list_add($1, $3); }
     401         117 : ;
     402             : 
     403             : unset_variable:
     404        1565 :                 variable { $$ = zend_ast_create(ZEND_AST_UNSET, $1); }
     405        1565 : ;
     406             : 
     407             : function_declaration_statement:
     408             :         function returns_ref T_STRING '(' parameter_list ')' return_type
     409             :         backup_doc_comment '{' inner_statement_list '}'
     410       90490 :                 { $$ = zend_ast_create_decl(ZEND_AST_FUNC_DECL, $2, $1, $8,
     411       72392 :                       zend_ast_get_str($3), $5, NULL, $10, $7); }
     412       18098 : ;
     413             : 
     414             : is_reference:
     415       83119 :                 /* empty */     { $$ = 0; }
     416       83119 :         |       '&'                 { $$ = ZEND_PARAM_REF; }
     417        1060 : ;
     418             : 
     419             : is_variadic:
     420       84141 :                 /* empty */ { $$ = 0; }
     421       84141 :         |       T_ELLIPSIS  { $$ = ZEND_PARAM_VARIADIC; }
     422          38 : ;
     423             : 
     424             : class_declaration_statement:
     425         108 :                 class_modifiers T_CLASS { $<num>$ = CG(zend_lineno); }
     426         108 :                 T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
     427         216 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, $1, $<num>3, $7, zend_ast_get_str($4), $5, $6, $9, NULL); }
     428         108 :         |       T_CLASS { $<num>$ = CG(zend_lineno); }
     429        6856 :                 T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
     430       13674 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, 0, $<num>2, $6, zend_ast_get_str($3), $4, $5, $8, NULL); }
     431        6837 : ;
     432             : 
     433             : class_modifiers:
     434         110 :                 class_modifier                                  { $$ = $1; }
     435         110 :         |       class_modifiers class_modifier  { $$ = zend_add_class_modifier($1, $2); }
     436           0 : ;
     437             : 
     438             : class_modifier:
     439          94 :                 T_ABSTRACT              { $$ = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
     440          94 :         |       T_FINAL                 { $$ = ZEND_ACC_FINAL; }
     441          18 : ;
     442             : 
     443             : trait_declaration_statement:
     444         214 :                 T_TRAIT { $<num>$ = CG(zend_lineno); }
     445         214 :                 T_STRING backup_doc_comment '{' class_statement_list '}'
     446         424 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, ZEND_ACC_TRAIT, $<num>2, $4, zend_ast_get_str($3), NULL, NULL, $6, NULL); }
     447         212 : ;
     448             : 
     449             : interface_declaration_statement:
     450         195 :                 T_INTERFACE { $<num>$ = CG(zend_lineno); }
     451         195 :                 T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}'
     452         388 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, ZEND_ACC_INTERFACE, $<num>2, $5, zend_ast_get_str($3), NULL, $4, $7, NULL); }
     453         194 : ;
     454             : 
     455             : extends_from:
     456        4612 :                 /* empty */             { $$ = NULL; }
     457        4612 :         |       T_EXTENDS name  { $$ = $2; }
     458        2350 : ;
     459             : 
     460             : interface_extends_list:
     461         157 :                 /* empty */                     { $$ = NULL; }
     462         157 :         |       T_EXTENDS name_list     { $$ = $2; }
     463          37 : ;
     464             : 
     465             : implements_list:
     466        6659 :                 /* empty */                             { $$ = NULL; }
     467        6659 :         |       T_IMPLEMENTS name_list  { $$ = $2; }
     468         302 : ;
     469             : 
     470             : foreach_variable:
     471       14675 :                 variable                        { $$ = $1; }
     472       14675 :         |       '&' variable                { $$ = zend_ast_create(ZEND_AST_REF, $2); }
     473         103 :         |       T_LIST '(' assignment_list ')' { $$ = $3; }
     474           9 : ;
     475             : 
     476             : for_statement:
     477        2042 :                 statement { $$ = $1; }
     478        2042 :         |       ':' inner_statement_list T_ENDFOR ';' { $$ = $2; }
     479           3 : ;
     480             : 
     481             : foreach_statement:
     482       10082 :                 statement { $$ = $1; }
     483       10082 :         |       ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; }
     484           0 : ;
     485             : 
     486             : declare_statement:
     487          28 :                 statement { $$ = $1; }
     488          28 :         |       ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; }
     489           0 : ;
     490             : 
     491             : switch_case_list:
     492         450 :                 '{' case_list '}'                                       { $$ = $2; }
     493         450 :         |       '{' ';' case_list '}'                           { $$ = $3; }
     494           0 :         |       ':' case_list T_ENDSWITCH ';'           { $$ = $2; }
     495           1 :         |       ':' ';' case_list T_ENDSWITCH ';'       { $$ = $3; }
     496           0 : ;
     497             : 
     498             : case_list:
     499         451 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_SWITCH_LIST); }
     500         451 :         |       case_list T_CASE expr case_separator inner_statement_list
     501        1594 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, $3, $5)); }
     502        1594 :         |       case_list T_DEFAULT case_separator inner_statement_list
     503         267 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, NULL, $4)); }
     504         267 : ;
     505             : 
     506             : case_separator:
     507             :                 ':'
     508             :         |       ';'
     509             : ;
     510             : 
     511             : 
     512             : while_statement:
     513        1838 :                 statement { $$ = $1; }
     514        1838 :         |       ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; }
     515           1 : ;
     516             : 
     517             : 
     518             : if_stmt_without_else:
     519             :                 T_IF '(' expr ')' statement
     520      140070 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     521       70035 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $5)); }
     522       70035 :         |       if_stmt_without_else T_ELSEIF '(' expr ')' statement
     523        3480 :                         { $$ = zend_ast_list_add($1,
     524        1740 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $6)); }
     525        1740 : ;
     526             : 
     527             : if_stmt:
     528       52799 :                 if_stmt_without_else { $$ = $1; }
     529       52799 :         |       if_stmt_without_else T_ELSE statement
     530       17236 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_IF_ELEM, NULL, $3)); }
     531       17236 : ;
     532             : 
     533             : alt_if_stmt_without_else:
     534             :                 T_IF '(' expr ')' ':' inner_statement_list
     535           8 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     536           4 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $6)); }
     537           4 :         |       alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list
     538           2 :                         { $$ = zend_ast_list_add($1,
     539           1 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $7)); }
     540           1 : ;
     541             : 
     542             : alt_if_stmt:
     543           2 :                 alt_if_stmt_without_else T_ENDIF ';' { $$ = $1; }
     544           2 :         |       alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';'
     545           2 :                         { $$ = zend_ast_list_add($1,
     546           2 :                               zend_ast_create(ZEND_AST_IF_ELEM, NULL, $4)); }
     547           2 : ;
     548             : 
     549             : parameter_list:
     550       26754 :                 non_empty_parameter_list { $$ = $1; }
     551       26754 :         |       /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_PARAM_LIST); }
     552        9083 : ;
     553             : 
     554             : 
     555             : non_empty_parameter_list:
     556             :                 parameter
     557       26754 :                         { $$ = zend_ast_create_list(1, ZEND_AST_PARAM_LIST, $1); }
     558       26754 :         |       non_empty_parameter_list ',' parameter
     559       57425 :                         { $$ = zend_ast_list_add($1, $3); }
     560       57425 : ;
     561             : 
     562             : parameter:
     563             :                 optional_type is_reference is_variadic T_VARIABLE
     564       69495 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, NULL); }
     565       69495 :         |       optional_type is_reference is_variadic T_VARIABLE '=' expr
     566       14684 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, $6); }
     567       14684 : ;
     568             : 
     569             : 
     570             : optional_type:
     571       83761 :                 /* empty */     { $$ = NULL; }
     572       83761 :         |       type            { $$ = $1; }
     573         418 : ;
     574             : 
     575             : type:
     576         240 :                 T_ARRAY         { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_ARRAY); }
     577         240 :         |       T_CALLABLE      { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_CALLABLE); }
     578          11 :         |       name            { $$ = $1; }
     579         229 : ;
     580             : 
     581             : return_type:
     582       35773 :                 /* empty */     { $$ = NULL; }
     583       35773 :         |       ':' type        { $$ = $2; }
     584          62 : ;
     585             : 
     586             : argument_list:
     587       37823 :                 '(' ')' { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
     588       37823 :         |       '(' non_empty_argument_list ')' { $$ = $2; }
     589      279078 : ;
     590             : 
     591             : non_empty_argument_list:
     592             :                 argument
     593      279079 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARG_LIST, $1); }
     594      279079 :         |       non_empty_argument_list ',' argument
     595      270120 :                         { $$ = zend_ast_list_add($1, $3); }
     596      270120 : ;
     597             : 
     598             : argument:
     599      549135 :                 expr                    { $$ = $1; }
     600      549135 :         |       T_ELLIPSIS expr { $$ = zend_ast_create(ZEND_AST_UNPACK, $2); }
     601          64 : ;
     602             : 
     603             : global_var_list:
     604         933 :                 global_var_list ',' global_var { $$ = zend_ast_list_add($1, $3); }
     605         933 :         |       global_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     606        4353 : ;
     607             : 
     608             : global_var:
     609             :         simple_variable
     610        5286 :                 { $$ = zend_ast_create(ZEND_AST_GLOBAL, zend_ast_create(ZEND_AST_VAR, $1)); }
     611        5286 : ;
     612             : 
     613             : 
     614             : static_var_list:
     615           8 :                 static_var_list ',' static_var { $$ = zend_ast_list_add($1, $3); }
     616           8 :         |       static_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     617        1890 : ;
     618             : 
     619             : static_var:
     620          20 :                 T_VARIABLE                      { $$ = zend_ast_create(ZEND_AST_STATIC, $1, NULL); }
     621          20 :         |       T_VARIABLE '=' expr     { $$ = zend_ast_create(ZEND_AST_STATIC, $1, $3); }
     622        1878 : ;
     623             : 
     624             : 
     625             : class_statement_list:
     626             :                 class_statement_list class_statement
     627       20113 :                         { $$ = zend_ast_list_add($1, $2); }
     628       20113 :         |       /* empty */
     629        7365 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     630        7365 : ;
     631             : 
     632             : 
     633             : class_statement:
     634             :                 variable_modifiers property_list ';'
     635        2323 :                         { $$ = zend_ast_append_doc_comment($2); $$->attr = $1; }
     636        2323 :         |       T_CONST class_const_list ';'
     637         247 :                         { $$ = $2; RESET_DOC_COMMENT(); }
     638         245 :         |       T_USE name_list trait_adaptations
     639         202 :                         { $$ = zend_ast_create(ZEND_AST_USE_TRAIT, $2, $3); }
     640         202 :         |       method_modifiers function returns_ref T_STRING '(' parameter_list ')'
     641             :                 return_type backup_doc_comment method_body
     642       69372 :                         { $$ = zend_ast_create_decl(ZEND_AST_METHOD, $3 | $1, $2, $9,
     643       52029 :                                   zend_ast_get_str($4), $6, NULL, $10, $8); }
     644       17343 : ;
     645             : 
     646             : name_list:
     647         558 :                 name { $$ = zend_ast_create_list(1, ZEND_AST_NAME_LIST, $1); }
     648         558 :         |       name_list ',' name { $$ = zend_ast_list_add($1, $3); }
     649          81 : ;
     650             : 
     651             : trait_adaptations:
     652         145 :                 ';'                                                             { $$ = NULL; }
     653         145 :         |       '{' '}'                                                 { $$ = NULL; }
     654           0 :         |       '{' trait_adaptation_list '}'   { $$ = $2; }
     655          57 : ;
     656             : 
     657             : trait_adaptation_list:
     658             :                 trait_adaptation
     659          57 :                         { $$ = zend_ast_create_list(1, ZEND_AST_TRAIT_ADAPTATIONS, $1); }
     660          57 :         |       trait_adaptation_list trait_adaptation
     661          19 :                         { $$ = zend_ast_list_add($1, $2); }
     662          19 : ;
     663             : 
     664             : trait_adaptation:
     665          17 :                 trait_precedence ';'    { $$ = $1; }
     666          17 :         |       trait_alias ';'                 { $$ = $1; }
     667          59 : ;
     668             : 
     669             : trait_precedence:
     670             :         absolute_trait_method_reference T_INSTEADOF name_list
     671          17 :                 { $$ = zend_ast_create(ZEND_AST_TRAIT_PRECEDENCE, $1, $3); }
     672          17 : ;
     673             : 
     674             : trait_alias:
     675             :                 trait_method_reference T_AS trait_modifiers T_STRING
     676          48 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, $4); }
     677          48 :         |       trait_method_reference T_AS member_modifier
     678          11 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, NULL); }
     679          11 : ;
     680             : 
     681             : trait_method_reference:
     682             :                 T_STRING
     683          36 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, NULL, $1); }
     684          36 :         |       absolute_trait_method_reference { $$ = $1; }
     685          23 : ;
     686             : 
     687             : absolute_trait_method_reference:
     688             :         name T_PAAMAYIM_NEKUDOTAYIM T_STRING
     689          40 :                 { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, $1, $3); }
     690          40 : ;
     691             : 
     692             : trait_modifiers:
     693          44 :                 /* empty */             { $$ = 0; }
     694          44 :         |       member_modifier { $$ = $1; }
     695           4 : ;
     696             : 
     697             : method_body:
     698         177 :                 ';' /* abstract method */               { $$ = NULL; }
     699         177 :         |       '{' inner_statement_list '}'    { $$ = $2; }
     700       17166 : ;
     701             : 
     702             : variable_modifiers:
     703        2212 :                 non_empty_member_modifiers              { $$ = $1; }
     704        2212 :         |       T_VAR                                                   { $$ = ZEND_ACC_PUBLIC; }
     705         111 : ;
     706             : 
     707             : method_modifiers:
     708        6928 :                 /* empty */                                             { $$ = ZEND_ACC_PUBLIC; }
     709        6928 :         |       non_empty_member_modifiers
     710       10418 :                         { $$ = $1; if (!($$ & ZEND_ACC_PPP_MASK)) { $$ |= ZEND_ACC_PUBLIC; } }
     711       10418 : ;
     712             : 
     713             : non_empty_member_modifiers:
     714       12641 :                 member_modifier                 { $$ = $1; }
     715       12641 :         |       non_empty_member_modifiers member_modifier
     716         722 :                         { $$ = zend_add_member_modifier($1, $2); }
     717         711 : ;
     718             : 
     719             : member_modifier:
     720        4567 :                 T_PUBLIC                                { $$ = ZEND_ACC_PUBLIC; }
     721        4567 :         |       T_PROTECTED                             { $$ = ZEND_ACC_PROTECTED; }
     722         573 :         |       T_PRIVATE                               { $$ = ZEND_ACC_PRIVATE; }
     723        1096 :         |       T_STATIC                                { $$ = ZEND_ACC_STATIC; }
     724        7040 :         |       T_ABSTRACT                              { $$ = ZEND_ACC_ABSTRACT; }
     725          76 :         |       T_FINAL                                 { $$ = ZEND_ACC_FINAL; }
     726          26 : ;
     727             : 
     728             : property_list:
     729          41 :                 property_list ',' property { $$ = zend_ast_list_add($1, $3); }
     730          41 :         |       property { $$ = zend_ast_create_list(1, ZEND_AST_PROP_DECL, $1); }
     731        2323 : ;
     732             : 
     733             : property:
     734        1132 :                 T_VARIABLE { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, NULL); }
     735        1132 :         |       T_VARIABLE '=' expr
     736        1232 :                         { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, $3); }
     737        1232 : ;
     738             : 
     739             : class_const_list:
     740           3 :                 class_const_list ',' const_decl { $$ = zend_ast_list_add($1, $3); }
     741           3 :         |       const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CLASS_CONST_DECL, $1); }
     742         245 : ;
     743             : 
     744             : const_decl:
     745         445 :         T_STRING '=' expr { $$ = zend_ast_create(ZEND_AST_CONST_ELEM, $1, $3); }
     746         445 : ;
     747             : 
     748             : echo_expr_list:
     749        1411 :                 echo_expr_list ',' echo_expr { $$ = zend_ast_list_add($1, $3); }
     750        1411 :         |       echo_expr { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     751       29967 : ;
     752             : echo_expr:
     753       31378 :         expr { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     754       31378 : ;
     755             : 
     756             : for_exprs:
     757           7 :                 /* empty */                     { $$ = NULL; }
     758           7 :         |       non_empty_for_exprs     { $$ = $1; }
     759        6128 : ;
     760             : 
     761             : non_empty_for_exprs:
     762           7 :                 non_empty_for_exprs ',' expr { $$ = zend_ast_list_add($1, $3); }
     763           7 :         |       expr { $$ = zend_ast_create_list(1, ZEND_AST_EXPR_LIST, $1); }
     764        6128 : ;
     765             : 
     766             : new_expr:
     767             :                 T_NEW class_name_reference ctor_arguments
     768       14326 :                         { $$ = zend_ast_create(ZEND_AST_NEW, $2, $3); }
     769       14326 : ;
     770             : 
     771             : expr_without_variable:
     772             :                 T_LIST '(' assignment_list ')' '=' expr
     773         152 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $3, $6); }
     774         152 :         |       variable '=' expr
     775      133988 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $1, $3); }
     776      133988 :         |       variable '=' '&' variable
     777         415 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
     778         415 :         |       T_CLONE expr { $$ = zend_ast_create(ZEND_AST_CLONE, $2); }
     779         116 :         |       variable T_PLUS_EQUAL expr
     780        1388 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_ADD, $1, $3); }
     781         694 :         |       variable T_MINUS_EQUAL expr
     782         278 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SUB, $1, $3); }
     783         139 :         |       variable T_MUL_EQUAL expr
     784          32 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MUL, $1, $3); }
     785          16 :         |       variable T_POW_EQUAL expr
     786           4 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_POW, $1, $3); }
     787           2 :         |       variable T_DIV_EQUAL expr
     788          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_DIV, $1, $3); }
     789           5 :         |       variable T_CONCAT_EQUAL expr
     790        5454 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_CONCAT, $1, $3); }
     791        2727 :         |       variable T_MOD_EQUAL expr
     792          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MOD, $1, $3); }
     793           5 :         |       variable T_AND_EQUAL expr
     794          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_AND, $1, $3); }
     795           5 :         |       variable T_OR_EQUAL expr
     796         196 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_OR, $1, $3); }
     797          98 :         |       variable T_XOR_EQUAL expr
     798           8 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_XOR, $1, $3); }
     799           4 :         |       variable T_SL_EQUAL expr
     800          14 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SL, $1, $3); }
     801           7 :         |       variable T_SR_EQUAL expr
     802          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SR, $1, $3); }
     803           5 :         |       variable T_INC { $$ = zend_ast_create(ZEND_AST_POST_INC, $1); }
     804        5562 :         |       T_INC variable { $$ = zend_ast_create(ZEND_AST_PRE_INC, $2); }
     805         532 :         |       variable T_DEC { $$ = zend_ast_create(ZEND_AST_POST_DEC, $1); }
     806          75 :         |       T_DEC variable { $$ = zend_ast_create(ZEND_AST_PRE_DEC, $2); }
     807          14 :         |       expr T_BOOLEAN_OR expr
     808        4324 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     809        4324 :         |       expr T_BOOLEAN_AND expr
     810        6762 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     811        6762 :         |       expr T_LOGICAL_OR expr
     812         908 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     813         908 :         |       expr T_LOGICAL_AND expr
     814          14 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     815          14 :         |       expr T_LOGICAL_XOR expr
     816           4 :                         { $$ = zend_ast_create_binary_op(ZEND_BOOL_XOR, $1, $3); }
     817         682 :         |       expr '|' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_OR, $1, $3); }
     818        1893 :         |       expr '&' expr       { $$ = zend_ast_create_binary_op(ZEND_BW_AND, $1, $3); }
     819        1237 :         |       expr '^' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_XOR, $1, $3); }
     820       33048 :         |       expr '.' expr   { $$ = zend_ast_create_binary_op(ZEND_CONCAT, $1, $3); }
     821       36646 :         |       expr '+' expr   { $$ = zend_ast_create_binary_op(ZEND_ADD, $1, $3); }
     822        4749 :         |       expr '-' expr   { $$ = zend_ast_create_binary_op(ZEND_SUB, $1, $3); }
     823        3970 :         |       expr '*' expr   { $$ = zend_ast_create_binary_op(ZEND_MUL, $1, $3); }
     824        2854 :         |       expr T_POW expr { $$ = zend_ast_create_binary_op(ZEND_POW, $1, $3); }
     825         536 :         |       expr '/' expr   { $$ = zend_ast_create_binary_op(ZEND_DIV, $1, $3); }
     826         650 :         |       expr '%' expr   { $$ = zend_ast_create_binary_op(ZEND_MOD, $1, $3); }
     827         261 :         |       expr T_SL expr  { $$ = zend_ast_create_binary_op(ZEND_SL, $1, $3); }
     828         205 :         |       expr T_SR expr  { $$ = zend_ast_create_binary_op(ZEND_SR, $1, $3); }
     829          69 :         |       '+' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_PLUS, $2); }
     830         249 :         |       '-' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_MINUS, $2); }
     831        6290 :         |       '!' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BOOL_NOT, $2); }
     832       29436 :         |       '~' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BW_NOT, $2); }
     833          97 :         |       expr T_IS_IDENTICAL expr
     834       11752 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_IDENTICAL, $1, $3); }
     835        5876 :         |       expr T_IS_NOT_IDENTICAL expr
     836       13688 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_IDENTICAL, $1, $3); }
     837        6844 :         |       expr T_IS_EQUAL expr
     838       32542 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_EQUAL, $1, $3); }
     839       16271 :         |       expr T_IS_NOT_EQUAL expr
     840        5714 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_EQUAL, $1, $3); }
     841        2857 :         |       expr '<' expr
     842        3772 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER, $1, $3); }
     843        1886 :         |       expr T_IS_SMALLER_OR_EQUAL expr
     844        3494 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER_OR_EQUAL, $1, $3); }
     845        1747 :         |       expr '>' expr
     846         883 :                         { $$ = zend_ast_create(ZEND_AST_GREATER, $1, $3); }
     847         883 :         |       expr T_IS_GREATER_OR_EQUAL expr
     848         460 :                         { $$ = zend_ast_create(ZEND_AST_GREATER_EQUAL, $1, $3); }
     849         460 :         |       expr T_INSTANCEOF class_name_reference
     850          65 :                         { $$ = zend_ast_create(ZEND_AST_INSTANCEOF, $1, $3); }
     851          65 :         |       '(' expr ')' { $$ = $2; }
     852       26962 :         |       new_expr { $$ = $1; }
     853       14326 :         |       expr '?' expr ':' expr
     854       27346 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, $3, $5); }
     855       27346 :         |       expr '?' ':' expr
     856         186 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, NULL, $4); }
     857         186 :         |       expr T_COALESCE expr
     858          16 :                         { $$ = zend_ast_create(ZEND_AST_COALESCE, $1, $3); }
     859          16 :         |       internal_functions_in_yacc { $$ = $1; }
     860       29236 :         |       T_INT_CAST expr         { $$ = zend_ast_create_cast(IS_LONG, $2); }
     861        4989 :         |       T_DOUBLE_CAST expr      { $$ = zend_ast_create_cast(IS_DOUBLE, $2); }
     862        1341 :         |       T_STRING_CAST expr      { $$ = zend_ast_create_cast(IS_STRING, $2); }
     863        1335 :         |       T_ARRAY_CAST expr       { $$ = zend_ast_create_cast(IS_ARRAY, $2); }
     864         190 :         |       T_OBJECT_CAST expr      { $$ = zend_ast_create_cast(IS_OBJECT, $2); }
     865         243 :         |       T_BOOL_CAST expr        { $$ = zend_ast_create_cast(_IS_BOOL, $2); }
     866          73 :         |       T_UNSET_CAST expr       { $$ = zend_ast_create_cast(IS_NULL, $2); }
     867           0 :         |       T_EXIT exit_expr        { $$ = zend_ast_create(ZEND_AST_EXIT, $2); }
     868       14763 :         |       '@' expr                        { $$ = zend_ast_create(ZEND_AST_SILENCE, $2); }
     869        5557 :         |       scalar { $$ = $1; }
     870      660643 :         |       '`' backticks_expr '`' { $$ = zend_ast_create(ZEND_AST_SHELL_EXEC, $2); }
     871         113 :         |       T_PRINT expr { $$ = zend_ast_create(ZEND_AST_PRINT, $2); }
     872        3402 :         |       T_YIELD { $$ = zend_ast_create(ZEND_AST_YIELD, NULL, NULL); }
     873          37 :         |       T_YIELD expr { $$ = zend_ast_create(ZEND_AST_YIELD, $2, NULL); }
     874          78 :         |       T_YIELD expr T_DOUBLE_ARROW expr { $$ = zend_ast_create(ZEND_AST_YIELD, $4, $2); }
     875          29 :         |       function returns_ref '(' parameter_list ')' lexical_vars return_type
     876             :                 backup_doc_comment '{' inner_statement_list '}'
     877        1900 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $2, $1, $8,
     878             :                                   zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     879        1520 :                               $4, $6, $10, $7); }
     880         380 :         |       T_STATIC function returns_ref '(' parameter_list ')' lexical_vars
     881             :                 return_type backup_doc_comment '{' inner_statement_list '}'
     882          55 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $3 | ZEND_ACC_STATIC, $2, $9,
     883             :                               zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     884          44 :                               $5, $7, $11, $8); }
     885          11 : ;
     886             : 
     887             : function:
     888       35839 :         T_FUNCTION { $$ = CG(zend_lineno); }
     889       35839 : ;
     890             : 
     891             : backup_doc_comment:
     892       43204 :         /* empty */ { $$ = CG(doc_comment); CG(doc_comment) = NULL; }
     893       43204 : ;
     894             : 
     895             : returns_ref:
     896       35769 :                 /* empty */     { $$ = 0; }
     897       35769 :         |       '&'                 { $$ = ZEND_ACC_RETURN_REFERENCE; }
     898          70 : ;
     899             : 
     900             : lexical_vars:
     901         235 :                 /* empty */ { $$ = NULL; }
     902         235 :         |       T_USE '(' lexical_var_list ')' { $$ = $3; }
     903         156 : ;
     904             : 
     905             : lexical_var_list:
     906           7 :                 lexical_var_list ',' lexical_var { $$ = zend_ast_list_add($1, $3); }
     907           7 :         |       lexical_var { $$ = zend_ast_create_list(1, ZEND_AST_CLOSURE_USES, $1); }
     908         156 : ;
     909             : 
     910             : lexical_var:
     911         136 :                 T_VARIABLE              { $$ = $1; }
     912         136 :         |       '&' T_VARIABLE      { $$ = $2; $$->attr = 1; }
     913          27 : ;
     914             : 
     915             : function_call:
     916             :                 name argument_list
     917      257805 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
     918      257805 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
     919       10311 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
     920       10311 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
     921          40 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
     922          40 :         |       callable_expr argument_list
     923        2088 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
     924        2088 : ;
     925             : 
     926             : class_name:
     927             :                 T_STATIC
     928         122 :                         { zval zv; ZVAL_STRINGL(&zv, "static", sizeof("static")-1);
     929          61 :                           $$ = zend_ast_create_zval_ex(&zv, ZEND_NAME_NOT_FQ); }
     930          61 :         |       name { $$ = $1; }
     931       33347 : ;
     932             : 
     933             : class_name_reference:
     934       13241 :                 class_name              { $$ = $1; }
     935       13241 :         |       new_variable    { $$ = $1; }
     936        1150 : ;
     937             : 
     938             : exit_expr:
     939         407 :                 /* empty */                             { $$ = NULL; }
     940         407 :         |       '(' optional_expr ')'   { $$ = $2; }
     941       14356 : ;
     942             : 
     943             : backticks_expr:
     944             :                 /* empty */
     945           0 :                         { $$ = zend_ast_create_zval_from_str(STR_EMPTY_ALLOC()); }
     946           0 :         |       T_ENCAPSED_AND_WHITESPACE { $$ = $1; }
     947           7 :         |       encaps_list { $$ = $1; }
     948         106 : ;
     949             : 
     950             : 
     951             : ctor_arguments:
     952        2687 :                 /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
     953        2687 :         |       argument_list { $$ = $1; }
     954       11639 : ;
     955             : 
     956             : 
     957             : dereferencable_scalar:
     958       25176 :                 T_ARRAY '(' array_pair_list ')' { $$ = $3; }
     959       25176 :         |       '[' array_pair_list ']'                 { $$ = $2; }
     960         709 :         |       T_CONSTANT_ENCAPSED_STRING              { $$ = $1; }
     961      353567 : ;
     962             : 
     963             : scalar:
     964      162149 :                 T_LNUMBER       { $$ = $1; }
     965      162149 :         |       T_DNUMBER       { $$ = $1; }
     966        6762 :         |       T_LINE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_LINE); }
     967          15 :         |       T_FILE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FILE); }
     968        7379 :         |       T_DIR           { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_DIR); }
     969         467 :         |       T_TRAIT_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_TRAIT_C); }
     970           5 :         |       T_METHOD_C      { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_METHOD_C); }
     971         753 :         |       T_FUNC_C        { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FUNC_C); }
     972         114 :         |       T_NS_C          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_NS_C); }
     973          36 :         |       T_CLASS_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C); }
     974          83 :         |       T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = $2; }
     975        1363 :         |       T_START_HEREDOC T_END_HEREDOC
     976         118 :                         { $$ = zend_ast_create_zval_from_str(STR_EMPTY_ALLOC()); }
     977          59 :         |       '"' encaps_list '"'   { $$ = $2; }
     978       13329 :         |       T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; }
     979         141 :         |       dereferencable_scalar   { $$ = $1; }
     980      379423 :         |       class_name_scalar       { $$ = $1; }
     981          30 :         |       constant                        { $$ = $1; }
     982       88535 : ;
     983             : 
     984             : constant:
     985       79336 :                 name { $$ = zend_ast_create(ZEND_AST_CONST, $1); }
     986       79336 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING
     987        9207 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
     988        9207 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING
     989           5 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
     990           5 : ;
     991             : 
     992             : possible_comma:
     993             :                 /* empty */
     994             :         |       ','
     995             : ;
     996             : 
     997             : expr:
     998      708108 :                 variable                                        { $$ = $1; }
     999      708108 :         |       expr_without_variable           { $$ = $1; }
    1000     1057620 : ;
    1001             : 
    1002             : optional_expr:
    1003        2890 :                 /* empty */     { $$ = NULL; }
    1004        2890 :         |       expr            { $$ = $1; }
    1005      182211 : ;
    1006             : 
    1007             : variable_class_name:
    1008          57 :         dereferencable { $$ = $1; }
    1009          57 : ;
    1010             : 
    1011             : dereferencable:
    1012      169378 :                 variable                                { $$ = $1; }
    1013      169378 :         |       '(' expr ')'                    { $$ = $2; }
    1014          40 :         |       dereferencable_scalar   { $$ = $1; }
    1015          25 : ;
    1016             : 
    1017             : callable_expr:
    1018        2080 :                 callable_variable               { $$ = $1; }
    1019        2080 :         |       '(' expr ')'                    { $$ = $2; }
    1020           4 :         |       dereferencable_scalar   { $$ = $1; }
    1021           4 : ;
    1022             : 
    1023             : callable_variable:
    1024             :                 simple_variable
    1025      602090 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1026      602090 :         |       dereferencable '[' optional_expr ']'
    1027      124011 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1028      124011 :         |       constant '[' optional_expr ']'
    1029          12 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1030          12 :         |       dereferencable '{' expr '}'
    1031          21 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1032          21 :         |       dereferencable T_OBJECT_OPERATOR member_name argument_list
    1033       35018 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_CALL, $1, $3, $4); }
    1034       35018 :         |       function_call { $$ = $1; }
    1035      270244 : ;
    1036             : 
    1037             : variable:
    1038             :                 callable_variable
    1039     1029316 :                         { $$ = $1; }
    1040     1029316 :         |       static_member
    1041         630 :                         { $$ = $1; }
    1042         630 :         |       dereferencable T_OBJECT_OPERATOR member_name
    1043       10336 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1044       10336 : ;
    1045             : 
    1046             : simple_variable:
    1047      609328 :                 T_VARIABLE                      { $$ = $1; }
    1048      609328 :         |       '$' '{' expr '}'        { $$ = $3; }
    1049          35 :         |       '$' simple_variable     { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1050         159 : ;
    1051             : 
    1052             : static_member:
    1053             :                 class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1054         618 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1055         618 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1056          12 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1057          12 : ;
    1058             : 
    1059             : new_variable:
    1060             :                 simple_variable
    1061        1149 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1062        1149 :         |       new_variable '[' optional_expr ']'
    1063          11 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1064          11 :         |       new_variable '{' expr '}'
    1065           1 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1066           1 :         |       new_variable T_OBJECT_OPERATOR member_name
    1067           4 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1068           4 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1069           1 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1070           1 :         |       new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1071           2 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1072           2 : ;
    1073             : 
    1074             : member_name:
    1075       55431 :                 T_STRING                { $$ = $1; }
    1076       55431 :         |       '{' expr '}'    { $$ = $2; }
    1077          73 :         |       simple_variable { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1078         205 : ;
    1079             : 
    1080             : assignment_list:
    1081             :                 assignment_list ',' assignment_list_element
    1082         234 :                         { $$ = zend_ast_list_add($1, $3); }
    1083         234 :         |       assignment_list_element
    1084         178 :                         { $$ = zend_ast_create_list(1, ZEND_AST_LIST, $1); }
    1085         178 : ;
    1086             : 
    1087             : assignment_list_element:
    1088         363 :                 variable                                                { $$ = $1; }
    1089         363 :         |       T_LIST '(' assignment_list ')'  { $$ = $3; }
    1090          17 :         |       /* empty */                                             { $$ = NULL; }
    1091          32 : ;
    1092             : 
    1093             : 
    1094             : array_pair_list:
    1095        3373 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_ARRAY); }
    1096        3373 :         |       non_empty_array_pair_list possible_comma { $$ = $1; }
    1097       22512 : ;
    1098             : 
    1099             : non_empty_array_pair_list:
    1100             :                 non_empty_array_pair_list ',' array_pair
    1101       75525 :                         { $$ = zend_ast_list_add($1, $3); }
    1102       75525 :         |       array_pair
    1103       22512 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARRAY, $1); }
    1104       22512 : ;
    1105             : 
    1106             : array_pair:
    1107             :                 expr T_DOUBLE_ARROW expr
    1108       27451 :                         { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $3, $1); }
    1109       27451 :         |       expr { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $1, NULL); }
    1110       70432 :         |       expr T_DOUBLE_ARROW '&' variable
    1111          61 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $4, $1); }
    1112          61 :         |       '&' variable
    1113          93 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $2, NULL); }
    1114          93 : ;
    1115             : 
    1116             : encaps_list:
    1117             :                 encaps_list encaps_var
    1118        6437 :                         { $$ = zend_ast_list_add($1, $2); }
    1119        6437 :         |       encaps_list T_ENCAPSED_AND_WHITESPACE
    1120       15333 :                         { $$ = zend_ast_list_add($1, $2); }
    1121       15333 :         |       encaps_var
    1122        4352 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ENCAPS_LIST, $1); }
    1123        4352 :         |       T_ENCAPSED_AND_WHITESPACE encaps_var
    1124        9225 :                         { $$ = zend_ast_create_list(2, ZEND_AST_ENCAPS_LIST, $1, $2); }
    1125        9225 : ;
    1126             : 
    1127             : encaps_var:
    1128             :                 T_VARIABLE
    1129       17364 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1130       17364 :         |       T_VARIABLE '[' encaps_var_offset ']'
    1131        1950 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1132        1950 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1133         975 :         |       T_VARIABLE T_OBJECT_OPERATOR T_STRING
    1134         164 :                         { $$ = zend_ast_create(ZEND_AST_PROP,
    1135          82 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1136          82 :         |       T_DOLLAR_OPEN_CURLY_BRACES expr '}'
    1137           1 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1138           1 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}'
    1139         367 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1140         367 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}'
    1141           0 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1142           0 :                               zend_ast_create(ZEND_AST_VAR, $2), $4); }
    1143           0 :         |       T_CURLY_OPEN variable '}' { $$ = $2; }
    1144        1225 : ;
    1145             : 
    1146             : encaps_var_offset:
    1147           4 :                 T_STRING                { $$ = $1; }
    1148           4 :         |       T_NUM_STRING    { $$ = $1; }
    1149         383 :         |       T_VARIABLE              { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1150         588 : ;
    1151             : 
    1152             : 
    1153             : internal_functions_in_yacc:
    1154        5497 :                 T_ISSET '(' isset_variables ')' { $$ = $3; }
    1155        5497 :         |       T_EMPTY '(' expr ')' { $$ = zend_ast_create(ZEND_AST_EMPTY, $3); }
    1156        7803 :         |       T_INCLUDE expr
    1157        1937 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE, $2); }
    1158        1937 :         |       T_INCLUDE_ONCE expr
    1159         528 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE_ONCE, $2); }
    1160         528 :         |       T_EVAL '(' expr ')'
    1161        1923 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_EVAL, $3); }
    1162        1923 :         |       T_REQUIRE expr
    1163         798 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE, $2); }
    1164         798 :         |       T_REQUIRE_ONCE expr
    1165        5787 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE_ONCE, $2); }
    1166        5787 : ;
    1167             : 
    1168             : isset_variables:
    1169        5497 :                 isset_variable { $$ = $1; }
    1170        5497 :         |       isset_variables ',' isset_variable
    1171          44 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
    1172          44 : ;
    1173             : 
    1174             : isset_variable:
    1175        5541 :                 expr { $$ = zend_ast_create(ZEND_AST_ISSET, $1); }
    1176        5541 : ;
    1177             : 
    1178             : class_name_scalar:
    1179             :         class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS
    1180          30 :                 { $$ = zend_ast_create(ZEND_AST_RESOLVE_CLASS_NAME, $1); }
    1181             : ;
    1182             : 
    1183             : %%
    1184             : 
    1185             : /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
    1186             :    quotes and backslashes, so that it's suitable for yyerror.  The
    1187             :    heuristic is that double-quoting is unnecessary unless the string
    1188             :    contains an apostrophe, a comma, or backslash (other than
    1189             :    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
    1190             :    null, do not copy; instead, return the length of what the result
    1191             :    would have been.  */
    1192         313 : static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
    1193             : {
    1194         313 :         if (!yyres) {
    1195         238 :                 return yystrlen(yystr);
    1196             :         }
    1197             :         {
    1198          75 :                         if (CG(parse_error) == 0) {
    1199             :                         char buffer[120];
    1200          37 :                         const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
    1201          37 :                         unsigned int len = 0, toklen = 0, yystr_len;
    1202             : 
    1203          37 :                         CG(parse_error) = 1;
    1204             : 
    1205          47 :                         if (LANG_SCNG(yy_text)[0] == 0 &&
    1206           5 :                                 LANG_SCNG(yy_leng) == 1 &&
    1207           5 :                                 memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
    1208           5 :                                 yystpcpy(yyres, "end of file");
    1209           5 :                                 return sizeof("end of file")-1;
    1210             :                         }
    1211             : 
    1212          32 :                         str = LANG_SCNG(yy_text);
    1213          32 :                         end = memchr(str, '\n', LANG_SCNG(yy_leng));
    1214          32 :                         yystr_len = (unsigned int)yystrlen(yystr);
    1215             : 
    1216          78 :                         if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
    1217          23 :                                 && (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
    1218          23 :                                 toklen = (tok2 - tok1) + 1;
    1219             :                         } else {
    1220           9 :                                 tok1 = tok2 = NULL;
    1221           9 :                                 toklen = 0;
    1222             :                         }
    1223             : 
    1224          32 :                         if (end == NULL) {
    1225          31 :                                 len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
    1226             :                         } else {
    1227           1 :                                 len = (end - str) > 30 ? 30 : (end - str);
    1228             :                         }
    1229          32 :                         if (toklen) {
    1230          23 :                                 snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
    1231             :                         } else {
    1232           9 :                                 snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
    1233             :                         }
    1234          32 :                         yystpcpy(yyres, buffer);
    1235          32 :                         return len + (toklen ? toklen + 1 : 0) + 2;
    1236             :                 }
    1237             :         }
    1238          38 :         if (*yystr == '"') {
    1239          20 :                 YYSIZE_T yyn = 0;
    1240          20 :                 const char *yyp = yystr;
    1241             : 
    1242         428 :                 for (; *++yyp != '"'; ++yyn) {
    1243         408 :                         yyres[yyn] = *yyp;
    1244             :                 }
    1245          20 :                 yyres[yyn] = '\0';
    1246          20 :                 return yyn;
    1247             :         }
    1248          18 :         yystpcpy(yyres, yystr);
    1249          18 :         return strlen(yystr);
    1250             : }
    1251             : 
    1252             : /*
    1253             :  * Local variables:
    1254             :  * tab-width: 4
    1255             :  * c-basic-offset: 4
    1256             :  * indent-tabs-mode: t
    1257             :  * End:
    1258             :  */

Generated by: LCOV version 1.10

Generated at Sun, 29 Mar 2015 03:45:47 +0000 (3 days ago)

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