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: 702 716 98.0 %
Date: 2016-05-28 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : %{
       2             : /*
       3             :    +----------------------------------------------------------------------+
       4             :    | Zend Engine                                                          |
       5             :    +----------------------------------------------------------------------+
       6             :    | Copyright (c) 1998-2016 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             : #include "zend_compile.h"
      25             : #include "zend.h"
      26             : #include "zend_list.h"
      27             : #include "zend_globals.h"
      28             : #include "zend_API.h"
      29             : #include "zend_constants.h"
      30             : #include "zend_language_scanner.h"
      31             : 
      32             : #define YYSIZE_T size_t
      33             : #define yytnamerr zend_yytnamerr
      34             : static YYSIZE_T zend_yytnamerr(char*, const char*);
      35             : 
      36             : #define YYERROR_VERBOSE
      37             : #define YYSTYPE zend_parser_stack_elem
      38             : 
      39             : #ifdef _MSC_VER
      40             : #define YYMALLOC malloc
      41             : #define YYFREE free
      42             : #endif
      43             : 
      44             : %}
      45             : 
      46             : %pure_parser
      47             : %expect 0
      48             : 
      49             : %code requires {
      50             : }
      51             : 
      52         158 : %destructor { zend_ast_destroy($$); } <ast>
      53          10 : %destructor { if ($$) zend_string_release($$); } <str>
      54             : 
      55             : %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
      56             : %left ','
      57             : %left T_LOGICAL_OR
      58             : %left T_LOGICAL_XOR
      59             : %left T_LOGICAL_AND
      60             : %right T_PRINT
      61             : %right T_YIELD
      62             : %right T_DOUBLE_ARROW
      63             : %right T_YIELD_FROM
      64             : %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
      65             : %left '?' ':'
      66             : %right T_COALESCE
      67             : %left T_BOOLEAN_OR
      68             : %left T_BOOLEAN_AND
      69             : %left '|'
      70             : %left '^'
      71             : %left '&'
      72             : %nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP
      73             : %nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
      74             : %left T_SL T_SR
      75             : %left '+' '-' '.'
      76             : %left '*' '/' '%'
      77             : %right '!'
      78             : %nonassoc T_INSTANCEOF
      79             : %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 '@'
      80             : %right T_POW
      81             : %right '['
      82             : %nonassoc T_NEW T_CLONE
      83             : %left T_NOELSE
      84             : %left T_ELSEIF
      85             : %left T_ELSE
      86             : %left T_ENDIF
      87             : %right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC
      88             : 
      89             : %token <ast> T_LNUMBER   "integer number (T_LNUMBER)"
      90             : %token <ast> T_DNUMBER   "floating-point number (T_DNUMBER)"
      91             : %token <ast> T_STRING    "identifier (T_STRING)"
      92             : %token <ast> T_VARIABLE  "variable (T_VARIABLE)"
      93             : %token <ast> T_INLINE_HTML
      94             : %token <ast> T_ENCAPSED_AND_WHITESPACE  "quoted-string and whitespace (T_ENCAPSED_AND_WHITESPACE)"
      95             : %token <ast> T_CONSTANT_ENCAPSED_STRING "quoted-string (T_CONSTANT_ENCAPSED_STRING)"
      96             : %token <ast> T_STRING_VARNAME "variable name (T_STRING_VARNAME)"
      97             : %token <ast> T_NUM_STRING "number (T_NUM_STRING)"
      98             : 
      99             : %token END 0 "end of file"
     100             : %token T_INCLUDE      "include (T_INCLUDE)"
     101             : %token T_INCLUDE_ONCE "include_once (T_INCLUDE_ONCE)"
     102             : %token T_EVAL         "eval (T_EVAL)"
     103             : %token T_REQUIRE      "require (T_REQUIRE)"
     104             : %token T_REQUIRE_ONCE "require_once (T_REQUIRE_ONCE)"
     105             : %token T_LOGICAL_OR   "or (T_LOGICAL_OR)"
     106             : %token T_LOGICAL_XOR  "xor (T_LOGICAL_XOR)"
     107             : %token T_LOGICAL_AND  "and (T_LOGICAL_AND)"
     108             : %token T_PRINT        "print (T_PRINT)"
     109             : %token T_YIELD        "yield (T_YIELD)"
     110             : %token T_YIELD_FROM   "yield from (T_YIELD_FROM)"
     111             : %token T_PLUS_EQUAL   "+= (T_PLUS_EQUAL)"
     112             : %token T_MINUS_EQUAL  "-= (T_MINUS_EQUAL)"
     113             : %token T_MUL_EQUAL    "*= (T_MUL_EQUAL)"
     114             : %token T_DIV_EQUAL    "/= (T_DIV_EQUAL)"
     115             : %token T_CONCAT_EQUAL ".= (T_CONCAT_EQUAL)"
     116             : %token T_MOD_EQUAL    "%= (T_MOD_EQUAL)"
     117             : %token T_AND_EQUAL    "&= (T_AND_EQUAL)"
     118             : %token T_OR_EQUAL     "|= (T_OR_EQUAL)"
     119             : %token T_XOR_EQUAL    "^= (T_XOR_EQUAL)"
     120             : %token T_SL_EQUAL     "<<= (T_SL_EQUAL)"
     121             : %token T_SR_EQUAL     ">>= (T_SR_EQUAL)"
     122             : %token T_BOOLEAN_OR   "|| (T_BOOLEAN_OR)"
     123             : %token T_BOOLEAN_AND  "&& (T_BOOLEAN_AND)"
     124             : %token T_IS_EQUAL     "== (T_IS_EQUAL)"
     125             : %token T_IS_NOT_EQUAL "!= (T_IS_NOT_EQUAL)"
     126             : %token T_IS_IDENTICAL "=== (T_IS_IDENTICAL)"
     127             : %token T_IS_NOT_IDENTICAL "!== (T_IS_NOT_IDENTICAL)"
     128             : %token T_IS_SMALLER_OR_EQUAL "<= (T_IS_SMALLER_OR_EQUAL)"
     129             : %token T_IS_GREATER_OR_EQUAL ">= (T_IS_GREATER_OR_EQUAL)"
     130             : %token T_SPACESHIP "<=> (T_SPACESHIP)"
     131             : %token T_SL "<< (T_SL)"
     132             : %token T_SR ">> (T_SR)"
     133             : %token T_INSTANCEOF  "instanceof (T_INSTANCEOF)"
     134             : %token T_INC "++ (T_INC)"
     135             : %token T_DEC "-- (T_DEC)"
     136             : %token T_INT_CAST    "(int) (T_INT_CAST)"
     137             : %token T_DOUBLE_CAST "(double) (T_DOUBLE_CAST)"
     138             : %token T_STRING_CAST "(string) (T_STRING_CAST)"
     139             : %token T_ARRAY_CAST  "(array) (T_ARRAY_CAST)"
     140             : %token T_OBJECT_CAST "(object) (T_OBJECT_CAST)"
     141             : %token T_BOOL_CAST   "(bool) (T_BOOL_CAST)"
     142             : %token T_UNSET_CAST  "(unset) (T_UNSET_CAST)"
     143             : %token T_NEW       "new (T_NEW)"
     144             : %token T_CLONE     "clone (T_CLONE)"
     145             : %token T_EXIT      "exit (T_EXIT)"
     146             : %token T_IF        "if (T_IF)"
     147             : %token T_ELSEIF    "elseif (T_ELSEIF)"
     148             : %token T_ELSE      "else (T_ELSE)"
     149             : %token T_ENDIF     "endif (T_ENDIF)"
     150             : %token T_ECHO       "echo (T_ECHO)"
     151             : %token T_DO         "do (T_DO)"
     152             : %token T_WHILE      "while (T_WHILE)"
     153             : %token T_ENDWHILE   "endwhile (T_ENDWHILE)"
     154             : %token T_FOR        "for (T_FOR)"
     155             : %token T_ENDFOR     "endfor (T_ENDFOR)"
     156             : %token T_FOREACH    "foreach (T_FOREACH)"
     157             : %token T_ENDFOREACH "endforeach (T_ENDFOREACH)"
     158             : %token T_DECLARE    "declare (T_DECLARE)"
     159             : %token T_ENDDECLARE "enddeclare (T_ENDDECLARE)"
     160             : %token T_AS         "as (T_AS)"
     161             : %token T_SWITCH     "switch (T_SWITCH)"
     162             : %token T_ENDSWITCH  "endswitch (T_ENDSWITCH)"
     163             : %token T_CASE       "case (T_CASE)"
     164             : %token T_DEFAULT    "default (T_DEFAULT)"
     165             : %token T_BREAK      "break (T_BREAK)"
     166             : %token T_CONTINUE   "continue (T_CONTINUE)"
     167             : %token T_GOTO       "goto (T_GOTO)"
     168             : %token T_FUNCTION   "function (T_FUNCTION)"
     169             : %token T_CONST      "const (T_CONST)"
     170             : %token T_RETURN     "return (T_RETURN)"
     171             : %token T_TRY        "try (T_TRY)"
     172             : %token T_CATCH      "catch (T_CATCH)"
     173             : %token T_FINALLY    "finally (T_FINALLY)"
     174             : %token T_THROW      "throw (T_THROW)"
     175             : %token T_USE        "use (T_USE)"
     176             : %token T_INSTEADOF  "insteadof (T_INSTEADOF)"
     177             : %token T_GLOBAL     "global (T_GLOBAL)"
     178             : %token T_STATIC     "static (T_STATIC)"
     179             : %token T_ABSTRACT   "abstract (T_ABSTRACT)"
     180             : %token T_FINAL      "final (T_FINAL)"
     181             : %token T_PRIVATE    "private (T_PRIVATE)"
     182             : %token T_PROTECTED  "protected (T_PROTECTED)"
     183             : %token T_PUBLIC     "public (T_PUBLIC)"
     184             : %token T_VAR        "var (T_VAR)"
     185             : %token T_UNSET      "unset (T_UNSET)"
     186             : %token T_ISSET      "isset (T_ISSET)"
     187             : %token T_EMPTY      "empty (T_EMPTY)"
     188             : %token T_HALT_COMPILER "__halt_compiler (T_HALT_COMPILER)"
     189             : %token T_CLASS      "class (T_CLASS)"
     190             : %token T_TRAIT      "trait (T_TRAIT)"
     191             : %token T_INTERFACE  "interface (T_INTERFACE)"
     192             : %token T_EXTENDS    "extends (T_EXTENDS)"
     193             : %token T_IMPLEMENTS "implements (T_IMPLEMENTS)"
     194             : %token T_OBJECT_OPERATOR "-> (T_OBJECT_OPERATOR)"
     195             : %token T_DOUBLE_ARROW    "=> (T_DOUBLE_ARROW)"
     196             : %token T_LIST            "list (T_LIST)"
     197             : %token T_ARRAY           "array (T_ARRAY)"
     198             : %token T_CALLABLE        "callable (T_CALLABLE)"
     199             : %token T_LINE            "__LINE__ (T_LINE)"
     200             : %token T_FILE            "__FILE__ (T_FILE)"
     201             : %token T_DIR             "__DIR__ (T_DIR)"
     202             : %token T_CLASS_C         "__CLASS__ (T_CLASS_C)"
     203             : %token T_TRAIT_C         "__TRAIT__ (T_TRAIT_C)"
     204             : %token T_METHOD_C        "__METHOD__ (T_METHOD_C)"
     205             : %token T_FUNC_C          "__FUNCTION__ (T_FUNC_C)"
     206             : %token T_COMMENT         "comment (T_COMMENT)"
     207             : %token T_DOC_COMMENT     "doc comment (T_DOC_COMMENT)"
     208             : %token T_OPEN_TAG        "open tag (T_OPEN_TAG)"
     209             : %token T_OPEN_TAG_WITH_ECHO "open tag with echo (T_OPEN_TAG_WITH_ECHO)"
     210             : %token T_CLOSE_TAG       "close tag (T_CLOSE_TAG)"
     211             : %token T_WHITESPACE      "whitespace (T_WHITESPACE)"
     212             : %token T_START_HEREDOC   "heredoc start (T_START_HEREDOC)"
     213             : %token T_END_HEREDOC     "heredoc end (T_END_HEREDOC)"
     214             : %token T_DOLLAR_OPEN_CURLY_BRACES "${ (T_DOLLAR_OPEN_CURLY_BRACES)"
     215             : %token T_CURLY_OPEN      "{$ (T_CURLY_OPEN)"
     216             : %token T_PAAMAYIM_NEKUDOTAYIM ":: (T_PAAMAYIM_NEKUDOTAYIM)"
     217             : %token T_NAMESPACE       "namespace (T_NAMESPACE)"
     218             : %token T_NS_C            "__NAMESPACE__ (T_NS_C)"
     219             : %token T_NS_SEPARATOR    "\\ (T_NS_SEPARATOR)"
     220             : %token T_ELLIPSIS        "... (T_ELLIPSIS)"
     221             : %token T_COALESCE        "?? (T_COALESCE)"
     222             : %token T_POW             "** (T_POW)"
     223             : %token T_POW_EQUAL       "**= (T_POW_EQUAL)"
     224             : 
     225             : /* Token used to force a parse error from the lexer */
     226             : %token T_ERROR
     227             : 
     228             : %type <ast> top_statement namespace_name name statement function_declaration_statement
     229             : %type <ast> class_declaration_statement trait_declaration_statement
     230             : %type <ast> interface_declaration_statement interface_extends_list
     231             : %type <ast> group_use_declaration inline_use_declarations inline_use_declaration
     232             : %type <ast> mixed_group_use_declaration use_declaration unprefixed_use_declaration
     233             : %type <ast> unprefixed_use_declarations const_decl inner_statement
     234             : %type <ast> expr optional_expr while_statement for_statement foreach_variable
     235             : %type <ast> foreach_statement declare_statement finally_statement unset_variable variable
     236             : %type <ast> extends_from parameter optional_type argument expr_without_variable global_var
     237             : %type <ast> static_var class_statement trait_adaptation trait_precedence trait_alias
     238             : %type <ast> absolute_trait_method_reference trait_method_reference property echo_expr
     239             : %type <ast> new_expr anonymous_class class_name class_name_reference simple_variable
     240             : %type <ast> internal_functions_in_yacc
     241             : %type <ast> exit_expr scalar backticks_expr lexical_var function_call member_name property_name
     242             : %type <ast> variable_class_name dereferencable_scalar constant dereferencable
     243             : %type <ast> callable_expr callable_variable static_member new_variable
     244             : %type <ast> assignment_list_element array_pair encaps_var encaps_var_offset isset_variables
     245             : %type <ast> top_statement_list use_declarations const_list inner_statement_list if_stmt
     246             : %type <ast> alt_if_stmt for_exprs switch_case_list global_var_list static_var_list
     247             : %type <ast> echo_expr_list unset_variables catch_list parameter_list class_statement_list
     248             : %type <ast> implements_list case_list if_stmt_without_else
     249             : %type <ast> non_empty_parameter_list argument_list non_empty_argument_list property_list
     250             : %type <ast> class_const_list class_const_decl name_list trait_adaptations method_body non_empty_for_exprs
     251             : %type <ast> ctor_arguments alt_if_stmt_without_else trait_adaptation_list lexical_vars
     252             : %type <ast> lexical_var_list encaps_list array_pair_list non_empty_array_pair_list
     253             : %type <ast> assignment_list isset_variable type return_type
     254             : %type <ast> identifier
     255             : 
     256             : %type <num> returns_ref function is_reference is_variadic variable_modifiers
     257             : %type <num> method_modifiers non_empty_member_modifiers member_modifier
     258             : %type <num> class_modifiers class_modifier use_type
     259             : 
     260             : %type <str> backup_doc_comment
     261             : 
     262             : %% /* Rules */
     263             : 
     264             : start:
     265       33210 :         top_statement_list      { CG(ast) = $1; }
     266       33210 : ;
     267             : 
     268             : reserved_non_modifiers:
     269             :           T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND
     270             :         | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE | T_ENDWHILE
     271             :         | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH | T_FINALLY
     272             :         | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO
     273             :         | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT | T_BREAK
     274             :         | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS
     275             :         | T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_HALT_COMPILER
     276             : ;
     277             : 
     278             : semi_reserved:
     279             :           reserved_non_modifiers
     280             :         | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC
     281             : ;
     282             : 
     283             : identifier:
     284       40824 :                 T_STRING { $$ = $1; }
     285       40824 :         |       semi_reserved  {
     286             :                         zval zv;
     287         507 :                         zend_lex_tstring(&zv);
     288         507 :                         $$ = zend_ast_create_zval(&zv);
     289             :                 }
     290         507 : ;
     291             : 
     292             : top_statement_list:
     293      235910 :                 top_statement_list top_statement { $$ = zend_ast_list_add($1, $2); }
     294      235910 :         |       /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     295       33402 : ;
     296             : 
     297             : namespace_name:
     298      407053 :                 T_STRING                                                                { $$ = $1; }
     299      407053 :         |       namespace_name T_NS_SEPARATOR T_STRING  { $$ = zend_ast_append_str($1, $3); }
     300         447 : ;
     301             : 
     302             : name:
     303      406328 :                 namespace_name                                                          { $$ = $1; $$->attr = ZEND_NAME_NOT_FQ; }
     304      406328 :         |       T_NAMESPACE T_NS_SEPARATOR namespace_name       { $$ = $3; $$->attr = ZEND_NAME_RELATIVE; }
     305          58 :         |       T_NS_SEPARATOR namespace_name                           { $$ = $2; $$->attr = ZEND_NAME_FQ; }
     306         287 : ;
     307             : 
     308             : top_statement:
     309      213924 :                 statement                                                       { $$ = $1; }
     310      213924 :         |       function_declaration_statement          { $$ = $1; }
     311       14198 :         |       class_declaration_statement                     { $$ = $1; }
     312        6502 :         |       trait_declaration_statement                     { $$ = $1; }
     313         236 :         |       interface_declaration_statement         { $$ = $1; }
     314         208 :         |       T_HALT_COMPILER '(' ')' ';'
     315         554 :                         { $$ = zend_ast_create(ZEND_AST_HALT_COMPILER,
     316         277 :                               zend_ast_create_zval_from_long(zend_get_scanned_file_offset()));
     317         277 :                           zend_stop_lexing(); }
     318         277 :         |       T_NAMESPACE namespace_name ';'
     319         148 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, NULL);
     320         148 :                           RESET_DOC_COMMENT(); }
     321         149 :         |       T_NAMESPACE namespace_name { RESET_DOC_COMMENT(); }
     322          69 :                 '{' top_statement_list '}'
     323          66 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, $5); }
     324          66 :         |       T_NAMESPACE { RESET_DOC_COMMENT(); }
     325          45 :                 '{' top_statement_list '}'
     326          45 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, NULL, $4); }
     327          45 :         |       T_USE mixed_group_use_declaration ';'           { $$ = $2; }
     328          10 :         |       T_USE use_type group_use_declaration ';'        { $$ = $3; $$->attr = $2; }
     329           4 :         |       T_USE use_declarations ';'                                      { $$ = $2; $$->attr = T_CLASS; }
     330          63 :         |       T_USE use_type use_declarations ';'                     { $$ = $3; $$->attr = $2; }
     331          31 :         |       T_CONST const_list ';'                                          { $$ = $2; }
     332         198 : ;
     333             : 
     334             : use_type:
     335          23 :                 T_FUNCTION              { $$ = T_FUNCTION; }
     336          23 :         |       T_CONST                 { $$ = T_CONST; }
     337          22 : ;
     338             : 
     339             : group_use_declaration:
     340             :                 namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}'
     341           2 :                         { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $1, $4); }
     342           2 :         |       T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}'
     343           2 :                         { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $2, $5); }
     344           2 : ;
     345             : 
     346             : mixed_group_use_declaration:
     347             :                 namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}'
     348           9 :                         { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $1, $4);}
     349           9 :         |       T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}'
     350           1 :                         { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $2, $5); }
     351           1 : ;
     352             : 
     353             : inline_use_declarations:
     354             :                 inline_use_declarations ',' inline_use_declaration
     355          19 :                         { $$ = zend_ast_list_add($1, $3); }
     356          19 :         |       inline_use_declaration
     357          11 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     358          11 : ;
     359             : 
     360             : unprefixed_use_declarations:
     361             :                 unprefixed_use_declarations ',' unprefixed_use_declaration
     362           9 :                         { $$ = zend_ast_list_add($1, $3); }
     363           9 :         |       unprefixed_use_declaration
     364           5 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     365           5 : ;
     366             : 
     367             : use_declarations:
     368             :                 use_declarations ',' use_declaration
     369           8 :                         { $$ = zend_ast_list_add($1, $3); }
     370           8 :         |       use_declaration
     371          94 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     372          94 : ;
     373             : 
     374             : inline_use_declaration:
     375          21 :                 unprefixed_use_declaration { $$ = $1; $$->attr = T_CLASS; }
     376          21 :         |       use_type unprefixed_use_declaration { $$ = $2; $$->attr = $1; }
     377           9 : ;
     378             : 
     379             : unprefixed_use_declaration:
     380             :                 namespace_name
     381          84 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, NULL); }
     382          84 :         |       namespace_name T_AS T_STRING
     383          62 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, $3); }
     384          62 : ;
     385             : 
     386             : use_declaration:
     387          87 :                 unprefixed_use_declaration                { $$ = $1; }
     388          87 :         |       T_NS_SEPARATOR unprefixed_use_declaration { $$ = $2; }
     389          15 : ;
     390             : 
     391             : const_list:
     392           2 :                 const_list ',' const_decl { $$ = zend_ast_list_add($1, $3); }
     393           2 :         |       const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CONST_DECL, $1); }
     394         266 : ;
     395             : 
     396             : inner_statement_list:
     397             :                 inner_statement_list inner_statement
     398      264308 :                         { $$ = zend_ast_list_add($1, $2); }
     399      264308 :         |       /* empty */
     400      126941 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     401      126941 : ;
     402             : 
     403             : 
     404             : inner_statement:
     405      258743 :                 statement { $$ = $1; }
     406      258743 :         |       function_declaration_statement          { $$ = $1; }
     407        4618 :         |       class_declaration_statement             { $$ = $1; }
     408         947 :         |       trait_declaration_statement                     { $$ = $1; }
     409           0 :         |       interface_declaration_statement         { $$ = $1; }
     410           0 :         |       T_HALT_COMPILER '(' ')' ';'
     411           1 :                         { $$ = NULL; zend_error_noreturn(E_COMPILE_ERROR,
     412             :                               "__HALT_COMPILER() can only be used from the outermost scope"); }
     413             : ;
     414             : 
     415             : 
     416             : statement:
     417       81666 :                 '{' inner_statement_list '}' { $$ = $2; }
     418       81666 :         |       if_stmt { $$ = $1; }
     419       76473 :         |       alt_if_stmt { $$ = $1; }
     420           4 :         |       T_WHILE '(' expr ')' while_statement
     421        2021 :                         { $$ = zend_ast_create(ZEND_AST_WHILE, $3, $5); }
     422        2021 :         |       T_DO statement T_WHILE '(' expr ')' ';'
     423         299 :                         { $$ = zend_ast_create(ZEND_AST_DO_WHILE, $2, $5); }
     424         299 :         |       T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement
     425        2165 :                         { $$ = zend_ast_create(ZEND_AST_FOR, $3, $5, $7, $9); }
     426        2165 :         |       T_SWITCH '(' expr ')' switch_case_list
     427         473 :                         { $$ = zend_ast_create(ZEND_AST_SWITCH, $3, $5); }
     428         473 :         |       T_BREAK optional_expr ';'               { $$ = zend_ast_create(ZEND_AST_BREAK, $2); }
     429        1929 :         |       T_CONTINUE optional_expr ';'    { $$ = zend_ast_create(ZEND_AST_CONTINUE, $2); }
     430         274 :         |       T_RETURN optional_expr ';'              { $$ = zend_ast_create(ZEND_AST_RETURN, $2); }
     431       44819 :         |       T_GLOBAL global_var_list ';'    { $$ = $2; }
     432        4214 :         |       T_STATIC static_var_list ';'    { $$ = $2; }
     433        2075 :         |       T_ECHO echo_expr_list ';'               { $$ = $2; }
     434       33401 :         |       T_INLINE_HTML { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     435        3889 :         |       expr ';' { $$ = $1; }
     436      286654 :         |       T_UNSET '(' unset_variables ')' ';' { $$ = $3; }
     437        1527 :         |       T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement
     438        6428 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $5, NULL, $7); }
     439        6428 :         |       T_FOREACH '(' expr T_AS foreach_variable T_DOUBLE_ARROW foreach_variable ')'
     440             :                 foreach_statement
     441        5128 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $7, $5, $9); }
     442        5128 :         |       T_DECLARE '(' const_list ')'
     443          68 :                         { zend_handle_encoding_declaration($3); }
     444          64 :                 declare_statement
     445          64 :                         { $$ = zend_ast_create(ZEND_AST_DECLARE, $3, $6); }
     446          64 :         |       ';'     /* empty statement */ { $$ = NULL; }
     447       30867 :         |       T_TRY '{' inner_statement_list '}' catch_list finally_statement
     448        2724 :                         { $$ = zend_ast_create(ZEND_AST_TRY, $3, $5, $6); }
     449        2724 :         |       T_THROW expr ';' { $$ = zend_ast_create(ZEND_AST_THROW, $2); }
     450         391 :         |       T_GOTO T_STRING ';' { $$ = zend_ast_create(ZEND_AST_GOTO, $2); }
     451          45 :         |       T_STRING ':' { $$ = zend_ast_create(ZEND_AST_LABEL, $1); }
     452          48 : ;
     453             : 
     454             : catch_list:
     455             :                 /* empty */
     456        2724 :                         { $$ = zend_ast_create_list(0, ZEND_AST_CATCH_LIST); }
     457        2724 :         |       catch_list T_CATCH '(' name T_VARIABLE ')' '{' inner_statement_list '}'
     458        2666 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_CATCH, $4, $5, $8)); }
     459        2666 : ;
     460             : 
     461             : finally_statement:
     462        2615 :                 /* empty */ { $$ = NULL; }
     463        2615 :         |       T_FINALLY '{' inner_statement_list '}' { $$ = $3; }
     464         109 : ;
     465             : 
     466             : unset_variables:
     467        1527 :                 unset_variable { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     468        1527 :         |       unset_variables ',' unset_variable { $$ = zend_ast_list_add($1, $3); }
     469         118 : ;
     470             : 
     471             : unset_variable:
     472        1645 :                 variable { $$ = zend_ast_create(ZEND_AST_UNSET, $1); }
     473        1645 : ;
     474             : 
     475             : function_declaration_statement:
     476             :         function returns_ref T_STRING '(' parameter_list ')' return_type
     477             :         backup_doc_comment '{' inner_statement_list '}'
     478       94080 :                 { $$ = zend_ast_create_decl(ZEND_AST_FUNC_DECL, $2, $1, $8,
     479       75264 :                       zend_ast_get_str($3), $5, NULL, $10, $7); }
     480       18816 : ;
     481             : 
     482             : is_reference:
     483       84791 :                 /* empty */     { $$ = 0; }
     484       84791 :         |       '&'                 { $$ = ZEND_PARAM_REF; }
     485        1104 : ;
     486             : 
     487             : is_variadic:
     488       85853 :                 /* empty */ { $$ = 0; }
     489       85853 :         |       T_ELLIPSIS  { $$ = ZEND_PARAM_VARIADIC; }
     490          42 : ;
     491             : 
     492             : class_declaration_statement:
     493         116 :                 class_modifiers T_CLASS { $<num>$ = CG(zend_lineno); }
     494         116 :                 T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
     495         232 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, $1, $<num>3, $7, zend_ast_get_str($4), $5, $6, $9, NULL); }
     496         116 :         |       T_CLASS { $<num>$ = CG(zend_lineno); }
     497        7351 :                 T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
     498       14666 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, 0, $<num>2, $6, zend_ast_get_str($3), $4, $5, $8, NULL); }
     499        7333 : ;
     500             : 
     501             : class_modifiers:
     502         118 :                 class_modifier                                  { $$ = $1; }
     503         118 :         |       class_modifiers class_modifier  { $$ = zend_add_class_modifier($1, $2); }
     504           0 : ;
     505             : 
     506             : class_modifier:
     507         101 :                 T_ABSTRACT              { $$ = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
     508         101 :         |       T_FINAL                 { $$ = ZEND_ACC_FINAL; }
     509          19 : ;
     510             : 
     511             : trait_declaration_statement:
     512         238 :                 T_TRAIT { $<num>$ = CG(zend_lineno); }
     513         238 :                 T_STRING backup_doc_comment '{' class_statement_list '}'
     514         472 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, ZEND_ACC_TRAIT, $<num>2, $4, zend_ast_get_str($3), NULL, NULL, $6, NULL); }
     515         236 : ;
     516             : 
     517             : interface_declaration_statement:
     518         209 :                 T_INTERFACE { $<num>$ = CG(zend_lineno); }
     519         209 :                 T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}'
     520         416 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, ZEND_ACC_INTERFACE, $<num>2, $5, zend_ast_get_str($3), NULL, $4, $7, NULL); }
     521         208 : ;
     522             : 
     523             : extends_from:
     524        5053 :                 /* empty */             { $$ = NULL; }
     525        5053 :         |       T_EXTENDS name  { $$ = $2; }
     526        2433 : ;
     527             : 
     528             : interface_extends_list:
     529         170 :                 /* empty */                     { $$ = NULL; }
     530         170 :         |       T_EXTENDS name_list     { $$ = $2; }
     531          38 : ;
     532             : 
     533             : implements_list:
     534        7163 :                 /* empty */                             { $$ = NULL; }
     535        7163 :         |       T_IMPLEMENTS name_list  { $$ = $2; }
     536         322 : ;
     537             : 
     538             : foreach_variable:
     539       16565 :                 variable                        { $$ = $1; }
     540       16565 :         |       '&' variable                { $$ = zend_ast_create(ZEND_AST_REF, $2); }
     541         108 :         |       T_LIST '(' assignment_list ')' { $$ = $3; }
     542          11 : ;
     543             : 
     544             : for_statement:
     545        2162 :                 statement { $$ = $1; }
     546        2162 :         |       ':' inner_statement_list T_ENDFOR ';' { $$ = $2; }
     547           3 : ;
     548             : 
     549             : foreach_statement:
     550       11556 :                 statement { $$ = $1; }
     551       11556 :         |       ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; }
     552           0 : ;
     553             : 
     554             : declare_statement:
     555          64 :                 statement { $$ = $1; }
     556          64 :         |       ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; }
     557           0 : ;
     558             : 
     559             : switch_case_list:
     560         472 :                 '{' case_list '}'                                       { $$ = $2; }
     561         472 :         |       '{' ';' case_list '}'                           { $$ = $3; }
     562           0 :         |       ':' case_list T_ENDSWITCH ';'           { $$ = $2; }
     563           1 :         |       ':' ';' case_list T_ENDSWITCH ';'       { $$ = $3; }
     564           0 : ;
     565             : 
     566             : case_list:
     567         473 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_SWITCH_LIST); }
     568         473 :         |       case_list T_CASE expr case_separator inner_statement_list
     569        1607 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, $3, $5)); }
     570        1607 :         |       case_list T_DEFAULT case_separator inner_statement_list
     571         280 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, NULL, $4)); }
     572         280 : ;
     573             : 
     574             : case_separator:
     575             :                 ':'
     576             :         |       ';'
     577             : ;
     578             : 
     579             : 
     580             : while_statement:
     581        2020 :                 statement { $$ = $1; }
     582        2020 :         |       ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; }
     583           1 : ;
     584             : 
     585             : 
     586             : if_stmt_without_else:
     587             :                 T_IF '(' expr ')' statement
     588      152946 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     589       76473 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $5)); }
     590       76473 :         |       if_stmt_without_else T_ELSEIF '(' expr ')' statement
     591        3852 :                         { $$ = zend_ast_list_add($1,
     592        1926 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $6)); }
     593        1926 : ;
     594             : 
     595             : if_stmt:
     596       56062 :                 if_stmt_without_else %prec T_NOELSE { $$ = $1; }
     597       56062 :         |       if_stmt_without_else T_ELSE statement
     598       20411 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_IF_ELEM, NULL, $3)); }
     599       20411 : ;
     600             : 
     601             : alt_if_stmt_without_else:
     602             :                 T_IF '(' expr ')' ':' inner_statement_list
     603           8 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     604           4 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $6)); }
     605           4 :         |       alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list
     606           2 :                         { $$ = zend_ast_list_add($1,
     607           1 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $7)); }
     608           1 : ;
     609             : 
     610             : alt_if_stmt:
     611           2 :                 alt_if_stmt_without_else T_ENDIF ';' { $$ = $1; }
     612           2 :         |       alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';'
     613           2 :                         { $$ = zend_ast_list_add($1,
     614           2 :                               zend_ast_create(ZEND_AST_IF_ELEM, NULL, $4)); }
     615           2 : ;
     616             : 
     617             : parameter_list:
     618       28277 :                 non_empty_parameter_list { $$ = $1; }
     619       28277 :         |       /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_PARAM_LIST); }
     620        9789 : ;
     621             : 
     622             : 
     623             : non_empty_parameter_list:
     624             :                 parameter
     625       28277 :                         { $$ = zend_ast_create_list(1, ZEND_AST_PARAM_LIST, $1); }
     626       28277 :         |       non_empty_parameter_list ',' parameter
     627       57618 :                         { $$ = zend_ast_list_add($1, $3); }
     628       57618 : ;
     629             : 
     630             : parameter:
     631             :                 optional_type is_reference is_variadic T_VARIABLE
     632       70987 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, NULL); }
     633       70987 :         |       optional_type is_reference is_variadic T_VARIABLE '=' expr
     634       14908 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, $6); }
     635       14908 : ;
     636             : 
     637             : 
     638             : optional_type:
     639       85349 :                 /* empty */     { $$ = NULL; }
     640       85349 :         |       type            { $$ = $1; }
     641         546 : ;
     642             : 
     643             : type:
     644         257 :                 T_ARRAY         { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_ARRAY); }
     645         257 :         |       T_CALLABLE      { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_CALLABLE); }
     646          16 :         |       name            { $$ = $1; }
     647         393 : ;
     648             : 
     649             : return_type:
     650       37944 :                 /* empty */     { $$ = NULL; }
     651       37944 :         |       ':' type        { $$ = $2; }
     652         120 : ;
     653             : 
     654             : argument_list:
     655       40200 :                 '(' ')' { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
     656       40200 :         |       '(' non_empty_argument_list ')' { $$ = $2; }
     657      301255 : ;
     658             : 
     659             : non_empty_argument_list:
     660             :                 argument
     661      301255 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARG_LIST, $1); }
     662      301255 :         |       non_empty_argument_list ',' argument
     663      280163 :                         { $$ = zend_ast_list_add($1, $3); }
     664      280163 : ;
     665             : 
     666             : argument:
     667      581349 :                 expr                    { $$ = $1; }
     668      581349 :         |       T_ELLIPSIS expr { $$ = zend_ast_create(ZEND_AST_UNPACK, $2); }
     669          69 : ;
     670             : 
     671             : global_var_list:
     672         943 :                 global_var_list ',' global_var { $$ = zend_ast_list_add($1, $3); }
     673         943 :         |       global_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     674        4215 : ;
     675             : 
     676             : global_var:
     677             :         simple_variable
     678        5158 :                 { $$ = zend_ast_create(ZEND_AST_GLOBAL, zend_ast_create(ZEND_AST_VAR, $1)); }
     679        5158 : ;
     680             : 
     681             : 
     682             : static_var_list:
     683           9 :                 static_var_list ',' static_var { $$ = zend_ast_list_add($1, $3); }
     684           9 :         |       static_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     685        2075 : ;
     686             : 
     687             : static_var:
     688          21 :                 T_VARIABLE                      { $$ = zend_ast_create(ZEND_AST_STATIC, $1, NULL); }
     689          21 :         |       T_VARIABLE '=' expr     { $$ = zend_ast_create(ZEND_AST_STATIC, $1, $3); }
     690        2063 : ;
     691             : 
     692             : 
     693             : class_statement_list:
     694             :                 class_statement_list class_statement
     695       21939 :                         { $$ = zend_ast_list_add($1, $2); }
     696       21939 :         |       /* empty */
     697        7927 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     698        7927 : ;
     699             : 
     700             : 
     701             : class_statement:
     702             :                 variable_modifiers property_list ';'
     703        2613 :                         { $$ = $2; $$->attr = $1; }
     704        2613 :         |       method_modifiers T_CONST class_const_list ';'
     705         371 :                         { $$ = $3; $$->attr = $1; }
     706         371 :         |       T_USE name_list trait_adaptations
     707         223 :                         { $$ = zend_ast_create(ZEND_AST_USE_TRAIT, $2, $3); }
     708         223 :         |       method_modifiers function returns_ref identifier '(' parameter_list ')'
     709             :                 return_type backup_doc_comment method_body
     710       74928 :                         { $$ = zend_ast_create_decl(ZEND_AST_METHOD, $3 | $1, $2, $9,
     711       56196 :                                   zend_ast_get_str($4), $6, NULL, $10, $8); }
     712       18732 : ;
     713             : 
     714             : name_list:
     715         606 :                 name { $$ = zend_ast_create_list(1, ZEND_AST_NAME_LIST, $1); }
     716         606 :         |       name_list ',' name { $$ = zend_ast_list_add($1, $3); }
     717          86 : ;
     718             : 
     719             : trait_adaptations:
     720         156 :                 ';'                                                             { $$ = NULL; }
     721         156 :         |       '{' '}'                                                 { $$ = NULL; }
     722           0 :         |       '{' trait_adaptation_list '}'   { $$ = $2; }
     723          67 : ;
     724             : 
     725             : trait_adaptation_list:
     726             :                 trait_adaptation
     727          67 :                         { $$ = zend_ast_create_list(1, ZEND_AST_TRAIT_ADAPTATIONS, $1); }
     728          67 :         |       trait_adaptation_list trait_adaptation
     729          35 :                         { $$ = zend_ast_list_add($1, $2); }
     730          35 : ;
     731             : 
     732             : trait_adaptation:
     733          23 :                 trait_precedence ';'    { $$ = $1; }
     734          23 :         |       trait_alias ';'                 { $$ = $1; }
     735          79 : ;
     736             : 
     737             : trait_precedence:
     738             :         absolute_trait_method_reference T_INSTEADOF name_list
     739          23 :                 { $$ = zend_ast_create(ZEND_AST_TRAIT_PRECEDENCE, $1, $3); }
     740          23 : ;
     741             : 
     742             : trait_alias:
     743             :                 trait_method_reference T_AS T_STRING
     744          52 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, 0, $1, $3); }
     745          52 :         |       trait_method_reference T_AS reserved_non_modifiers
     746           6 :                         { zval zv; zend_lex_tstring(&zv); $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, 0, $1, zend_ast_create_zval(&zv)); }
     747           3 :         |       trait_method_reference T_AS member_modifier identifier
     748           9 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, $4); }
     749           9 :         |       trait_method_reference T_AS member_modifier
     750          15 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, NULL); }
     751          15 : ;
     752             : 
     753             : trait_method_reference:
     754             :                 identifier
     755          45 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, NULL, $1); }
     756          45 :         |       absolute_trait_method_reference { $$ = $1; }
     757          34 : ;
     758             : 
     759             : absolute_trait_method_reference:
     760             :         name T_PAAMAYIM_NEKUDOTAYIM identifier
     761          57 :                 { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, $1, $3); }
     762          57 : ;
     763             : 
     764             : method_body:
     765         191 :                 ';' /* abstract method */               { $$ = NULL; }
     766         191 :         |       '{' inner_statement_list '}'    { $$ = $2; }
     767       18541 : ;
     768             : 
     769             : variable_modifiers:
     770        2418 :                 non_empty_member_modifiers              { $$ = $1; }
     771        2418 :         |       T_VAR                                                   { $$ = ZEND_ACC_PUBLIC; }
     772         195 : ;
     773             : 
     774             : method_modifiers:
     775        7473 :                 /* empty */                                             { $$ = ZEND_ACC_PUBLIC; }
     776        7473 :         |       non_empty_member_modifiers
     777       11632 :                         { $$ = $1; if (!($$ & ZEND_ACC_PPP_MASK)) { $$ |= ZEND_ACC_PUBLIC; } }
     778       11632 : ;
     779             : 
     780             : non_empty_member_modifiers:
     781       14061 :                 member_modifier                 { $$ = $1; }
     782       14061 :         |       non_empty_member_modifiers member_modifier
     783         801 :                         { $$ = zend_add_member_modifier($1, $2); }
     784         790 : ;
     785             : 
     786             : member_modifier:
     787        4887 :                 T_PUBLIC                                { $$ = ZEND_ACC_PUBLIC; }
     788        4887 :         |       T_PROTECTED                             { $$ = ZEND_ACC_PROTECTED; }
     789         609 :         |       T_PRIVATE                               { $$ = ZEND_ACC_PRIVATE; }
     790        1196 :         |       T_STATIC                                { $$ = ZEND_ACC_STATIC; }
     791        8087 :         |       T_ABSTRACT                              { $$ = ZEND_ACC_ABSTRACT; }
     792          79 :         |       T_FINAL                                 { $$ = ZEND_ACC_FINAL; }
     793          28 : ;
     794             : 
     795             : property_list:
     796          49 :                 property_list ',' property { $$ = zend_ast_list_add($1, $3); }
     797          49 :         |       property { $$ = zend_ast_create_list(1, ZEND_AST_PROP_DECL, $1); }
     798        2613 : ;
     799             : 
     800             : property:
     801             :                 T_VARIABLE backup_doc_comment
     802        1254 :                         { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, NULL, ($2 ? zend_ast_create_zval_from_str($2) : NULL)); }
     803        1213 :         |       T_VARIABLE '=' expr backup_doc_comment
     804        1461 :                         { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, $3, ($4 ? zend_ast_create_zval_from_str($4) : NULL)); }
     805        1449 : ;
     806             : 
     807             : class_const_list:
     808           7 :                 class_const_list ',' class_const_decl { $$ = zend_ast_list_add($1, $3); }
     809           7 :         |       class_const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CLASS_CONST_DECL, $1); }
     810         371 : ;
     811             : 
     812             : class_const_decl:
     813         386 :         identifier '=' expr backup_doc_comment { $$ = zend_ast_create(ZEND_AST_CONST_ELEM, $1, $3, ($4 ? zend_ast_create_zval_from_str($4) : NULL)); }
     814         378 : ;
     815             : 
     816             : const_decl:
     817         268 :         T_STRING '=' expr backup_doc_comment { $$ = zend_ast_create(ZEND_AST_CONST_ELEM, $1, $3, ($4 ? zend_ast_create_zval_from_str($4) : NULL)); }
     818         268 : ;
     819             : 
     820             : echo_expr_list:
     821        2033 :                 echo_expr_list ',' echo_expr { $$ = zend_ast_list_add($1, $3); }
     822        2033 :         |       echo_expr { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     823       33401 : ;
     824             : echo_expr:
     825       35434 :         expr { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     826       35434 : ;
     827             : 
     828             : for_exprs:
     829           7 :                 /* empty */                     { $$ = NULL; }
     830           7 :         |       non_empty_for_exprs     { $$ = $1; }
     831        6488 : ;
     832             : 
     833             : non_empty_for_exprs:
     834           9 :                 non_empty_for_exprs ',' expr { $$ = zend_ast_list_add($1, $3); }
     835           9 :         |       expr { $$ = zend_ast_create_list(1, ZEND_AST_EXPR_LIST, $1); }
     836        6488 : ;
     837             : 
     838             : anonymous_class:
     839          21 :         T_CLASS { $<num>$ = CG(zend_lineno); } ctor_arguments
     840          21 :                 extends_from implements_list backup_doc_comment '{' class_statement_list '}' {
     841         105 :                         zend_ast *decl = zend_ast_create_decl(
     842          42 :                                 ZEND_AST_CLASS, ZEND_ACC_ANON_CLASS, $<num>2, $6, NULL,
     843          84 :                                 $4, $5, $8, NULL);
     844          21 :                         $$ = zend_ast_create(ZEND_AST_NEW, decl, $3);
     845             :                 }
     846          21 : ;
     847             : 
     848             : new_expr:
     849             :                 T_NEW class_name_reference ctor_arguments
     850       15114 :                         { $$ = zend_ast_create(ZEND_AST_NEW, $2, $3); }
     851       15114 :         |       T_NEW anonymous_class
     852          21 :                         { $$ = $2; }
     853          21 : ;
     854             : 
     855             : expr_without_variable:
     856             :                 T_LIST '(' assignment_list ')' '=' expr
     857         153 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $3, $6); }
     858         153 :         |       variable '=' expr
     859      152073 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $1, $3); }
     860      152073 :         |       variable '=' '&' variable
     861         452 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
     862         452 :         |       T_CLONE expr { $$ = zend_ast_create(ZEND_AST_CLONE, $2); }
     863         121 :         |       variable T_PLUS_EQUAL expr
     864        1434 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_ADD, $1, $3); }
     865         717 :         |       variable T_MINUS_EQUAL expr
     866         280 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SUB, $1, $3); }
     867         140 :         |       variable T_MUL_EQUAL expr
     868          32 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MUL, $1, $3); }
     869          16 :         |       variable T_POW_EQUAL expr
     870           6 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_POW, $1, $3); }
     871           3 :         |       variable T_DIV_EQUAL expr
     872          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_DIV, $1, $3); }
     873           5 :         |       variable T_CONCAT_EQUAL expr
     874        6036 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_CONCAT, $1, $3); }
     875        3018 :         |       variable T_MOD_EQUAL expr
     876          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MOD, $1, $3); }
     877           5 :         |       variable T_AND_EQUAL expr
     878          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_AND, $1, $3); }
     879           5 :         |       variable T_OR_EQUAL expr
     880         196 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_OR, $1, $3); }
     881          98 :         |       variable T_XOR_EQUAL expr
     882          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_XOR, $1, $3); }
     883           5 :         |       variable T_SL_EQUAL expr
     884          14 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SL, $1, $3); }
     885           7 :         |       variable T_SR_EQUAL expr
     886          24 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SR, $1, $3); }
     887          12 :         |       variable T_INC { $$ = zend_ast_create(ZEND_AST_POST_INC, $1); }
     888        5741 :         |       T_INC variable { $$ = zend_ast_create(ZEND_AST_PRE_INC, $2); }
     889         545 :         |       variable T_DEC { $$ = zend_ast_create(ZEND_AST_POST_DEC, $1); }
     890          88 :         |       T_DEC variable { $$ = zend_ast_create(ZEND_AST_PRE_DEC, $2); }
     891          17 :         |       expr T_BOOLEAN_OR expr
     892        4609 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     893        4609 :         |       expr T_BOOLEAN_AND expr
     894        7830 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     895        7830 :         |       expr T_LOGICAL_OR expr
     896         917 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     897         917 :         |       expr T_LOGICAL_AND expr
     898          14 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     899          14 :         |       expr T_LOGICAL_XOR expr
     900           4 :                         { $$ = zend_ast_create_binary_op(ZEND_BOOL_XOR, $1, $3); }
     901        1653 :         |       expr '|' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_OR, $1, $3); }
     902        1950 :         |       expr '&' expr       { $$ = zend_ast_create_binary_op(ZEND_BW_AND, $1, $3); }
     903         323 :         |       expr '^' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_XOR, $1, $3); }
     904       45162 :         |       expr '.' expr   { $$ = zend_ast_create_binary_op(ZEND_CONCAT, $1, $3); }
     905       50891 :         |       expr '+' expr   { $$ = zend_ast_create_binary_op(ZEND_ADD, $1, $3); }
     906        6919 :         |       expr '-' expr   { $$ = zend_ast_create_binary_op(ZEND_SUB, $1, $3); }
     907        4044 :         |       expr '*' expr   { $$ = zend_ast_create_binary_op(ZEND_MUL, $1, $3); }
     908        2890 :         |       expr T_POW expr { $$ = zend_ast_create_binary_op(ZEND_POW, $1, $3); }
     909         549 :         |       expr '/' expr   { $$ = zend_ast_create_binary_op(ZEND_DIV, $1, $3); }
     910         666 :         |       expr '%' expr   { $$ = zend_ast_create_binary_op(ZEND_MOD, $1, $3); }
     911         271 :         |       expr T_SL expr  { $$ = zend_ast_create_binary_op(ZEND_SL, $1, $3); }
     912         213 :         |       expr T_SR expr  { $$ = zend_ast_create_binary_op(ZEND_SR, $1, $3); }
     913          71 :         |       '+' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_PLUS, $2); }
     914         254 :         |       '-' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_MINUS, $2); }
     915        6581 :         |       '!' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BOOL_NOT, $2); }
     916       32510 :         |       '~' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BW_NOT, $2); }
     917          91 :         |       expr T_IS_IDENTICAL expr
     918       12862 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_IDENTICAL, $1, $3); }
     919        6431 :         |       expr T_IS_NOT_IDENTICAL expr
     920       17260 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_IDENTICAL, $1, $3); }
     921        8630 :         |       expr T_IS_EQUAL expr
     922       34088 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_EQUAL, $1, $3); }
     923       17044 :         |       expr T_IS_NOT_EQUAL expr
     924        5818 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_EQUAL, $1, $3); }
     925        2909 :         |       expr '<' expr
     926        4484 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER, $1, $3); }
     927        2242 :         |       expr T_IS_SMALLER_OR_EQUAL expr
     928        3526 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER_OR_EQUAL, $1, $3); }
     929        1763 :         |       expr '>' expr
     930         912 :                         { $$ = zend_ast_create(ZEND_AST_GREATER, $1, $3); }
     931         912 :         |       expr T_IS_GREATER_OR_EQUAL expr
     932         608 :                         { $$ = zend_ast_create(ZEND_AST_GREATER_EQUAL, $1, $3); }
     933         608 :         |       expr T_SPACESHIP expr
     934          20 :                         { $$ = zend_ast_create_binary_op(ZEND_SPACESHIP, $1, $3); }
     935          10 :         |       expr T_INSTANCEOF class_name_reference
     936          74 :                         { $$ = zend_ast_create(ZEND_AST_INSTANCEOF, $1, $3); }
     937          74 :         |       '(' expr ')' { $$ = $2; }
     938       26925 :         |       new_expr { $$ = $1; }
     939       15135 :         |       expr '?' expr ':' expr
     940       25356 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, $3, $5); }
     941       25356 :         |       expr '?' ':' expr
     942         206 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, NULL, $4); }
     943         206 :         |       expr T_COALESCE expr
     944          20 :                         { $$ = zend_ast_create(ZEND_AST_COALESCE, $1, $3); }
     945          20 :         |       internal_functions_in_yacc { $$ = $1; }
     946       31613 :         |       T_INT_CAST expr         { $$ = zend_ast_create_cast(IS_LONG, $2); }
     947        4916 :         |       T_DOUBLE_CAST expr      { $$ = zend_ast_create_cast(IS_DOUBLE, $2); }
     948        1378 :         |       T_STRING_CAST expr      { $$ = zend_ast_create_cast(IS_STRING, $2); }
     949        1368 :         |       T_ARRAY_CAST expr       { $$ = zend_ast_create_cast(IS_ARRAY, $2); }
     950         204 :         |       T_OBJECT_CAST expr      { $$ = zend_ast_create_cast(IS_OBJECT, $2); }
     951         246 :         |       T_BOOL_CAST expr        { $$ = zend_ast_create_cast(_IS_BOOL, $2); }
     952          72 :         |       T_UNSET_CAST expr       { $$ = zend_ast_create_cast(IS_NULL, $2); }
     953           0 :         |       T_EXIT exit_expr        { $$ = zend_ast_create(ZEND_AST_EXIT, $2); }
     954       16543 :         |       '@' expr                        { $$ = zend_ast_create(ZEND_AST_SILENCE, $2); }
     955        7066 :         |       scalar { $$ = $1; }
     956      716890 :         |       '`' backticks_expr '`' { $$ = zend_ast_create(ZEND_AST_SHELL_EXEC, $2); }
     957         120 :         |       T_PRINT expr { $$ = zend_ast_create(ZEND_AST_PRINT, $2); }
     958        3436 :         |       T_YIELD { $$ = zend_ast_create(ZEND_AST_YIELD, NULL, NULL); }
     959          75 :         |       T_YIELD expr { $$ = zend_ast_create(ZEND_AST_YIELD, $2, NULL); }
     960         131 :         |       T_YIELD expr T_DOUBLE_ARROW expr { $$ = zend_ast_create(ZEND_AST_YIELD, $4, $2); }
     961          33 :         |       T_YIELD_FROM expr { $$ = zend_ast_create(ZEND_AST_YIELD_FROM, $2); }
     962          36 :         |       function returns_ref '(' parameter_list ')' lexical_vars return_type
     963             :                 backup_doc_comment '{' inner_statement_list '}'
     964        2505 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $2, $1, $8,
     965             :                                   zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     966        2004 :                               $4, $6, $10, $7); }
     967         501 :         |       T_STATIC function returns_ref '(' parameter_list ')' lexical_vars
     968             :                 return_type backup_doc_comment '{' inner_statement_list '}'
     969          55 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $3 | ZEND_ACC_STATIC, $2, $9,
     970             :                               zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     971          44 :                               $5, $7, $11, $8); }
     972          11 : ;
     973             : 
     974             : function:
     975       38067 :         T_FUNCTION { $$ = CG(zend_lineno); }
     976       38067 : ;
     977             : 
     978             : backup_doc_comment:
     979       49303 :         /* empty */ { $$ = CG(doc_comment); CG(doc_comment) = NULL; }
     980       49303 : ;
     981             : 
     982             : returns_ref:
     983       37976 :                 /* empty */     { $$ = 0; }
     984       37976 :         |       '&'                 { $$ = ZEND_ACC_RETURN_REFERENCE; }
     985          91 : ;
     986             : 
     987             : lexical_vars:
     988         329 :                 /* empty */ { $$ = NULL; }
     989         329 :         |       T_USE '(' lexical_var_list ')' { $$ = $3; }
     990         183 : ;
     991             : 
     992             : lexical_var_list:
     993          11 :                 lexical_var_list ',' lexical_var { $$ = zend_ast_list_add($1, $3); }
     994          11 :         |       lexical_var { $$ = zend_ast_create_list(1, ZEND_AST_CLOSURE_USES, $1); }
     995         183 : ;
     996             : 
     997             : lexical_var:
     998         160 :                 T_VARIABLE              { $$ = $1; }
     999         160 :         |       '&' T_VARIABLE      { $$ = $2; $$->attr = 1; }
    1000          34 : ;
    1001             : 
    1002             : function_call:
    1003             :                 name argument_list
    1004      277321 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
    1005      277321 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
    1006       11433 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
    1007       11433 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
    1008          43 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
    1009          43 :         |       callable_expr argument_list
    1010        2168 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
    1011        2168 : ;
    1012             : 
    1013             : class_name:
    1014             :                 T_STATIC
    1015         158 :                         { zval zv; ZVAL_STRINGL(&zv, "static", sizeof("static")-1);
    1016          79 :                           $$ = zend_ast_create_zval_ex(&zv, ZEND_NAME_NOT_FQ); }
    1017          79 :         |       name { $$ = $1; }
    1018       36641 : ;
    1019             : 
    1020             : class_name_reference:
    1021       13846 :                 class_name              { $$ = $1; }
    1022       13846 :         |       new_variable    { $$ = $1; }
    1023        1342 : ;
    1024             : 
    1025             : exit_expr:
    1026         430 :                 /* empty */                             { $$ = NULL; }
    1027         430 :         |       '(' optional_expr ')'   { $$ = $2; }
    1028       16113 : ;
    1029             : 
    1030             : backticks_expr:
    1031             :                 /* empty */
    1032           0 :                         { $$ = zend_ast_create_zval_from_str(ZSTR_EMPTY_ALLOC()); }
    1033           0 :         |       T_ENCAPSED_AND_WHITESPACE { $$ = $1; }
    1034           7 :         |       encaps_list { $$ = $1; }
    1035         113 : ;
    1036             : 
    1037             : 
    1038             : ctor_arguments:
    1039        2922 :                 /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
    1040        2922 :         |       argument_list { $$ = $1; }
    1041       12213 : ;
    1042             : 
    1043             : 
    1044             : dereferencable_scalar:
    1045       27982 :                 T_ARRAY '(' array_pair_list ')' { $$ = $3; }
    1046       27982 :         |       '[' array_pair_list ']'                 { $$ = $2; }
    1047        1035 :         |       T_CONSTANT_ENCAPSED_STRING              { $$ = $1; }
    1048      378564 : ;
    1049             : 
    1050             : scalar:
    1051      174864 :                 T_LNUMBER       { $$ = $1; }
    1052      174864 :         |       T_DNUMBER       { $$ = $1; }
    1053        6724 :         |       T_LINE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_LINE); }
    1054          22 :         |       T_FILE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FILE); }
    1055        9583 :         |       T_DIR           { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_DIR); }
    1056         604 :         |       T_TRAIT_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_TRAIT_C); }
    1057           5 :         |       T_METHOD_C      { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_METHOD_C); }
    1058         987 :         |       T_FUNC_C        { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FUNC_C); }
    1059         132 :         |       T_NS_C          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_NS_C); }
    1060          36 :         |       T_CLASS_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C); }
    1061          95 :         |       T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = $2; }
    1062        1377 :         |       T_START_HEREDOC T_END_HEREDOC
    1063         118 :                         { $$ = zend_ast_create_zval_from_str(ZSTR_EMPTY_ALLOC()); }
    1064          59 :         |       '"' encaps_list '"'   { $$ = $2; }
    1065       17592 :         |       T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; }
    1066         147 :         |       dereferencable_scalar   { $$ = $1; }
    1067      407544 :         |       constant                        { $$ = $1; }
    1068       97119 : ;
    1069             : 
    1070             : constant:
    1071       86456 :                 name { $$ = zend_ast_create(ZEND_AST_CONST, $1); }
    1072       86456 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM identifier
    1073       10668 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
    1074       10668 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier
    1075           8 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
    1076           8 : ;
    1077             : 
    1078             : possible_comma:
    1079             :                 /* empty */
    1080             :         |       ','
    1081             : ;
    1082             : 
    1083             : expr:
    1084      752923 :                 variable                                        { $$ = $1; }
    1085      752923 :         |       expr_without_variable           { $$ = $1; }
    1086     1160203 : ;
    1087             : 
    1088             : optional_expr:
    1089        3008 :                 /* empty */     { $$ = NULL; }
    1090        3008 :         |       expr            { $$ = $1; }
    1091      188423 : ;
    1092             : 
    1093             : variable_class_name:
    1094          70 :         dereferencable { $$ = $1; }
    1095          70 : ;
    1096             : 
    1097             : dereferencable:
    1098      177240 :                 variable                                { $$ = $1; }
    1099      177240 :         |       '(' expr ')'                    { $$ = $2; }
    1100          84 :         |       dereferencable_scalar   { $$ = $1; }
    1101          31 : ;
    1102             : 
    1103             : callable_expr:
    1104        2133 :                 callable_variable               { $$ = $1; }
    1105        2133 :         |       '(' expr ')'                    { $$ = $2; }
    1106          29 :         |       dereferencable_scalar   { $$ = $1; }
    1107           6 : ;
    1108             : 
    1109             : callable_variable:
    1110             :                 simple_variable
    1111      646916 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1112      646916 :         |       dereferencable '[' optional_expr ']'
    1113      128268 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1114      128268 :         |       constant '[' optional_expr ']'
    1115          12 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1116          12 :         |       dereferencable '{' expr '}'
    1117          25 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1118          25 :         |       dereferencable T_OBJECT_OPERATOR property_name argument_list
    1119       38277 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_CALL, $1, $3, $4); }
    1120       38277 :         |       function_call { $$ = $1; }
    1121      290965 : ;
    1122             : 
    1123             : variable:
    1124             :                 callable_variable
    1125     1102330 :                         { $$ = $1; }
    1126     1102330 :         |       static_member
    1127         790 :                         { $$ = $1; }
    1128         790 :         |       dereferencable T_OBJECT_OPERATOR property_name
    1129       10715 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1130       10715 : ;
    1131             : 
    1132             : simple_variable:
    1133      654363 :                 T_VARIABLE                      { $$ = $1; }
    1134      654363 :         |       '$' '{' expr '}'        { $$ = $3; }
    1135          56 :         |       '$' simple_variable     { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1136         169 : ;
    1137             : 
    1138             : static_member:
    1139             :                 class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1140         772 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1141         772 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1142          18 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1143          18 : ;
    1144             : 
    1145             : new_variable:
    1146             :                 simple_variable
    1147        1341 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1148        1341 :         |       new_variable '[' optional_expr ']'
    1149          11 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1150          11 :         |       new_variable '{' expr '}'
    1151           1 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1152           1 :         |       new_variable T_OBJECT_OPERATOR property_name
    1153           4 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1154           4 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1155           1 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1156           1 :         |       new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1157           2 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1158           2 : ;
    1159             : 
    1160             : member_name:
    1161       11433 :                 identifier { $$ = $1; }
    1162       11433 :         |       '{' expr '}'    { $$ = $2; }
    1163           9 :         |       simple_variable { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1164          34 : ;
    1165             : 
    1166             : property_name:
    1167       48750 :                 T_STRING { $$ = $1; }
    1168       48750 :         |       '{' expr '}'    { $$ = $2; }
    1169          69 :         |       simple_variable { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1170         177 : ;
    1171             : 
    1172             : assignment_list:
    1173             :                 assignment_list ',' assignment_list_element
    1174         246 :                         { $$ = zend_ast_list_add($1, $3); }
    1175         246 :         |       assignment_list_element
    1176         185 :                         { $$ = zend_ast_create_list(1, ZEND_AST_LIST, $1); }
    1177         185 : ;
    1178             : 
    1179             : assignment_list_element:
    1180         378 :                 variable                                                { $$ = $1; }
    1181         378 :         |       T_LIST '(' assignment_list ')'  { $$ = $3; }
    1182          21 :         |       /* empty */                                             { $$ = NULL; }
    1183          32 : ;
    1184             : 
    1185             : 
    1186             : array_pair_list:
    1187        3447 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_ARRAY); }
    1188        3447 :         |       non_empty_array_pair_list possible_comma { $$ = $1; }
    1189       25571 : ;
    1190             : 
    1191             : non_empty_array_pair_list:
    1192             :                 non_empty_array_pair_list ',' array_pair
    1193       80145 :                         { $$ = zend_ast_list_add($1, $3); }
    1194       80145 :         |       array_pair
    1195       25571 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARRAY, $1); }
    1196       25571 : ;
    1197             : 
    1198             : array_pair:
    1199             :                 expr T_DOUBLE_ARROW expr
    1200       28156 :                         { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $3, $1); }
    1201       28156 :         |       expr { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $1, NULL); }
    1202       77404 :         |       expr T_DOUBLE_ARROW '&' variable
    1203          62 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $4, $1); }
    1204          62 :         |       '&' variable
    1205          94 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $2, NULL); }
    1206          94 : ;
    1207             : 
    1208             : encaps_list:
    1209             :                 encaps_list encaps_var
    1210        7610 :                         { $$ = zend_ast_list_add($1, $2); }
    1211        7610 :         |       encaps_list T_ENCAPSED_AND_WHITESPACE
    1212       17896 :                         { $$ = zend_ast_list_add($1, $2); }
    1213       17896 :         |       encaps_var
    1214        5198 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ENCAPS_LIST, $1); }
    1215        5198 :         |       T_ENCAPSED_AND_WHITESPACE encaps_var
    1216       12655 :                         { $$ = zend_ast_create_list(2, ZEND_AST_ENCAPS_LIST, $1, $2); }
    1217       12655 : ;
    1218             : 
    1219             : encaps_var:
    1220             :                 T_VARIABLE
    1221       22590 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1222       22590 :         |       T_VARIABLE '[' encaps_var_offset ']'
    1223        1974 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1224        1974 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1225         987 :         |       T_VARIABLE T_OBJECT_OPERATOR T_STRING
    1226         176 :                         { $$ = zend_ast_create(ZEND_AST_PROP,
    1227          88 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1228          88 :         |       T_DOLLAR_OPEN_CURLY_BRACES expr '}'
    1229           4 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1230           4 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}'
    1231         376 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1232         376 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}'
    1233           0 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1234           0 :                               zend_ast_create(ZEND_AST_VAR, $2), $4); }
    1235           0 :         |       T_CURLY_OPEN variable '}' { $$ = $2; }
    1236        1418 : ;
    1237             : 
    1238             : encaps_var_offset:
    1239           4 :                 T_STRING                { $$ = $1; }
    1240           4 :         |       T_NUM_STRING    { $$ = $1; }
    1241         389 :         |       T_VARIABLE              { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1242         594 : ;
    1243             : 
    1244             : 
    1245             : internal_functions_in_yacc:
    1246        5703 :                 T_ISSET '(' isset_variables ')' { $$ = $3; }
    1247        5703 :         |       T_EMPTY '(' expr ')' { $$ = zend_ast_create(ZEND_AST_EMPTY, $3); }
    1248        7912 :         |       T_INCLUDE expr
    1249        2492 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE, $2); }
    1250        2492 :         |       T_INCLUDE_ONCE expr
    1251         512 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE_ONCE, $2); }
    1252         512 :         |       T_EVAL '(' expr ')'
    1253        2320 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_EVAL, $3); }
    1254        2320 :         |       T_REQUIRE expr
    1255        2236 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE, $2); }
    1256        2236 :         |       T_REQUIRE_ONCE expr
    1257        5562 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE_ONCE, $2); }
    1258        5562 : ;
    1259             : 
    1260             : isset_variables:
    1261        5703 :                 isset_variable { $$ = $1; }
    1262        5703 :         |       isset_variables ',' isset_variable
    1263          44 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
    1264          44 : ;
    1265             : 
    1266             : isset_variable:
    1267        5747 :                 expr { $$ = zend_ast_create(ZEND_AST_ISSET, $1); }
    1268             : ;
    1269             : 
    1270             : %%
    1271             : 
    1272             : /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
    1273             :    quotes and backslashes, so that it's suitable for yyerror.  The
    1274             :    heuristic is that double-quoting is unnecessary unless the string
    1275             :    contains an apostrophe, a comma, or backslash (other than
    1276             :    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
    1277             :    null, do not copy; instead, return the length of what the result
    1278             :    would have been.  */
    1279         560 : static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
    1280             : {
    1281             :         /* CG(parse_error) states:
    1282             :          * 0 => yyres = NULL, yystr is the unexpected token
    1283             :          * 1 => yyres = NULL, yystr is one of the expected tokens
    1284             :          * 2 => yyres != NULL, yystr is the unexpected token
    1285             :          * 3 => yyres != NULL, yystr is one of the expected tokens
    1286             :          */
    1287         560 :         if (yyres && CG(parse_error) < 2) {
    1288          52 :                 CG(parse_error) = 2;
    1289             :         }
    1290             : 
    1291         560 :         if (CG(parse_error) % 2 == 0) {
    1292             :                 /* The unexpected token */
    1293             :                 char buffer[120];
    1294         104 :                 const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
    1295         104 :                 unsigned int len = 0, toklen = 0, yystr_len;
    1296             : 
    1297         104 :                 CG(parse_error)++;
    1298             : 
    1299         124 :                 if (LANG_SCNG(yy_text)[0] == 0 &&
    1300          10 :                         LANG_SCNG(yy_leng) == 1 &&
    1301          10 :                         memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
    1302          10 :                         if (yyres) {
    1303           5 :                                 yystpcpy(yyres, "end of file");
    1304             :                         }
    1305          10 :                         return sizeof("end of file")-1;
    1306             :                 }
    1307             : 
    1308          94 :                 str = LANG_SCNG(yy_text);
    1309          94 :                 end = memchr(str, '\n', LANG_SCNG(yy_leng));
    1310          94 :                 yystr_len = (unsigned int)yystrlen(yystr);
    1311             : 
    1312         202 :                 if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
    1313          54 :                         && (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
    1314          54 :                         toklen = (tok2 - tok1) + 1;
    1315             :                 } else {
    1316          40 :                         tok1 = tok2 = NULL;
    1317          40 :                         toklen = 0;
    1318             :                 }
    1319             : 
    1320          94 :                 if (end == NULL) {
    1321          92 :                         len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
    1322             :                 } else {
    1323           2 :                         len = (end - str) > 30 ? 30 : (end - str);
    1324             :                 }
    1325          94 :                 if (yyres) {
    1326          47 :                         if (toklen) {
    1327          27 :                                 snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
    1328             :                         } else {
    1329          20 :                                 snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
    1330             :                         }
    1331          47 :                         yystpcpy(yyres, buffer);
    1332             :                 }
    1333          94 :                 return len + (toklen ? toklen + 1 : 0) + 2;
    1334             :         }
    1335             : 
    1336             :         /* One of the expected tokens */
    1337         456 :         if (!yyres) {
    1338         396 :                 return yystrlen(yystr) - (*yystr == '"' ? 2 : 0);
    1339             :         }
    1340             : 
    1341          60 :         if (*yystr == '"') {
    1342          31 :                 YYSIZE_T yyn = 0;
    1343          31 :                 const char *yyp = yystr;
    1344             : 
    1345         624 :                 for (; *++yyp != '"'; ++yyn) {
    1346         593 :                         yyres[yyn] = *yyp;
    1347             :                 }
    1348          31 :                 yyres[yyn] = '\0';
    1349          31 :                 return yyn;
    1350             :         }
    1351          29 :         yystpcpy(yyres, yystr);
    1352          29 :         return strlen(yystr);
    1353             : }
    1354             : 
    1355             : /*
    1356             :  * Local variables:
    1357             :  * tab-width: 4
    1358             :  * c-basic-offset: 4
    1359             :  * indent-tabs-mode: t
    1360             :  * End:
    1361             :  */

Generated by: LCOV version 1.10

Generated at Sun, 29 May 2016 00:48:20 +0000 (43 hours ago)

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