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: 640 653 98.0 %
Date: 2014-09-27 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             : %left T_BOOLEAN_OR
      71             : %left T_BOOLEAN_AND 
      72             : %left '|'
      73             : %left '^'
      74             : %left '&'
      75             : %nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL
      76             : %nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
      77             : %left T_SL T_SR
      78             : %left '+' '-' '.'
      79             : %left '*' '/' '%'
      80             : %right '!'
      81             : %nonassoc T_INSTANCEOF
      82             : %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 '@'
      83             : %right T_POW
      84             : %right '['
      85             : %nonassoc T_NEW T_CLONE
      86             : %left T_ELSEIF
      87             : %left T_ELSE 
      88             : %left T_ENDIF 
      89             : %right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC
      90             : %right T_DOUBLE_ARROW
      91             : 
      92             : %token <ast> T_LNUMBER   "integer number (T_LNUMBER)"
      93             : %token <ast> T_DNUMBER   "floating-point number (T_DNUMBER)"
      94             : %token <ast> T_STRING    "identifier (T_STRING)"
      95             : %token <ast> T_VARIABLE  "variable (T_VARIABLE)"
      96             : %token <ast> T_INLINE_HTML
      97             : %token <ast> T_ENCAPSED_AND_WHITESPACE  "quoted-string and whitespace (T_ENCAPSED_AND_WHITESPACE)"
      98             : %token <ast> T_CONSTANT_ENCAPSED_STRING "quoted-string (T_CONSTANT_ENCAPSED_STRING)"
      99             : %token <ast> T_STRING_VARNAME "variable name (T_STRING_VARNAME)"
     100             : %token <ast> T_NUM_STRING "number (T_NUM_STRING)"
     101             : 
     102             : %token END 0 "end of file"
     103             : %token T_INCLUDE      "include (T_INCLUDE)"
     104             : %token T_INCLUDE_ONCE "include_once (T_INCLUDE_ONCE)"
     105             : %token T_EVAL         "eval (T_EVAL)"
     106             : %token T_REQUIRE      "require (T_REQUIRE)"
     107             : %token T_REQUIRE_ONCE "require_once (T_REQUIRE_ONCE)"
     108             : %token T_LOGICAL_OR   "or (T_LOGICAL_OR)"
     109             : %token T_LOGICAL_XOR  "xor (T_LOGICAL_XOR)"
     110             : %token T_LOGICAL_AND  "and (T_LOGICAL_AND)"
     111             : %token T_PRINT        "print (T_PRINT)"
     112             : %token T_YIELD        "yield (T_YIELD)"
     113             : %token T_PLUS_EQUAL   "+= (T_PLUS_EQUAL)"
     114             : %token T_MINUS_EQUAL  "-= (T_MINUS_EQUAL)"
     115             : %token T_MUL_EQUAL    "*= (T_MUL_EQUAL)"
     116             : %token T_DIV_EQUAL    "/= (T_DIV_EQUAL)"
     117             : %token T_CONCAT_EQUAL ".= (T_CONCAT_EQUAL)"
     118             : %token T_MOD_EQUAL    "%= (T_MOD_EQUAL)"
     119             : %token T_AND_EQUAL    "&= (T_AND_EQUAL)"
     120             : %token T_OR_EQUAL     "|= (T_OR_EQUAL)"
     121             : %token T_XOR_EQUAL    "^= (T_XOR_EQUAL)"
     122             : %token T_SL_EQUAL     "<<= (T_SL_EQUAL)"
     123             : %token T_SR_EQUAL     ">>= (T_SR_EQUAL)"
     124             : %token T_BOOLEAN_OR   "|| (T_BOOLEAN_OR)"
     125             : %token T_BOOLEAN_AND  "&& (T_BOOLEAN_AND)"
     126             : %token T_IS_EQUAL     "== (T_IS_EQUAL)"
     127             : %token T_IS_NOT_EQUAL "!= (T_IS_NOT_EQUAL)"
     128             : %token T_IS_IDENTICAL "=== (T_IS_IDENTICAL)"
     129             : %token T_IS_NOT_IDENTICAL "!== (T_IS_NOT_IDENTICAL)"
     130             : %token T_IS_SMALLER_OR_EQUAL "<= (T_IS_SMALLER_OR_EQUAL)"
     131             : %token T_IS_GREATER_OR_EQUAL ">= (T_IS_GREATER_OR_EQUAL)"
     132             : %token T_SL "<< (T_SL)"
     133             : %token T_SR ">> (T_SR)"
     134             : %token T_INSTANCEOF  "instanceof (T_INSTANCEOF)"
     135             : %token T_INC "++ (T_INC)"
     136             : %token T_DEC "-- (T_DEC)"
     137             : %token T_INT_CAST    "(int) (T_INT_CAST)"
     138             : %token T_DOUBLE_CAST "(double) (T_DOUBLE_CAST)"
     139             : %token T_STRING_CAST "(string) (T_STRING_CAST)"
     140             : %token T_ARRAY_CAST  "(array) (T_ARRAY_CAST)"
     141             : %token T_OBJECT_CAST "(object) (T_OBJECT_CAST)"
     142             : %token T_BOOL_CAST   "(bool) (T_BOOL_CAST)"
     143             : %token T_UNSET_CAST  "(unset) (T_UNSET_CAST)"
     144             : %token T_NEW       "new (T_NEW)"
     145             : %token T_CLONE     "clone (T_CLONE)"
     146             : %token T_EXIT      "exit (T_EXIT)"
     147             : %token T_IF        "if (T_IF)"
     148             : %token T_ELSEIF    "elseif (T_ELSEIF)"
     149             : %token T_ELSE      "else (T_ELSE)"
     150             : %token T_ENDIF     "endif (T_ENDIF)"
     151             : %token T_CHARACTER
     152             : %token T_BAD_CHARACTER
     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_POW             "** (T_POW)"
     225             : %token T_POW_EQUAL       "**= (T_POW_EQUAL)"
     226             : 
     227             : %type <ast> top_statement namespace_name name statement function_declaration_statement
     228             : %type <ast> class_declaration_statement use_declaration const_decl inner_statement
     229             : %type <ast> expr optional_expr while_statement for_statement foreach_variable
     230             : %type <ast> foreach_statement declare_statement finally_statement unset_variable variable
     231             : %type <ast> extends_from parameter optional_type argument expr_without_variable global_var
     232             : %type <ast> static_var class_statement trait_adaptation trait_precedence trait_alias
     233             : %type <ast> absolute_trait_method_reference trait_method_reference property echo_expr
     234             : %type <ast> new_expr class_name class_name_reference simple_variable internal_functions_in_yacc
     235             : %type <ast> exit_expr scalar backticks_expr lexical_var function_call member_name
     236             : %type <ast> variable_class_name dereferencable_scalar class_name_scalar constant dereferencable
     237             : %type <ast> callable_expr callable_variable static_member new_variable
     238             : %type <ast> assignment_list_element array_pair encaps_var encaps_var_offset isset_variables
     239             : %type <ast> isset_variable
     240             : %type <ast> top_statement_list use_declarations const_list inner_statement_list if_stmt
     241             : %type <ast> alt_if_stmt for_exprs switch_case_list global_var_list static_var_list
     242             : %type <ast> echo_expr_list unset_variables catch_list parameter_list class_statement_list
     243             : %type <ast> implements_list interface_extends_list case_list if_stmt_without_else
     244             : %type <ast> non_empty_parameter_list argument_list non_empty_argument_list property_list
     245             : %type <ast> class_const_list name_list trait_adaptations method_body non_empty_for_exprs
     246             : %type <ast> ctor_arguments alt_if_stmt_without_else trait_adaptation_list lexical_vars
     247             : %type <ast> lexical_var_list encaps_list array_pair_list non_empty_array_pair_list
     248             : %type <ast> assignment_list
     249             : 
     250             : %type <num> returns_ref function is_reference is_variadic class_type variable_modifiers
     251             : %type <num> method_modifiers trait_modifiers non_empty_member_modifiers member_modifier
     252             : 
     253             : %type <str> backup_doc_comment
     254             : 
     255             : %% /* Rules */
     256             : 
     257             : start:
     258       29366 :         top_statement_list      { CG(ast) = $1; }
     259       29366 : ;
     260             : 
     261             : top_statement_list:
     262      213729 :                 top_statement_list top_statement { $$ = zend_ast_list_add($1, $2); }
     263      213729 :         |       /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     264       29496 : ;
     265             : 
     266             : namespace_name:
     267      368686 :                 T_STRING                                                                { $$ = $1; }
     268      368686 :         |       namespace_name T_NS_SEPARATOR T_STRING  { $$ = zend_ast_append_str($1, $3); }
     269         350 : ;
     270             : 
     271             : name:
     272      368175 :                 namespace_name                                                          { $$ = $1; $$->attr = ZEND_NAME_NOT_FQ; }
     273      368175 :         |       T_NAMESPACE T_NS_SEPARATOR namespace_name       { $$ = $3; $$->attr = ZEND_NAME_RELATIVE; }
     274          49 :         |       T_NS_SEPARATOR namespace_name                           { $$ = $2; $$->attr = ZEND_NAME_FQ; }
     275         194 : ;
     276             : 
     277             : top_statement:
     278      193359 :                 statement                                               { $$ = $1; }
     279      193359 :         |       function_declaration_statement  { $$ = $1; }
     280       13313 :         |       class_declaration_statement             { $$ = $1; }
     281        6330 :         |       T_HALT_COMPILER '(' ')' ';'
     282         550 :                         { $$ = zend_ast_create(ZEND_AST_HALT_COMPILER,
     283         275 :                               zend_ast_create_zval_from_long(zend_get_scanned_file_offset(TSRMLS_C)));
     284         275 :                           zend_stop_lexing(TSRMLS_C); }
     285         275 :         |       T_NAMESPACE namespace_name ';'
     286         131 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, NULL);
     287         131 :                           RESET_DOC_COMMENT(); }
     288         132 :         |       T_NAMESPACE namespace_name { RESET_DOC_COMMENT(); }
     289          44 :                 '{' top_statement_list '}'
     290          42 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, $5); }
     291          42 :         |       T_NAMESPACE { RESET_DOC_COMMENT(); }
     292          33 :                 '{' top_statement_list '}'
     293          33 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, NULL, $4); }
     294          33 :         |       T_USE use_declarations ';'                              { $$ = $2; $$->attr = T_CLASS; }
     295          54 :         |       T_USE T_FUNCTION use_declarations ';'   { $$ = $3; $$->attr = T_FUNCTION; }
     296          17 :         |       T_USE T_CONST use_declarations ';'              { $$ = $3; $$->attr = T_CONST; }
     297          14 :         |       T_CONST const_list ';'                                  { $$ = $2; }
     298         161 : ;
     299             : 
     300             : use_declarations:
     301             :                 use_declarations ',' use_declaration
     302           8 :                         { $$ = zend_ast_list_add($1, $3); }
     303           8 :         |       use_declaration
     304          85 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     305          85 : ;
     306             : 
     307             : use_declaration:
     308             :                 namespace_name
     309          35 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, NULL); }
     310          35 :         |       namespace_name T_AS T_STRING
     311          44 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, $3); }
     312          44 :         |       T_NS_SEPARATOR namespace_name
     313          10 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $2, NULL); }
     314          10 :         |       T_NS_SEPARATOR namespace_name T_AS T_STRING
     315           4 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $2, $4); }
     316           4 : ;
     317             : 
     318             : const_list:
     319           1 :                 const_list ',' const_decl { $$ = zend_ast_list_add($1, $3); }
     320           1 :         |       const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CONST_DECL, $1); }
     321         186 : ;
     322             : 
     323             : inner_statement_list:
     324             :                 inner_statement_list inner_statement
     325      229167 :                         { $$ = zend_ast_list_add($1, $2); }
     326      229167 :         |       /* empty */
     327      109662 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     328      109662 : ;
     329             : 
     330             : 
     331             : inner_statement:
     332      223842 :                 statement { $$ = $1; }
     333      223842 :         |       function_declaration_statement { $$ = $1; }
     334        4393 :         |       class_declaration_statement { $$ = $1; }
     335         932 :         |       T_HALT_COMPILER '(' ')' ';'
     336           1 :                         { $$ = NULL; zend_error_noreturn(E_COMPILE_ERROR,
     337             :                               "__HALT_COMPILER() can only be used from the outermost scope"); }
     338             : ;
     339             : 
     340             : 
     341             : statement:
     342       68784 :                 '{' inner_statement_list '}' { $$ = $2; }
     343       68784 :         |       if_stmt { $$ = $1; }
     344       68206 :         |       alt_if_stmt { $$ = $1; }
     345           4 :         |       T_WHILE '(' expr ')' while_statement
     346        1860 :                         { $$ = zend_ast_create(ZEND_AST_WHILE, $3, $5); }
     347        1860 :         |       T_DO statement T_WHILE '(' expr ')' ';'
     348         289 :                         { $$ = zend_ast_create(ZEND_AST_DO_WHILE, $2, $5); }
     349         289 :         |       T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement
     350        1866 :                         { $$ = zend_ast_create(ZEND_AST_FOR, $3, $5, $7, $9); }
     351        1866 :         |       T_SWITCH '(' expr ')' switch_case_list
     352         449 :                         { $$ = zend_ast_create(ZEND_AST_SWITCH, $3, $5); }
     353         449 :         |       T_BREAK optional_expr ';'               { $$ = zend_ast_create(ZEND_AST_BREAK, $2); }
     354        1816 :         |       T_CONTINUE optional_expr ';'    { $$ = zend_ast_create(ZEND_AST_CONTINUE, $2); }
     355         268 :         |       T_RETURN optional_expr ';'              { $$ = zend_ast_create(ZEND_AST_RETURN, $2); }
     356       43554 :         |       T_GLOBAL global_var_list ';'    { $$ = $2; }
     357        4000 :         |       T_STATIC static_var_list ';'    { $$ = $2; }
     358        1866 :         |       T_ECHO echo_expr_list ';'               { $$ = $2; }
     359       28990 :         |       T_INLINE_HTML { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     360        3503 :         |       expr ';' { $$ = $1; }
     361      251393 :         |       T_UNSET '(' unset_variables ')' ';' { $$ = $3; }
     362        1462 :         |       T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement
     363        5096 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $5, NULL, $7); }
     364        5096 :         |       T_FOREACH '(' expr T_AS foreach_variable T_DOUBLE_ARROW foreach_variable ')'
     365             :                 foreach_statement
     366        4633 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $7, $5, $9); }
     367        4633 :         |       T_DECLARE '(' const_list ')'
     368          25 :                         { zend_handle_encoding_declaration($3 TSRMLS_CC); }
     369          23 :                 declare_statement
     370          23 :                         { $$ = zend_ast_create(ZEND_AST_DECLARE, $3, $6); }
     371          23 :         |       ';'     /* empty statement */ { $$ = NULL; }
     372       27369 :         |       T_TRY '{' inner_statement_list '}' catch_list finally_statement
     373        1987 :                         { $$ = zend_ast_create(ZEND_AST_TRY, $3, $5, $6); }
     374        1987 :         |       T_THROW expr ';' { $$ = zend_ast_create(ZEND_AST_THROW, $2); }
     375         314 :         |       T_GOTO T_STRING ';' { $$ = zend_ast_create(ZEND_AST_GOTO, $2); }
     376          36 :         |       T_STRING ':' { $$ = zend_ast_create(ZEND_AST_LABEL, $1); }
     377          37 : ;
     378             : 
     379             : catch_list:
     380             :                 /* empty */
     381        1987 :                         { $$ = zend_ast_create_list(0, ZEND_AST_CATCH_LIST); }
     382        1987 :         |       catch_list T_CATCH '(' name T_VARIABLE ')' '{' inner_statement_list '}'
     383        1953 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_CATCH, $4, $5, $8)); }
     384        1953 : ;
     385             : 
     386             : finally_statement:
     387        1917 :                 /* empty */ { $$ = NULL; }
     388        1917 :         |       T_FINALLY '{' inner_statement_list '}' { $$ = $3; }
     389          70 : ;
     390             : 
     391             : unset_variables:
     392        1462 :                 unset_variable { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     393        1462 :         |       unset_variables ',' unset_variable { $$ = zend_ast_list_add($1, $3); }
     394         110 : ;
     395             : 
     396             : unset_variable:
     397        1572 :                 variable { $$ = zend_ast_create(ZEND_AST_UNSET, $1); }
     398        1572 : ;
     399             : 
     400             : function_declaration_statement:
     401             :         function returns_ref T_STRING '(' parameter_list ')' backup_doc_comment
     402             :         '{' inner_statement_list '}'
     403       70824 :                 { $$ = zend_ast_create_decl(ZEND_AST_FUNC_DECL, $2, $1, $7,
     404       53118 :                       zend_ast_get_str($3), $5, NULL, $9); }
     405       17706 : ;
     406             : 
     407             : is_reference:
     408       81641 :                 /* empty */     { $$ = 0; }
     409       81641 :         |       '&'                 { $$ = ZEND_PARAM_REF; }
     410         956 : ;
     411             : 
     412             : is_variadic:
     413       82559 :                 /* empty */ { $$ = 0; }
     414       82559 :         |       T_ELLIPSIS  { $$ = ZEND_PARAM_VARIADIC; }
     415          38 : ;
     416             : 
     417             : class_declaration_statement:
     418        7095 :                 class_type { $<num>$ = CG(zend_lineno); }
     419        7095 :                 T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
     420       35380 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, $1, $<num>2, $6,
     421       28304 :                                   zend_ast_get_str($3), $4, $5, $8); }
     422        7076 :         |       T_INTERFACE { $<num>$ = CG(zend_lineno); }
     423         187 :                 T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}'
     424         744 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, ZEND_ACC_INTERFACE, $<num>2, $5,
     425         558 :                                   zend_ast_get_str($3), NULL, $4, $7); }
     426         186 : ;
     427             : 
     428             : class_type:
     429        6779 :                 T_CLASS                         { $$ = 0; }
     430        6779 :         |       T_ABSTRACT T_CLASS      { $$ = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
     431          92 :         |       T_FINAL T_CLASS         { $$ = ZEND_ACC_FINAL_CLASS; }
     432          15 :         |       T_TRAIT                         { $$ = ZEND_ACC_TRAIT; }
     433         209 : ;
     434             : 
     435             : extends_from:
     436        4770 :                 /* empty */             { $$ = NULL; }
     437        4770 :         |       T_EXTENDS name  { $$ = $2; }
     438        2323 : ;
     439             : 
     440             : interface_extends_list:
     441         151 :                 /* empty */                     { $$ = NULL; }
     442         151 :         |       T_EXTENDS name_list     { $$ = $2; }
     443          35 : ;
     444             : 
     445             : implements_list:
     446        6799 :                 /* empty */                             { $$ = NULL; }
     447        6799 :         |       T_IMPLEMENTS name_list  { $$ = $2; }
     448         293 : ;
     449             : 
     450             : foreach_variable:
     451       14274 :                 variable                        { $$ = $1; }
     452       14274 :         |       '&' variable                { $$ = zend_ast_create(ZEND_AST_REF, $2); }
     453          79 :         |       T_LIST '(' assignment_list ')' { $$ = $3; }
     454           9 : ;
     455             : 
     456             : for_statement:
     457        1863 :                 statement { $$ = $1; }
     458        1863 :         |       ':' inner_statement_list T_ENDFOR ';' { $$ = $2; }
     459           3 : ;
     460             : 
     461             : foreach_statement:
     462        9729 :                 statement { $$ = $1; }
     463        9729 :         |       ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; }
     464           0 : ;
     465             : 
     466             : declare_statement:
     467          23 :                 statement { $$ = $1; }
     468          23 :         |       ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; }
     469           0 : ;
     470             : 
     471             : switch_case_list:
     472         448 :                 '{' case_list '}'                                       { $$ = $2; }
     473         448 :         |       '{' ';' case_list '}'                           { $$ = $3; }
     474           0 :         |       ':' case_list T_ENDSWITCH ';'           { $$ = $2; }
     475           1 :         |       ':' ';' case_list T_ENDSWITCH ';'       { $$ = $3; }
     476           0 : ;
     477             : 
     478             : case_list:
     479         449 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_SWITCH_LIST); }
     480         449 :         |       case_list T_CASE expr case_separator inner_statement_list
     481        1586 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, $3, $5)); }
     482        1586 :         |       case_list T_DEFAULT case_separator inner_statement_list
     483         267 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, NULL, $4)); }
     484         267 : ;
     485             : 
     486             : case_separator:
     487             :                 ':'
     488             :         |       ';'
     489             : ;
     490             : 
     491             : 
     492             : while_statement:
     493        1859 :                 statement { $$ = $1; }
     494        1859 :         |       ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; }
     495           1 : ;
     496             : 
     497             : 
     498             : if_stmt_without_else:
     499             :                 T_IF '(' expr ')' statement
     500      136412 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     501       68206 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $5)); }
     502       68206 :         |       if_stmt_without_else T_ELSEIF '(' expr ')' statement
     503        3400 :                         { $$ = zend_ast_list_add($1,
     504        1700 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $6)); }
     505        1700 : ;
     506             : 
     507             : if_stmt:
     508       51271 :                 if_stmt_without_else { $$ = $1; }
     509       51271 :         |       if_stmt_without_else T_ELSE statement
     510       16935 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_IF_ELEM, NULL, $3)); }
     511       16935 : ;
     512             : 
     513             : alt_if_stmt_without_else:
     514             :                 T_IF '(' expr ')' ':' inner_statement_list
     515           8 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     516           4 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $6)); }
     517           4 :         |       alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list
     518           2 :                         { $$ = zend_ast_list_add($1,
     519           1 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $7)); }
     520           1 : ;
     521             : 
     522             : alt_if_stmt:
     523           2 :                 alt_if_stmt_without_else T_ENDIF ';' { $$ = $1; }
     524           2 :         |       alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';'
     525           2 :                         { $$ = zend_ast_list_add($1,
     526           2 :                               zend_ast_create(ZEND_AST_IF_ELEM, NULL, $4)); }
     527           2 : ;
     528             : 
     529             : parameter_list:
     530       26179 :                 non_empty_parameter_list { $$ = $1; }
     531       26179 :         |       /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_PARAM_LIST); }
     532        8994 : ;
     533             : 
     534             : 
     535             : non_empty_parameter_list:
     536             :                 parameter
     537       26179 :                         { $$ = zend_ast_create_list(1, ZEND_AST_PARAM_LIST, $1); }
     538       26179 :         |       non_empty_parameter_list ',' parameter
     539       56418 :                         { $$ = zend_ast_list_add($1, $3); }
     540       56418 : ;
     541             : 
     542             : parameter:
     543             :                 optional_type is_reference is_variadic T_VARIABLE
     544       68460 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, NULL); }
     545       68460 :         |       optional_type is_reference is_variadic T_VARIABLE '=' expr
     546       14137 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, $6); }
     547       14137 : ;
     548             : 
     549             : 
     550             : optional_type:
     551       82190 :                 /* empty */     { $$ = NULL; }
     552       82190 :         |       T_ARRAY         { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_ARRAY); }
     553         221 :         |       T_CALLABLE      { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_CALLABLE); }
     554           8 :         |       name            { $$ = $1; }
     555         178 : ;
     556             : 
     557             : argument_list:
     558       37558 :                 '(' ')' { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
     559       37558 :         |       '(' non_empty_argument_list ')' { $$ = $2; }
     560      274283 : ;
     561             : 
     562             : non_empty_argument_list:
     563             :                 argument
     564      274284 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARG_LIST, $1); }
     565      274284 :         |       non_empty_argument_list ',' argument
     566      267518 :                         { $$ = zend_ast_list_add($1, $3); }
     567      267518 : ;
     568             : 
     569             : argument:
     570      541738 :                 expr                    { $$ = $1; }
     571      541738 :         |       T_ELLIPSIS expr { $$ = zend_ast_create(ZEND_AST_UNPACK, $2); }
     572          64 : ;
     573             : 
     574             : global_var_list:
     575         580 :                 global_var_list ',' global_var { $$ = zend_ast_list_add($1, $3); }
     576         580 :         |       global_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     577        4001 : ;
     578             : 
     579             : global_var:
     580             :         simple_variable
     581        4581 :                 { $$ = zend_ast_create(ZEND_AST_GLOBAL, zend_ast_create(ZEND_AST_VAR, $1)); }
     582        4581 : ;
     583             : 
     584             : 
     585             : static_var_list:
     586           8 :                 static_var_list ',' static_var { $$ = zend_ast_list_add($1, $3); }
     587           8 :         |       static_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     588        1866 : ;
     589             : 
     590             : static_var:
     591          20 :                 T_VARIABLE                      { $$ = zend_ast_create(ZEND_AST_STATIC, $1, NULL); }
     592          20 :         |       T_VARIABLE '=' expr     { $$ = zend_ast_create(ZEND_AST_STATIC, $1, $3); }
     593        1854 : ;
     594             : 
     595             : 
     596             : class_statement_list:
     597             :                 class_statement_list class_statement
     598       19877 :                         { $$ = zend_ast_list_add($1, $2); }
     599       19877 :         |       /* empty */
     600        7276 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     601        7276 : ;
     602             : 
     603             : 
     604             : class_statement:
     605             :                 variable_modifiers property_list ';'
     606        2312 :                         { $$ = zend_ast_append_doc_comment($2 TSRMLS_CC); $$->attr = $1; }
     607        2312 :         |       T_CONST class_const_list ';'
     608         243 :                         { $$ = $2; RESET_DOC_COMMENT(); }
     609         241 :         |       T_USE name_list trait_adaptations
     610         198 :                         { $$ = zend_ast_create(ZEND_AST_USE_TRAIT, $2, $3); }
     611         198 :         |       method_modifiers function returns_ref T_STRING '(' parameter_list ')' backup_doc_comment
     612             :                 method_body
     613       68504 :                         { $$ = zend_ast_create_decl(ZEND_AST_METHOD, $3 | $1, $2, $8,
     614       34252 :                                   zend_ast_get_str($4), $6, NULL, $9); }
     615       17126 : ;
     616             : 
     617             : name_list:
     618         543 :                 name { $$ = zend_ast_create_list(1, ZEND_AST_NAME_LIST, $1); }
     619         543 :         |       name_list ',' name { $$ = zend_ast_list_add($1, $3); }
     620          81 : ;
     621             : 
     622             : trait_adaptations:
     623         141 :                 ';'                                                             { $$ = NULL; }
     624         141 :         |       '{' '}'                                                 { $$ = NULL; }
     625           0 :         |       '{' trait_adaptation_list '}'   { $$ = $2; }
     626          57 : ;
     627             : 
     628             : trait_adaptation_list:
     629             :                 trait_adaptation
     630          57 :                         { $$ = zend_ast_create_list(1, ZEND_AST_TRAIT_ADAPTATIONS, $1); }
     631          57 :         |       trait_adaptation_list trait_adaptation
     632          19 :                         { $$ = zend_ast_list_add($1, $2); }
     633          19 : ;
     634             : 
     635             : trait_adaptation:
     636          17 :                 trait_precedence ';'    { $$ = $1; }
     637          17 :         |       trait_alias ';'                 { $$ = $1; }
     638          59 : ;
     639             : 
     640             : trait_precedence:
     641             :         absolute_trait_method_reference T_INSTEADOF name_list
     642          17 :                 { $$ = zend_ast_create(ZEND_AST_TRAIT_PRECEDENCE, $1, $3); }
     643          17 : ;
     644             : 
     645             : trait_alias:
     646             :                 trait_method_reference T_AS trait_modifiers T_STRING
     647          48 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, $4); }
     648          48 :         |       trait_method_reference T_AS member_modifier
     649          11 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, NULL); }
     650          11 : ;
     651             : 
     652             : trait_method_reference:
     653             :                 T_STRING
     654          36 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, NULL, $1); }
     655          36 :         |       absolute_trait_method_reference { $$ = $1; }
     656          23 : ;
     657             : 
     658             : absolute_trait_method_reference:
     659             :         name T_PAAMAYIM_NEKUDOTAYIM T_STRING
     660          40 :                 { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, $1, $3); }
     661          40 : ;
     662             : 
     663             : trait_modifiers:
     664          44 :                 /* empty */             { $$ = 0; }
     665          44 :         |       member_modifier { $$ = $1; }
     666           4 : ;
     667             : 
     668             : method_body:
     669         169 :                 ';' /* abstract method */               { $$ = NULL; }
     670         169 :         |       '{' inner_statement_list '}'    { $$ = $2; }
     671       16957 : ;
     672             : 
     673             : variable_modifiers:
     674        2201 :                 non_empty_member_modifiers              { $$ = $1; }
     675        2201 :         |       T_VAR                                                   { $$ = ZEND_ACC_PUBLIC; }
     676         111 : ;
     677             : 
     678             : method_modifiers:
     679        6893 :                 /* empty */                                             { $$ = ZEND_ACC_PUBLIC; }
     680        6893 :         |       non_empty_member_modifiers
     681       10236 :                         { $$ = $1; if (!($$ & ZEND_ACC_PPP_MASK)) { $$ |= ZEND_ACC_PUBLIC; } }
     682       10236 : ;
     683             : 
     684             : non_empty_member_modifiers:
     685       12448 :                 member_modifier                 { $$ = $1; }
     686       12448 :         |       non_empty_member_modifiers member_modifier
     687         705 :                         { $$ = zend_add_member_modifier($1, $2); }
     688         694 : ;
     689             : 
     690             : member_modifier:
     691        4514 :                 T_PUBLIC                                { $$ = ZEND_ACC_PUBLIC; }
     692        4514 :         |       T_PROTECTED                             { $$ = ZEND_ACC_PROTECTED; }
     693         573 :         |       T_PRIVATE                               { $$ = ZEND_ACC_PRIVATE; }
     694        1092 :         |       T_STATIC                                { $$ = ZEND_ACC_STATIC; }
     695        6888 :         |       T_ABSTRACT                              { $$ = ZEND_ACC_ABSTRACT; }
     696          75 :         |       T_FINAL                                 { $$ = ZEND_ACC_FINAL; }
     697          26 : ;
     698             : 
     699             : property_list:
     700          41 :                 property_list ',' property { $$ = zend_ast_list_add($1, $3); }
     701          41 :         |       property { $$ = zend_ast_create_list(1, ZEND_AST_PROP_DECL, $1); }
     702        2312 : ;
     703             : 
     704             : property:
     705        1128 :                 T_VARIABLE { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, NULL); }
     706        1128 :         |       T_VARIABLE '=' expr
     707        1225 :                         { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, $3); }
     708        1225 : ;
     709             : 
     710             : class_const_list:
     711           3 :                 class_const_list ',' const_decl { $$ = zend_ast_list_add($1, $3); }
     712           3 :         |       const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CLASS_CONST_DECL, $1); }
     713         241 : ;
     714             : 
     715             : const_decl:
     716         431 :         T_STRING '=' expr { $$ = zend_ast_create(ZEND_AST_CONST_ELEM, $1, $3); }
     717         431 : ;
     718             : 
     719             : echo_expr_list:
     720        1383 :                 echo_expr_list ',' echo_expr { $$ = zend_ast_list_add($1, $3); }
     721        1383 :         |       echo_expr { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     722       28990 : ;
     723             : echo_expr:
     724       30373 :         expr { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     725       30373 : ;
     726             : 
     727             : for_exprs:
     728           7 :                 /* empty */                     { $$ = NULL; }
     729           7 :         |       non_empty_for_exprs     { $$ = $1; }
     730        5591 : ;
     731             : 
     732             : non_empty_for_exprs:
     733           5 :                 non_empty_for_exprs ',' expr { $$ = zend_ast_list_add($1, $3); }
     734           5 :         |       expr { $$ = zend_ast_create_list(1, ZEND_AST_EXPR_LIST, $1); }
     735        5591 : ;
     736             : 
     737             : new_expr:
     738             :                 T_NEW class_name_reference ctor_arguments
     739       14146 :                         { $$ = zend_ast_create(ZEND_AST_NEW, $2, $3); }
     740       14146 : ;
     741             : 
     742             : expr_without_variable:
     743             :                 T_LIST '(' assignment_list ')' '=' expr
     744         148 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $3, $6); }
     745         148 :         |       variable '=' expr
     746      129130 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $1, $3); }
     747      129130 :         |       variable '=' '&' variable
     748         395 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
     749         395 :         |       variable '=' '&' new_expr
     750          10 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
     751          10 :         |       T_CLONE expr { $$ = zend_ast_create(ZEND_AST_CLONE, $2); }
     752         113 :         |       variable T_PLUS_EQUAL expr
     753        1350 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_ADD, $1, $3); }
     754         675 :         |       variable T_MINUS_EQUAL expr
     755         278 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SUB, $1, $3); }
     756         139 :         |       variable T_MUL_EQUAL expr
     757          32 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MUL, $1, $3); }
     758          16 :         |       variable T_POW_EQUAL expr
     759           4 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_POW, $1, $3); }
     760           2 :         |       variable T_DIV_EQUAL expr
     761          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_DIV, $1, $3); }
     762           5 :         |       variable T_CONCAT_EQUAL expr
     763        5592 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_CONCAT, $1, $3); }
     764        2796 :         |       variable T_MOD_EQUAL expr
     765           0 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MOD, $1, $3); }
     766           0 :         |       variable T_AND_EQUAL expr
     767           4 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_AND, $1, $3); }
     768           2 :         |       variable T_OR_EQUAL expr 
     769         188 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_OR, $1, $3); }
     770          94 :         |       variable T_XOR_EQUAL expr 
     771           2 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_XOR, $1, $3); }
     772           1 :         |       variable T_SL_EQUAL expr
     773           8 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SL, $1, $3); }
     774           4 :         |       variable T_SR_EQUAL expr
     775           6 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SR, $1, $3); }
     776           3 :         |       variable T_INC { $$ = zend_ast_create(ZEND_AST_POST_INC, $1); }
     777        5353 :         |       T_INC variable { $$ = zend_ast_create(ZEND_AST_PRE_INC, $2); }
     778         508 :         |       variable T_DEC { $$ = zend_ast_create(ZEND_AST_POST_DEC, $1); }
     779          96 :         |       T_DEC variable { $$ = zend_ast_create(ZEND_AST_PRE_DEC, $2); }
     780          13 :         |       expr T_BOOLEAN_OR expr
     781        4255 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     782        4255 :         |       expr T_BOOLEAN_AND expr
     783        6536 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     784        6536 :         |       expr T_LOGICAL_OR expr
     785         857 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     786         857 :         |       expr T_LOGICAL_AND expr
     787          14 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     788          14 :         |       expr T_LOGICAL_XOR expr
     789           4 :                         { $$ = zend_ast_create_binary_op(ZEND_BOOL_XOR, $1, $3); }
     790         677 :         |       expr '|' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_OR, $1, $3); }
     791        1888 :         |       expr '&' expr       { $$ = zend_ast_create_binary_op(ZEND_BW_AND, $1, $3); }
     792        1237 :         |       expr '^' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_XOR, $1, $3); }
     793       31239 :         |       expr '.' expr   { $$ = zend_ast_create_binary_op(ZEND_CONCAT, $1, $3); }
     794       35012 :         |       expr '+' expr   { $$ = zend_ast_create_binary_op(ZEND_ADD, $1, $3); }
     795        4988 :         |       expr '-' expr   { $$ = zend_ast_create_binary_op(ZEND_SUB, $1, $3); }
     796        4039 :         |       expr '*' expr   { $$ = zend_ast_create_binary_op(ZEND_MUL, $1, $3); }
     797        2858 :         |       expr T_POW expr { $$ = zend_ast_create_binary_op(ZEND_POW, $1, $3); }
     798         535 :         |       expr '/' expr   { $$ = zend_ast_create_binary_op(ZEND_DIV, $1, $3); }
     799         980 :         |       expr '%' expr   { $$ = zend_ast_create_binary_op(ZEND_MOD, $1, $3); }
     800         591 :         |       expr T_SL expr  { $$ = zend_ast_create_binary_op(ZEND_SL, $1, $3); }
     801         205 :         |       expr T_SR expr  { $$ = zend_ast_create_binary_op(ZEND_SR, $1, $3); }
     802          69 :         |       '+' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_PLUS, $2); }
     803         252 :         |       '-' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_MINUS, $2); }
     804        6324 :         |       '!' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BOOL_NOT, $2); }
     805       29088 :         |       '~' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BW_NOT, $2); }
     806          97 :         |       expr T_IS_IDENTICAL expr
     807       10782 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_IDENTICAL, $1, $3); }
     808        5391 :         |       expr T_IS_NOT_IDENTICAL expr
     809       13340 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_IDENTICAL, $1, $3); }
     810        6670 :         |       expr T_IS_EQUAL expr
     811       31814 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_EQUAL, $1, $3); }
     812       15907 :         |       expr T_IS_NOT_EQUAL expr
     813        5358 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_EQUAL, $1, $3); }
     814        2679 :         |       expr '<' expr
     815        3578 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER, $1, $3); }
     816        1789 :         |       expr T_IS_SMALLER_OR_EQUAL expr
     817        3118 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER_OR_EQUAL, $1, $3); }
     818        1559 :         |       expr '>' expr
     819         789 :                         { $$ = zend_ast_create(ZEND_AST_GREATER, $1, $3); }
     820         789 :         |       expr T_IS_GREATER_OR_EQUAL expr
     821         313 :                         { $$ = zend_ast_create(ZEND_AST_GREATER_EQUAL, $1, $3); }
     822         313 :         |       expr T_INSTANCEOF class_name_reference
     823          65 :                         { $$ = zend_ast_create(ZEND_AST_INSTANCEOF, $1, $3); }
     824          65 :         |       '(' expr ')' { $$ = $2; }
     825       26548 :         |       new_expr { $$ = $1; }
     826       14136 :         |       expr '?' expr ':' expr
     827       27184 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, $3, $5); }
     828       27184 :         |       expr '?' ':' expr
     829          40 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, NULL, $4); }
     830          40 :         |       internal_functions_in_yacc { $$ = $1; }
     831       28832 :         |       T_INT_CAST expr         { $$ = zend_ast_create_cast(IS_LONG, $2); }
     832        4981 :         |       T_DOUBLE_CAST expr      { $$ = zend_ast_create_cast(IS_DOUBLE, $2); }
     833        1352 :         |       T_STRING_CAST expr      { $$ = zend_ast_create_cast(IS_STRING, $2); }
     834        1320 :         |       T_ARRAY_CAST expr       { $$ = zend_ast_create_cast(IS_ARRAY, $2); }
     835         176 :         |       T_OBJECT_CAST expr      { $$ = zend_ast_create_cast(IS_OBJECT, $2); }
     836         228 :         |       T_BOOL_CAST expr        { $$ = zend_ast_create_cast(_IS_BOOL, $2); }
     837          68 :         |       T_UNSET_CAST expr       { $$ = zend_ast_create_cast(IS_NULL, $2); }
     838           0 :         |       T_EXIT exit_expr        { $$ = zend_ast_create(ZEND_AST_EXIT, $2); }
     839       14335 :         |       '@' expr                        { $$ = zend_ast_create(ZEND_AST_SILENCE, $2); }
     840        5515 :         |       scalar { $$ = $1; }
     841      645379 :         |       '`' backticks_expr '`' { $$ = zend_ast_create(ZEND_AST_SHELL_EXEC, $2); }
     842         113 :         |       T_PRINT expr { $$ = zend_ast_create(ZEND_AST_PRINT, $2); }
     843        3383 :         |       T_YIELD { $$ = zend_ast_create(ZEND_AST_YIELD, NULL, NULL); }
     844          36 :         |       T_YIELD expr { $$ = zend_ast_create(ZEND_AST_YIELD, $2, NULL); }
     845          68 :         |       T_YIELD expr T_DOUBLE_ARROW expr { $$ = zend_ast_create(ZEND_AST_YIELD, $4, $2); }
     846          17 :         |       function returns_ref '(' parameter_list ')' lexical_vars backup_doc_comment
     847             :                 '{' inner_statement_list '}'
     848        1300 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $2, $1, $7,
     849             :                                   zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     850         975 :                               $4, $6, $9); }
     851         325 :         |       T_STATIC function returns_ref '(' parameter_list ')' lexical_vars backup_doc_comment
     852             :                 '{' inner_statement_list '}'
     853          44 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $3 | ZEND_ACC_STATIC, $2, $8,
     854             :                               zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     855          33 :                               $5, $7, $10); }
     856          11 : ;
     857             : 
     858             : function:
     859       35175 :         T_FUNCTION { $$ = CG(zend_lineno); }
     860       35175 : ;
     861             : 
     862             : backup_doc_comment:
     863       42449 :         /* empty */ { $$ = CG(doc_comment); CG(doc_comment) = NULL; }
     864       42449 : ;
     865             : 
     866             : returns_ref:
     867       35106 :                 /* empty */     { $$ = 0; }
     868       35106 :         |       '&'                 { $$ = ZEND_ACC_RETURN_REFERENCE; }
     869          69 : ;
     870             : 
     871             : lexical_vars:
     872         204 :                 /* empty */ { $$ = NULL; }
     873         204 :         |       T_USE '(' lexical_var_list ')' { $$ = $3; }
     874         132 : ;
     875             : 
     876             : lexical_var_list:
     877           7 :                 lexical_var_list ',' lexical_var { $$ = zend_ast_list_add($1, $3); }
     878           7 :         |       lexical_var { $$ = zend_ast_create_list(1, ZEND_AST_CLOSURE_USES, $1); }
     879         132 : ;
     880             : 
     881             : lexical_var:
     882         112 :                 T_VARIABLE              { $$ = $1; }
     883         112 :         |       '&' T_VARIABLE      { $$ = $2; $$->attr = 1; }
     884          27 : ;
     885             : 
     886             : function_call:
     887             :                 name argument_list
     888      253420 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
     889      253420 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
     890       10184 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
     891       10184 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
     892          38 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
     893          38 :         |       callable_expr argument_list
     894        2075 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
     895        2075 : ;
     896             : 
     897             : class_name:
     898             :                 T_STATIC
     899         120 :                         { zval zv; ZVAL_STRINGL(&zv, "static", sizeof("static")-1);
     900          60 :                           $$ = zend_ast_create_zval_ex(&zv, ZEND_NAME_NOT_FQ); }
     901          60 :         |       name { $$ = $1; }
     902       32870 : ;
     903             : 
     904             : class_name_reference:
     905       13082 :                 class_name              { $$ = $1; }
     906       13082 :         |       new_variable    { $$ = $1; }
     907        1129 : ;
     908             : 
     909             : exit_expr:
     910         411 :                 /* empty */                             { $$ = NULL; }
     911         411 :         |       '(' optional_expr ')'   { $$ = $2; }
     912       13924 : ;
     913             : 
     914             : backticks_expr:
     915             :                 /* empty */
     916           0 :                         { $$ = zend_ast_create_zval_from_str(STR_EMPTY_ALLOC()); }
     917           0 :         |       T_ENCAPSED_AND_WHITESPACE { $$ = $1; }
     918           7 :         |       encaps_list { $$ = $1; }
     919         106 : ;
     920             : 
     921             : 
     922             : ctor_arguments:
     923        2657 :                 /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
     924        2657 :         |       argument_list { $$ = $1; }
     925       11489 : ;
     926             : 
     927             : 
     928             : dereferencable_scalar:
     929       24797 :                 T_ARRAY '(' array_pair_list ')' { $$ = $3; }
     930       24797 :         |       '[' array_pair_list ']'                 { $$ = $2; }
     931         550 :         |       T_CONSTANT_ENCAPSED_STRING              { $$ = $1; }
     932      344210 : ;
     933             : 
     934             : scalar:
     935      160698 :                 T_LNUMBER       { $$ = $1; }
     936      160698 :         |       T_DNUMBER       { $$ = $1; }
     937        6837 :         |       T_LINE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_LINE); }
     938          12 :         |       T_FILE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FILE); }
     939        7173 :         |       T_DIR           { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_DIR); }
     940         440 :         |       T_TRAIT_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_TRAIT_C); }
     941           5 :         |       T_METHOD_C      { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_METHOD_C); }
     942         752 :         |       T_FUNC_C        { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FUNC_C); }
     943         104 :         |       T_NS_C          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_NS_C); }
     944          36 :         |       T_CLASS_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C); }
     945          82 :         |       T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = $2; }
     946        1332 :         |       T_START_HEREDOC T_END_HEREDOC
     947         118 :                         { $$ = zend_ast_create_zval_from_str(STR_EMPTY_ALLOC()); }
     948          59 :         |       '"' encaps_list '"'   { $$ = $2; }
     949       12128 :         |       T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; }
     950         141 :         |       dereferencable_scalar   { $$ = $1; }
     951      369528 :         |       class_name_scalar       { $$ = $1; }
     952          29 :         |       constant                        { $$ = $1; }
     953       86023 : ;
     954             : 
     955             : constant:
     956       77008 :                 name { $$ = zend_ast_create(ZEND_AST_CONST, $1); }
     957       77008 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING
     958        9021 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
     959        9021 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING
     960           5 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
     961           5 : ;
     962             : 
     963             : possible_comma:
     964             :                 /* empty */
     965             :         |       ','
     966             : ;
     967             : 
     968             : expr:
     969      695005 :                 variable                                        { $$ = $1; }
     970      695005 :         |       expr_without_variable           { $$ = $1; }
     971     1031766 : ;
     972             : 
     973             : optional_expr:
     974        2822 :                 /* empty */     { $$ = NULL; }
     975        2822 :         |       expr            { $$ = $1; }
     976      178352 : ;
     977             : 
     978             : variable_class_name:
     979          55 :         dereferencable { $$ = $1; }
     980          55 : ;
     981             : 
     982             : dereferencable:
     983      166143 :                 variable                                { $$ = $1; }
     984      166143 :         |       '(' expr ')'                    { $$ = $2; }
     985          38 :         |       dereferencable_scalar   { $$ = $1; }
     986          25 : ;
     987             : 
     988             : callable_expr:
     989        2067 :                 callable_variable               { $$ = $1; }
     990        2067 :         |       '(' expr ')'                    { $$ = $2; }
     991           4 :         |       dereferencable_scalar   { $$ = $1; }
     992           4 : ;
     993             : 
     994             : callable_variable:
     995             :                 simple_variable
     996      587985 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
     997      587985 :         |       dereferencable '[' optional_expr ']'
     998      121585 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
     999      121585 :         |       constant '[' optional_expr ']'
    1000          10 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1001          10 :         |       dereferencable '{' expr '}'
    1002          21 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1003          21 :         |       dereferencable T_OBJECT_OPERATOR member_name argument_list
    1004       34635 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_CALL, $1, $3, $4); }
    1005       34635 :         |       function_call { $$ = $1; }
    1006      265717 : ;
    1007             : 
    1008             : variable:
    1009             :                 callable_variable
    1010     1007886 :                         { $$ = $1; }
    1011     1007886 :         |       static_member
    1012         625 :                         { $$ = $1; }
    1013         625 :         |       dereferencable T_OBJECT_OPERATOR member_name
    1014        9910 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1015        9910 : ;
    1016             : 
    1017             : simple_variable:
    1018      594413 :                 T_VARIABLE                      { $$ = $1; }
    1019      594413 :         |       '$' '{' expr '}'        { $$ = $3; }
    1020          30 :         |       '$' simple_variable     { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1021         153 : ;
    1022             : 
    1023             : static_member:
    1024             :                 class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1025         613 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1026         613 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1027          12 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1028          12 : ;
    1029             : 
    1030             : new_variable:
    1031             :                 simple_variable
    1032        1128 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1033        1128 :         |       new_variable '[' optional_expr ']'
    1034          11 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1035          11 :         |       new_variable '{' expr '}'
    1036           1 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1037           1 :         |       new_variable T_OBJECT_OPERATOR member_name
    1038           4 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1039           4 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1040           1 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1041           1 :         |       new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1042           2 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1043           2 : ;
    1044             : 
    1045             : member_name:
    1046       54583 :                 T_STRING                { $$ = $1; }
    1047       54583 :         |       '{' expr '}'    { $$ = $2; }
    1048          67 :         |       simple_variable { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1049         121 : ;
    1050             : 
    1051             : assignment_list:
    1052             :                 assignment_list ',' assignment_list_element
    1053         219 :                         { $$ = zend_ast_list_add($1, $3); }
    1054         219 :         |       assignment_list_element
    1055         174 :                         { $$ = zend_ast_create_list(1, ZEND_AST_LIST, $1); }
    1056         174 : ;
    1057             : 
    1058             : assignment_list_element:
    1059         355 :                 variable                                                { $$ = $1; }
    1060         355 :         |       T_LIST '(' assignment_list ')'  { $$ = $3; }
    1061          17 :         |       /* empty */                                             { $$ = NULL; }
    1062          21 : ;
    1063             : 
    1064             : 
    1065             : array_pair_list:
    1066        3322 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_ARRAY); }
    1067        3322 :         |       non_empty_array_pair_list possible_comma { $$ = $1; }
    1068       22025 : ;
    1069             : 
    1070             : non_empty_array_pair_list:
    1071             :                 non_empty_array_pair_list ',' array_pair
    1072       74060 :                         { $$ = zend_ast_list_add($1, $3); }
    1073       74060 :         |       array_pair
    1074       22025 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARRAY, $1); }
    1075       22025 : ;
    1076             : 
    1077             : array_pair:
    1078             :                 expr T_DOUBLE_ARROW expr
    1079       26860 :                         { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $3, $1); }
    1080       26860 :         |       expr { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $1, NULL); }
    1081       69075 :         |       expr T_DOUBLE_ARROW '&' variable
    1082          61 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $4, $1); }
    1083          61 :         |       '&' variable
    1084          89 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $2, NULL); }
    1085          89 : ;
    1086             : 
    1087             : encaps_list:
    1088             :                 encaps_list encaps_var
    1089        5952 :                         { $$ = zend_ast_list_add($1, $2); }
    1090        5952 :         |       encaps_list T_ENCAPSED_AND_WHITESPACE
    1091       13892 :                         { $$ = zend_ast_list_add($1, $2); }
    1092       13892 :         |       encaps_var
    1093        3805 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ENCAPS_LIST, $1); }
    1094        3805 :         |       T_ENCAPSED_AND_WHITESPACE encaps_var
    1095        8571 :                         { $$ = zend_ast_create_list(2, ZEND_AST_ENCAPS_LIST, $1, $2); }
    1096        8571 : ;
    1097             : 
    1098             : encaps_var:
    1099             :                 T_VARIABLE
    1100       16014 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1101       16014 :         |       T_VARIABLE '[' encaps_var_offset ']'
    1102        1634 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1103        1634 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1104         817 :         |       T_VARIABLE T_OBJECT_OPERATOR T_STRING
    1105         164 :                         { $$ = zend_ast_create(ZEND_AST_PROP,
    1106          82 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1107          82 :         |       T_DOLLAR_OPEN_CURLY_BRACES expr '}'
    1108           1 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1109           1 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}'
    1110         210 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1111         210 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}'
    1112           0 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1113           0 :                               zend_ast_create(ZEND_AST_VAR, $2), $4); }
    1114           0 :         |       T_CURLY_OPEN variable '}' { $$ = $2; }
    1115        1204 : ;
    1116             : 
    1117             : encaps_var_offset:
    1118           4 :                 T_STRING                { $$ = $1; }
    1119           4 :         |       T_NUM_STRING    { $$ = $1; }
    1120         225 :         |       T_VARIABLE              { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1121         588 : ;
    1122             : 
    1123             : 
    1124             : internal_functions_in_yacc:
    1125        5465 :                 T_ISSET '(' isset_variables ')' { $$ = $3; }
    1126        5465 :         |       T_EMPTY '(' expr ')' { $$ = zend_ast_create(ZEND_AST_EMPTY, $3); }
    1127        7732 :         |       T_INCLUDE expr
    1128        1854 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE, $2); }
    1129        1854 :         |       T_INCLUDE_ONCE expr
    1130         495 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE_ONCE, $2); }
    1131         495 :         |       T_EVAL '(' expr ')'
    1132        1893 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_EVAL, $3); }
    1133        1893 :         |       T_REQUIRE expr
    1134         812 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE, $2); }
    1135         812 :         |       T_REQUIRE_ONCE expr
    1136        5648 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE_ONCE, $2); }
    1137        5648 : ;
    1138             : 
    1139             : isset_variables:
    1140        5465 :                 isset_variable { $$ = $1; }
    1141        5465 :         |       isset_variables ',' isset_variable
    1142          43 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
    1143          43 : ;
    1144             : 
    1145             : isset_variable:
    1146        5508 :                 expr { $$ = zend_ast_create(ZEND_AST_ISSET, $1); }
    1147        5508 : ;
    1148             : 
    1149             : class_name_scalar:
    1150             :         class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS
    1151          29 :                 { $$ = zend_ast_create(ZEND_AST_RESOLVE_CLASS_NAME, $1); }
    1152             : ;
    1153             : 
    1154             : %%
    1155             : 
    1156             : /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
    1157             :    quotes and backslashes, so that it's suitable for yyerror.  The
    1158             :    heuristic is that double-quoting is unnecessary unless the string
    1159             :    contains an apostrophe, a comma, or backslash (other than
    1160             :    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
    1161             :    null, do not copy; instead, return the length of what the result
    1162             :    would have been.  */
    1163         336 : static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
    1164             : {
    1165         336 :         if (!yyres) {
    1166         256 :                 return yystrlen(yystr);
    1167             :         }
    1168             :         {
    1169             :                 TSRMLS_FETCH();
    1170          80 :                 if (CG(parse_error) == 0) {
    1171             :                         char buffer[120];
    1172          39 :                         const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
    1173          39 :                         unsigned int len = 0, toklen = 0, yystr_len;
    1174             :                         
    1175          39 :                         CG(parse_error) = 1;
    1176             : 
    1177          51 :                         if (LANG_SCNG(yy_text)[0] == 0 &&
    1178           6 :                                 LANG_SCNG(yy_leng) == 1 &&
    1179           6 :                                 memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
    1180           6 :                                 yystpcpy(yyres, "end of file");
    1181           6 :                                 return sizeof("end of file")-1;
    1182             :                         }
    1183             :                         
    1184          33 :                         str = LANG_SCNG(yy_text);
    1185          33 :                         end = memchr(str, '\n', LANG_SCNG(yy_leng));
    1186          33 :                         yystr_len = yystrlen(yystr);
    1187             :                         
    1188          79 :                         if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
    1189          23 :                                 && (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
    1190          23 :                                 toklen = (tok2 - tok1) + 1;
    1191             :                         } else {
    1192          10 :                                 tok1 = tok2 = NULL;
    1193          10 :                                 toklen = 0;
    1194             :                         }
    1195             :                         
    1196          33 :                         if (end == NULL) {
    1197          32 :                                 len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
    1198             :                         } else {
    1199           1 :                                 len = (end - str) > 30 ? 30 : (end - str);
    1200             :                         }
    1201          33 :                         if (toklen) {
    1202          23 :                                 snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
    1203             :                         } else {
    1204          10 :                                 snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
    1205             :                         }
    1206          33 :                         yystpcpy(yyres, buffer);
    1207          33 :                         return len + (toklen ? toklen + 1 : 0) + 2;
    1208             :                 }               
    1209             :         }       
    1210          41 :         if (*yystr == '"') {
    1211          24 :                 YYSIZE_T yyn = 0;
    1212          24 :                 const char *yyp = yystr;
    1213             : 
    1214         516 :                 for (; *++yyp != '"'; ++yyn) {
    1215         492 :                         yyres[yyn] = *yyp;
    1216             :                 }
    1217          24 :                 yyres[yyn] = '\0';
    1218          24 :                 return yyn;
    1219             :         }
    1220          17 :         yystpcpy(yyres, yystr);
    1221          17 :         return strlen(yystr);
    1222             : }
    1223             : 
    1224             : /*
    1225             :  * Local variables:
    1226             :  * tab-width: 4
    1227             :  * c-basic-offset: 4
    1228             :  * indent-tabs-mode: t
    1229             :  * End:
    1230             :  */

Generated by: LCOV version 1.10

Generated at Sat, 27 Sep 2014 16:43:06 +0000 (4 days ago)

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