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

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

Generated by: LCOV version 1.10

Generated at Sat, 13 Dec 2014 06:16:10 +0000 (6 days ago)

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