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: 698 712 98.0 %
Date: 2015-09-02 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : %{
       2             : /*
       3             :    +----------------------------------------------------------------------+
       4             :    | Zend Engine                                                          |
       5             :    +----------------------------------------------------------------------+
       6             :    | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
       7             :    +----------------------------------------------------------------------+
       8             :    | This source file is subject to version 2.00 of the Zend license,     |
       9             :    | that is bundled with this package in the file LICENSE, and is        |
      10             :    | available through the world-wide-web at the following url:           |
      11             :    | http://www.zend.com/license/2_00.txt.                                |
      12             :    | If you did not receive a copy of the Zend license and are unable to  |
      13             :    | obtain it through the world-wide-web, please send a note to          |
      14             :    | license@zend.com so we can mail you a copy immediately.              |
      15             :    +----------------------------------------------------------------------+
      16             :    | Authors: Andi Gutmans <andi@zend.com>                                |
      17             :    |          Zeev Suraski <zeev@zend.com>                                |
      18             :    |          Nikita Popov <nikic@php.net>                                |
      19             :    +----------------------------------------------------------------------+
      20             : */
      21             : 
      22             : /* $Id$ */
      23             : 
      24             : #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       30224 :         top_statement_list      { CG(ast) = $1; }
     266       30224 : ;
     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             : ;
     276             : 
     277             : semi_reserved:
     278             :           reserved_non_modifiers
     279             :         | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC
     280             : ;
     281             : 
     282             : identifier:
     283       37728 :                 T_STRING { $$ = $1; }
     284       37728 :         |       semi_reserved  {
     285             :                         zval zv;
     286         434 :                         zend_lex_tstring(&zv);
     287         434 :                         $$ = zend_ast_create_zval(&zv);
     288             :                 }
     289         434 : ;
     290             : 
     291             : top_statement_list:
     292      217279 :                 top_statement_list top_statement { $$ = zend_ast_list_add($1, $2); }
     293      217279 :         |       /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     294       30403 : ;
     295             : 
     296             : namespace_name:
     297      367034 :                 T_STRING                                                                { $$ = $1; }
     298      367034 :         |       namespace_name T_NS_SEPARATOR T_STRING  { $$ = zend_ast_append_str($1, $3); }
     299         440 : ;
     300             : 
     301             : name:
     302      366353 :                 namespace_name                                                          { $$ = $1; $$->attr = ZEND_NAME_NOT_FQ; }
     303      366353 :         |       T_NAMESPACE T_NS_SEPARATOR namespace_name       { $$ = $3; $$->attr = ZEND_NAME_RELATIVE; }
     304          57 :         |       T_NS_SEPARATOR namespace_name                           { $$ = $2; $$->attr = ZEND_NAME_FQ; }
     305         253 : ;
     306             : 
     307             : top_statement:
     308      195939 :                 statement                                                       { $$ = $1; }
     309      195939 :         |       function_declaration_statement          { $$ = $1; }
     310       13907 :         |       class_declaration_statement                     { $$ = $1; }
     311        6174 :         |       trait_declaration_statement                     { $$ = $1; }
     312         231 :         |       interface_declaration_statement         { $$ = $1; }
     313         204 :         |       T_HALT_COMPILER '(' ')' ';'
     314         554 :                         { $$ = zend_ast_create(ZEND_AST_HALT_COMPILER,
     315         277 :                               zend_ast_create_zval_from_long(zend_get_scanned_file_offset()));
     316         277 :                           zend_stop_lexing(); }
     317         277 :         |       T_NAMESPACE namespace_name ';'
     318         146 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, NULL);
     319         146 :                           RESET_DOC_COMMENT(); }
     320         147 :         |       T_NAMESPACE namespace_name { RESET_DOC_COMMENT(); }
     321          63 :                 '{' top_statement_list '}'
     322          60 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, $5); }
     323          60 :         |       T_NAMESPACE { RESET_DOC_COMMENT(); }
     324          39 :                 '{' top_statement_list '}'
     325          39 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, NULL, $4); }
     326          39 :         |       T_USE mixed_group_use_declaration ';'           { $$ = $2; }
     327          10 :         |       T_USE use_type group_use_declaration ';'        { $$ = $3; $$->attr = $2; }
     328           4 :         |       T_USE use_declarations ';'                                      { $$ = $2; $$->attr = T_CLASS; }
     329          62 :         |       T_USE use_type use_declarations ';'                     { $$ = $3; $$->attr = $2; }
     330          31 :         |       T_CONST const_list ';'                                          { $$ = $2; }
     331         195 : ;
     332             : 
     333             : use_type:
     334          23 :                 T_FUNCTION              { $$ = T_FUNCTION; }
     335          23 :         |       T_CONST                 { $$ = T_CONST; }
     336          22 : ;
     337             : 
     338             : group_use_declaration:
     339             :                 namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}'
     340           2 :                         { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $1, $4); }
     341           2 :         |       T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}'
     342           2 :                         { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $2, $5); }
     343           2 : ;
     344             : 
     345             : mixed_group_use_declaration:
     346             :                 namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}'
     347           9 :                         { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $1, $4);}
     348           9 :         |       T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}'
     349           1 :                         { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $2, $5); }
     350           1 : ;
     351             : 
     352             : inline_use_declarations:
     353             :                 inline_use_declarations ',' inline_use_declaration
     354          19 :                         { $$ = zend_ast_list_add($1, $3); }
     355          19 :         |       inline_use_declaration
     356          11 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     357          11 : ;
     358             : 
     359             : unprefixed_use_declarations:
     360             :                 unprefixed_use_declarations ',' unprefixed_use_declaration
     361           9 :                         { $$ = zend_ast_list_add($1, $3); }
     362           9 :         |       unprefixed_use_declaration
     363           5 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     364           5 : ;
     365             : 
     366             : use_declarations:
     367             :                 use_declarations ',' use_declaration
     368           8 :                         { $$ = zend_ast_list_add($1, $3); }
     369           8 :         |       use_declaration
     370          93 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     371          93 : ;
     372             : 
     373             : inline_use_declaration:
     374          21 :                 unprefixed_use_declaration { $$ = $1; $$->attr = T_CLASS; }
     375          21 :         |       use_type unprefixed_use_declaration { $$ = $2; $$->attr = $1; }
     376           9 : ;
     377             : 
     378             : unprefixed_use_declaration:
     379             :                 namespace_name
     380          84 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, NULL); }
     381          84 :         |       namespace_name T_AS T_STRING
     382          61 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, $3); }
     383          61 : ;
     384             : 
     385             : use_declaration:
     386          86 :                 unprefixed_use_declaration                { $$ = $1; }
     387          86 :         |       T_NS_SEPARATOR unprefixed_use_declaration { $$ = $2; }
     388          15 : ;
     389             : 
     390             : const_list:
     391           2 :                 const_list ',' const_decl { $$ = zend_ast_list_add($1, $3); }
     392           2 :         |       const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CONST_DECL, $1); }
     393         263 : ;
     394             : 
     395             : inner_statement_list:
     396             :                 inner_statement_list inner_statement
     397      235651 :                         { $$ = zend_ast_list_add($1, $2); }
     398      235651 :         |       /* empty */
     399      113008 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     400      113008 : ;
     401             : 
     402             : 
     403             : inner_statement:
     404      230658 :                 statement { $$ = $1; }
     405      230658 :         |       function_declaration_statement          { $$ = $1; }
     406        4055 :         |       class_declaration_statement             { $$ = $1; }
     407         938 :         |       trait_declaration_statement                     { $$ = $1; }
     408           0 :         |       interface_declaration_statement         { $$ = $1; }
     409           0 :         |       T_HALT_COMPILER '(' ')' ';'
     410           1 :                         { $$ = NULL; zend_error_noreturn(E_COMPILE_ERROR,
     411             :                               "__HALT_COMPILER() can only be used from the outermost scope"); }
     412             : ;
     413             : 
     414             : 
     415             : statement:
     416       70150 :                 '{' inner_statement_list '}' { $$ = $2; }
     417       70150 :         |       if_stmt { $$ = $1; }
     418       67744 :         |       alt_if_stmt { $$ = $1; }
     419           4 :         |       T_WHILE '(' expr ')' while_statement
     420        1872 :                         { $$ = zend_ast_create(ZEND_AST_WHILE, $3, $5); }
     421        1872 :         |       T_DO statement T_WHILE '(' expr ')' ';'
     422         296 :                         { $$ = zend_ast_create(ZEND_AST_DO_WHILE, $2, $5); }
     423         296 :         |       T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement
     424        2073 :                         { $$ = zend_ast_create(ZEND_AST_FOR, $3, $5, $7, $9); }
     425        2073 :         |       T_SWITCH '(' expr ')' switch_case_list
     426         458 :                         { $$ = zend_ast_create(ZEND_AST_SWITCH, $3, $5); }
     427         458 :         |       T_BREAK optional_expr ';'               { $$ = zend_ast_create(ZEND_AST_BREAK, $2); }
     428        1901 :         |       T_CONTINUE optional_expr ';'    { $$ = zend_ast_create(ZEND_AST_CONTINUE, $2); }
     429         274 :         |       T_RETURN optional_expr ';'              { $$ = zend_ast_create(ZEND_AST_RETURN, $2); }
     430       43741 :         |       T_GLOBAL global_var_list ';'    { $$ = $2; }
     431        4188 :         |       T_STATIC static_var_list ';'    { $$ = $2; }
     432        1892 :         |       T_ECHO echo_expr_list ';'               { $$ = $2; }
     433       30757 :         |       T_INLINE_HTML { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     434        3619 :         |       expr ';' { $$ = $1; }
     435      255868 :         |       T_UNSET '(' unset_variables ')' ';' { $$ = $3; }
     436        1436 :         |       T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement
     437        5425 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $5, NULL, $7); }
     438        5425 :         |       T_FOREACH '(' expr T_AS foreach_variable T_DOUBLE_ARROW foreach_variable ')'
     439             :                 foreach_statement
     440        4743 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $7, $5, $9); }
     441        4743 :         |       T_DECLARE '(' const_list ')'
     442          68 :                         { zend_handle_encoding_declaration($3); }
     443          64 :                 declare_statement
     444          64 :                         { $$ = zend_ast_create(ZEND_AST_DECLARE, $3, $6); }
     445          64 :         |       ';'     /* empty statement */ { $$ = NULL; }
     446       28034 :         |       T_TRY '{' inner_statement_list '}' catch_list finally_statement
     447        2451 :                         { $$ = zend_ast_create(ZEND_AST_TRY, $3, $5, $6); }
     448        2451 :         |       T_THROW expr ';' { $$ = zend_ast_create(ZEND_AST_THROW, $2); }
     449         362 :         |       T_GOTO T_STRING ';' { $$ = zend_ast_create(ZEND_AST_GOTO, $2); }
     450          41 :         |       T_STRING ':' { $$ = zend_ast_create(ZEND_AST_LABEL, $1); }
     451          42 : ;
     452             : 
     453             : catch_list:
     454             :                 /* empty */
     455        2451 :                         { $$ = zend_ast_create_list(0, ZEND_AST_CATCH_LIST); }
     456        2451 :         |       catch_list T_CATCH '(' name T_VARIABLE ')' '{' inner_statement_list '}'
     457        2406 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_CATCH, $4, $5, $8)); }
     458        2406 : ;
     459             : 
     460             : finally_statement:
     461        2362 :                 /* empty */ { $$ = NULL; }
     462        2362 :         |       T_FINALLY '{' inner_statement_list '}' { $$ = $3; }
     463          89 : ;
     464             : 
     465             : unset_variables:
     466        1436 :                 unset_variable { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     467        1436 :         |       unset_variables ',' unset_variable { $$ = zend_ast_list_add($1, $3); }
     468         118 : ;
     469             : 
     470             : unset_variable:
     471        1554 :                 variable { $$ = zend_ast_create(ZEND_AST_UNSET, $1); }
     472        1554 : ;
     473             : 
     474             : function_declaration_statement:
     475             :         function returns_ref T_STRING '(' parameter_list ')' return_type
     476             :         backup_doc_comment '{' inner_statement_list '}'
     477       89810 :                 { $$ = zend_ast_create_decl(ZEND_AST_FUNC_DECL, $2, $1, $8,
     478       71848 :                       zend_ast_get_str($3), $5, NULL, $10, $7); }
     479       17962 : ;
     480             : 
     481             : is_reference:
     482       82309 :                 /* empty */     { $$ = 0; }
     483       82309 :         |       '&'                 { $$ = ZEND_PARAM_REF; }
     484        1079 : ;
     485             : 
     486             : is_variadic:
     487       83346 :                 /* empty */ { $$ = 0; }
     488       83346 :         |       T_ELLIPSIS  { $$ = ZEND_PARAM_VARIADIC; }
     489          42 : ;
     490             : 
     491             : class_declaration_statement:
     492         112 :                 class_modifiers T_CLASS { $<num>$ = CG(zend_lineno); }
     493         112 :                 T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
     494         224 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, $1, $<num>3, $7, zend_ast_get_str($4), $5, $6, $9, NULL); }
     495         112 :         |       T_CLASS { $<num>$ = CG(zend_lineno); }
     496        7018 :                 T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
     497       14000 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, 0, $<num>2, $6, zend_ast_get_str($3), $4, $5, $8, NULL); }
     498        7000 : ;
     499             : 
     500             : class_modifiers:
     501         114 :                 class_modifier                                  { $$ = $1; }
     502         114 :         |       class_modifiers class_modifier  { $$ = zend_add_class_modifier($1, $2); }
     503           0 : ;
     504             : 
     505             : class_modifier:
     506          97 :                 T_ABSTRACT              { $$ = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
     507          97 :         |       T_FINAL                 { $$ = ZEND_ACC_FINAL; }
     508          19 : ;
     509             : 
     510             : trait_declaration_statement:
     511         233 :                 T_TRAIT { $<num>$ = CG(zend_lineno); }
     512         233 :                 T_STRING backup_doc_comment '{' class_statement_list '}'
     513         462 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, ZEND_ACC_TRAIT, $<num>2, $4, zend_ast_get_str($3), NULL, NULL, $6, NULL); }
     514         231 : ;
     515             : 
     516             : interface_declaration_statement:
     517         205 :                 T_INTERFACE { $<num>$ = CG(zend_lineno); }
     518         205 :                 T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}'
     519         408 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, ZEND_ACC_INTERFACE, $<num>2, $5, zend_ast_get_str($3), NULL, $4, $7, NULL); }
     520         204 : ;
     521             : 
     522             : extends_from:
     523        4764 :                 /* empty */             { $$ = NULL; }
     524        4764 :         |       T_EXTENDS name  { $$ = $2; }
     525        2382 : ;
     526             : 
     527             : interface_extends_list:
     528         166 :                 /* empty */                     { $$ = NULL; }
     529         166 :         |       T_EXTENDS name_list     { $$ = $2; }
     530          38 : ;
     531             : 
     532             : implements_list:
     533        6833 :                 /* empty */                             { $$ = NULL; }
     534        6833 :         |       T_IMPLEMENTS name_list  { $$ = $2; }
     535         312 : ;
     536             : 
     537             : foreach_variable:
     538       14796 :                 variable                        { $$ = $1; }
     539       14796 :         |       '&' variable                { $$ = zend_ast_create(ZEND_AST_REF, $2); }
     540         106 :         |       T_LIST '(' assignment_list ')' { $$ = $3; }
     541           9 : ;
     542             : 
     543             : for_statement:
     544        2070 :                 statement { $$ = $1; }
     545        2070 :         |       ':' inner_statement_list T_ENDFOR ';' { $$ = $2; }
     546           3 : ;
     547             : 
     548             : foreach_statement:
     549       10168 :                 statement { $$ = $1; }
     550       10168 :         |       ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; }
     551           0 : ;
     552             : 
     553             : declare_statement:
     554          64 :                 statement { $$ = $1; }
     555          64 :         |       ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; }
     556           0 : ;
     557             : 
     558             : switch_case_list:
     559         457 :                 '{' case_list '}'                                       { $$ = $2; }
     560         457 :         |       '{' ';' case_list '}'                           { $$ = $3; }
     561           0 :         |       ':' case_list T_ENDSWITCH ';'           { $$ = $2; }
     562           1 :         |       ':' ';' case_list T_ENDSWITCH ';'       { $$ = $3; }
     563           0 : ;
     564             : 
     565             : case_list:
     566         458 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_SWITCH_LIST); }
     567         458 :         |       case_list T_CASE expr case_separator inner_statement_list
     568        1606 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, $3, $5)); }
     569        1606 :         |       case_list T_DEFAULT case_separator inner_statement_list
     570         273 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, NULL, $4)); }
     571         273 : ;
     572             : 
     573             : case_separator:
     574             :                 ':'
     575             :         |       ';'
     576             : ;
     577             : 
     578             : 
     579             : while_statement:
     580        1871 :                 statement { $$ = $1; }
     581        1871 :         |       ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; }
     582           1 : ;
     583             : 
     584             : 
     585             : if_stmt_without_else:
     586             :                 T_IF '(' expr ')' statement
     587      135488 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     588       67744 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $5)); }
     589       67744 :         |       if_stmt_without_else T_ELSEIF '(' expr ')' statement
     590        3498 :                         { $$ = zend_ast_list_add($1,
     591        1749 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $6)); }
     592        1749 : ;
     593             : 
     594             : if_stmt:
     595       50868 :                 if_stmt_without_else %prec T_NOELSE { $$ = $1; }
     596       50868 :         |       if_stmt_without_else T_ELSE statement
     597       16876 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_IF_ELEM, NULL, $3)); }
     598       16876 : ;
     599             : 
     600             : alt_if_stmt_without_else:
     601             :                 T_IF '(' expr ')' ':' inner_statement_list
     602           8 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     603           4 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $6)); }
     604           4 :         |       alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list
     605           2 :                         { $$ = zend_ast_list_add($1,
     606           1 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $7)); }
     607           1 : ;
     608             : 
     609             : alt_if_stmt:
     610           2 :                 alt_if_stmt_without_else T_ENDIF ';' { $$ = $1; }
     611           2 :         |       alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';'
     612           2 :                         { $$ = zend_ast_list_add($1,
     613           2 :                               zend_ast_create(ZEND_AST_IF_ELEM, NULL, $4)); }
     614           2 : ;
     615             : 
     616             : parameter_list:
     617       26841 :                 non_empty_parameter_list { $$ = $1; }
     618       26841 :         |       /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_PARAM_LIST); }
     619        9368 : ;
     620             : 
     621             : 
     622             : non_empty_parameter_list:
     623             :                 parameter
     624       26841 :                         { $$ = zend_ast_create_list(1, ZEND_AST_PARAM_LIST, $1); }
     625       26841 :         |       non_empty_parameter_list ',' parameter
     626       56547 :                         { $$ = zend_ast_list_add($1, $3); }
     627       56547 : ;
     628             : 
     629             : parameter:
     630             :                 optional_type is_reference is_variadic T_VARIABLE
     631       68946 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, NULL); }
     632       68946 :         |       optional_type is_reference is_variadic T_VARIABLE '=' expr
     633       14442 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, $6); }
     634       14442 : ;
     635             : 
     636             : 
     637             : optional_type:
     638       82852 :                 /* empty */     { $$ = NULL; }
     639       82852 :         |       type            { $$ = $1; }
     640         536 : ;
     641             : 
     642             : type:
     643         250 :                 T_ARRAY         { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_ARRAY); }
     644         250 :         |       T_CALLABLE      { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_CALLABLE); }
     645          15 :         |       name            { $$ = $1; }
     646         375 : ;
     647             : 
     648             : return_type:
     649       36103 :                 /* empty */     { $$ = NULL; }
     650       36103 :         |       ':' type        { $$ = $2; }
     651         104 : ;
     652             : 
     653             : argument_list:
     654       37892 :                 '(' ')' { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
     655       37892 :         |       '(' non_empty_argument_list ')' { $$ = $2; }
     656      271198 : ;
     657             : 
     658             : non_empty_argument_list:
     659             :                 argument
     660      271199 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARG_LIST, $1); }
     661      271199 :         |       non_empty_argument_list ',' argument
     662      263673 :                         { $$ = zend_ast_list_add($1, $3); }
     663      263673 : ;
     664             : 
     665             : argument:
     666      534803 :                 expr                    { $$ = $1; }
     667      534803 :         |       T_ELLIPSIS expr { $$ = zend_ast_create(ZEND_AST_UNPACK, $2); }
     668          69 : ;
     669             : 
     670             : global_var_list:
     671         939 :                 global_var_list ',' global_var { $$ = zend_ast_list_add($1, $3); }
     672         939 :         |       global_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     673        4189 : ;
     674             : 
     675             : global_var:
     676             :         simple_variable
     677        5128 :                 { $$ = zend_ast_create(ZEND_AST_GLOBAL, zend_ast_create(ZEND_AST_VAR, $1)); }
     678        5128 : ;
     679             : 
     680             : 
     681             : static_var_list:
     682           9 :                 static_var_list ',' static_var { $$ = zend_ast_list_add($1, $3); }
     683           9 :         |       static_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     684        1892 : ;
     685             : 
     686             : static_var:
     687          21 :                 T_VARIABLE                      { $$ = zend_ast_create(ZEND_AST_STATIC, $1, NULL); }
     688          21 :         |       T_VARIABLE '=' expr     { $$ = zend_ast_create(ZEND_AST_STATIC, $1, $3); }
     689        1880 : ;
     690             : 
     691             : 
     692             : class_statement_list:
     693             :                 class_statement_list class_statement
     694       20863 :                         { $$ = zend_ast_list_add($1, $2); }
     695       20863 :         |       /* empty */
     696        7578 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     697        7578 : ;
     698             : 
     699             : 
     700             : class_statement:
     701             :                 variable_modifiers property_list ';'
     702        2540 :                         { $$ = zend_ast_append_doc_comment($2); $$->attr = $1; }
     703        2540 :         |       T_CONST class_const_list ';'
     704         330 :                         { $$ = $2; RESET_DOC_COMMENT(); }
     705         328 :         |       T_USE name_list trait_adaptations
     706         218 :                         { $$ = zend_ast_create(ZEND_AST_USE_TRAIT, $2, $3); }
     707         218 :         |       method_modifiers function returns_ref identifier '(' parameter_list ')'
     708             :                 return_type backup_doc_comment method_body
     709       71108 :                         { $$ = zend_ast_create_decl(ZEND_AST_METHOD, $3 | $1, $2, $9,
     710       53331 :                                   zend_ast_get_str($4), $6, NULL, $10, $8); }
     711       17777 : ;
     712             : 
     713             : name_list:
     714         591 :                 name { $$ = zend_ast_create_list(1, ZEND_AST_NAME_LIST, $1); }
     715         591 :         |       name_list ',' name { $$ = zend_ast_list_add($1, $3); }
     716          86 : ;
     717             : 
     718             : trait_adaptations:
     719         151 :                 ';'                                                             { $$ = NULL; }
     720         151 :         |       '{' '}'                                                 { $$ = NULL; }
     721           0 :         |       '{' trait_adaptation_list '}'   { $$ = $2; }
     722          67 : ;
     723             : 
     724             : trait_adaptation_list:
     725             :                 trait_adaptation
     726          67 :                         { $$ = zend_ast_create_list(1, ZEND_AST_TRAIT_ADAPTATIONS, $1); }
     727          67 :         |       trait_adaptation_list trait_adaptation
     728          35 :                         { $$ = zend_ast_list_add($1, $2); }
     729          35 : ;
     730             : 
     731             : trait_adaptation:
     732          23 :                 trait_precedence ';'    { $$ = $1; }
     733          23 :         |       trait_alias ';'                 { $$ = $1; }
     734          79 : ;
     735             : 
     736             : trait_precedence:
     737             :         absolute_trait_method_reference T_INSTEADOF name_list
     738          23 :                 { $$ = zend_ast_create(ZEND_AST_TRAIT_PRECEDENCE, $1, $3); }
     739          23 : ;
     740             : 
     741             : trait_alias:
     742             :                 trait_method_reference T_AS T_STRING
     743          52 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, 0, $1, $3); }
     744          52 :         |       trait_method_reference T_AS reserved_non_modifiers
     745           6 :                         { zval zv; zend_lex_tstring(&zv); $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, 0, $1, zend_ast_create_zval(&zv)); }
     746           3 :         |       trait_method_reference T_AS member_modifier identifier
     747           9 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, $4); }
     748           9 :         |       trait_method_reference T_AS member_modifier
     749          15 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, NULL); }
     750          15 : ;
     751             : 
     752             : trait_method_reference:
     753             :                 identifier
     754          45 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, NULL, $1); }
     755          45 :         |       absolute_trait_method_reference { $$ = $1; }
     756          34 : ;
     757             : 
     758             : absolute_trait_method_reference:
     759             :         name T_PAAMAYIM_NEKUDOTAYIM identifier
     760          57 :                 { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, $1, $3); }
     761          57 : ;
     762             : 
     763             : method_body:
     764         190 :                 ';' /* abstract method */               { $$ = NULL; }
     765         190 :         |       '{' inner_statement_list '}'    { $$ = $2; }
     766       17587 : ;
     767             : 
     768             : variable_modifiers:
     769        2365 :                 non_empty_member_modifiers              { $$ = $1; }
     770        2365 :         |       T_VAR                                                   { $$ = ZEND_ACC_PUBLIC; }
     771         175 : ;
     772             : 
     773             : method_modifiers:
     774        7030 :                 /* empty */                                             { $$ = ZEND_ACC_PUBLIC; }
     775        7030 :         |       non_empty_member_modifiers
     776       10748 :                         { $$ = $1; if (!($$ & ZEND_ACC_PPP_MASK)) { $$ |= ZEND_ACC_PUBLIC; } }
     777       10748 : ;
     778             : 
     779             : non_empty_member_modifiers:
     780       13124 :                 member_modifier                 { $$ = $1; }
     781       13124 :         |       non_empty_member_modifiers member_modifier
     782         785 :                         { $$ = zend_add_member_modifier($1, $2); }
     783         774 : ;
     784             : 
     785             : member_modifier:
     786        4762 :                 T_PUBLIC                                { $$ = ZEND_ACC_PUBLIC; }
     787        4762 :         |       T_PROTECTED                             { $$ = ZEND_ACC_PROTECTED; }
     788         588 :         |       T_PRIVATE                               { $$ = ZEND_ACC_PRIVATE; }
     789        1183 :         |       T_STATIC                                { $$ = ZEND_ACC_STATIC; }
     790        7295 :         |       T_ABSTRACT                              { $$ = ZEND_ACC_ABSTRACT; }
     791          78 :         |       T_FINAL                                 { $$ = ZEND_ACC_FINAL; }
     792          27 : ;
     793             : 
     794             : property_list:
     795          44 :                 property_list ',' property { $$ = zend_ast_list_add($1, $3); }
     796          44 :         |       property { $$ = zend_ast_create_list(1, ZEND_AST_PROP_DECL, $1); }
     797        2540 : ;
     798             : 
     799             : property:
     800        1189 :                 T_VARIABLE { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, NULL); }
     801        1189 :         |       T_VARIABLE '=' expr
     802        1395 :                         { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, $3); }
     803        1395 : ;
     804             : 
     805             : class_const_list:
     806           7 :                 class_const_list ',' class_const_decl { $$ = zend_ast_list_add($1, $3); }
     807           7 :         |       class_const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CLASS_CONST_DECL, $1); }
     808         328 : ;
     809             : 
     810             : class_const_decl:
     811         335 :         identifier '=' expr { $$ = zend_ast_create(ZEND_AST_CONST_ELEM, $1, $3); }
     812         335 : ;
     813             : 
     814             : const_decl:
     815         265 :         T_STRING '=' expr { $$ = zend_ast_create(ZEND_AST_CONST_ELEM, $1, $3); }
     816         265 : ;
     817             : 
     818             : echo_expr_list:
     819        1899 :                 echo_expr_list ',' echo_expr { $$ = zend_ast_list_add($1, $3); }
     820        1899 :         |       echo_expr { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     821       30757 : ;
     822             : echo_expr:
     823       32656 :         expr { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     824       32656 : ;
     825             : 
     826             : for_exprs:
     827           7 :                 /* empty */                     { $$ = NULL; }
     828           7 :         |       non_empty_for_exprs     { $$ = $1; }
     829        6212 : ;
     830             : 
     831             : non_empty_for_exprs:
     832           9 :                 non_empty_for_exprs ',' expr { $$ = zend_ast_list_add($1, $3); }
     833           9 :         |       expr { $$ = zend_ast_create_list(1, ZEND_AST_EXPR_LIST, $1); }
     834        6212 : ;
     835             : 
     836             : anonymous_class:
     837          18 :         T_CLASS { $<num>$ = CG(zend_lineno); } ctor_arguments
     838          18 :                 extends_from implements_list backup_doc_comment '{' class_statement_list '}' {
     839          90 :                         zend_ast *decl = zend_ast_create_decl(
     840          36 :                                 ZEND_AST_CLASS, ZEND_ACC_ANON_CLASS, $<num>2, $6, NULL,
     841          72 :                                 $4, $5, $8, NULL);
     842          18 :                         $$ = zend_ast_create(ZEND_AST_NEW, decl, $3);
     843             :                 }
     844          18 : ;
     845             : 
     846             : new_expr:
     847             :                 T_NEW class_name_reference ctor_arguments
     848       14583 :                         { $$ = zend_ast_create(ZEND_AST_NEW, $2, $3); }
     849       14583 :         |       T_NEW anonymous_class
     850          18 :                         { $$ = $2; }
     851          18 : ;
     852             : 
     853             : expr_without_variable:
     854             :                 T_LIST '(' assignment_list ')' '=' expr
     855         152 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $3, $6); }
     856         152 :         |       variable '=' expr
     857      131627 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $1, $3); }
     858      131627 :         |       variable '=' '&' variable
     859         429 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
     860         429 :         |       T_CLONE expr { $$ = zend_ast_create(ZEND_AST_CLONE, $2); }
     861         118 :         |       variable T_PLUS_EQUAL expr
     862        1414 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_ADD, $1, $3); }
     863         707 :         |       variable T_MINUS_EQUAL expr
     864         278 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SUB, $1, $3); }
     865         139 :         |       variable T_MUL_EQUAL expr
     866          32 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MUL, $1, $3); }
     867          16 :         |       variable T_POW_EQUAL expr
     868           4 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_POW, $1, $3); }
     869           2 :         |       variable T_DIV_EQUAL expr
     870          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_DIV, $1, $3); }
     871           5 :         |       variable T_CONCAT_EQUAL expr
     872        5564 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_CONCAT, $1, $3); }
     873        2782 :         |       variable T_MOD_EQUAL expr
     874          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MOD, $1, $3); }
     875           5 :         |       variable T_AND_EQUAL expr
     876          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_AND, $1, $3); }
     877           5 :         |       variable T_OR_EQUAL expr
     878         196 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_OR, $1, $3); }
     879          98 :         |       variable T_XOR_EQUAL expr
     880           8 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_XOR, $1, $3); }
     881           4 :         |       variable T_SL_EQUAL expr
     882          14 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SL, $1, $3); }
     883           7 :         |       variable T_SR_EQUAL expr
     884          12 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SR, $1, $3); }
     885           6 :         |       variable T_INC { $$ = zend_ast_create(ZEND_AST_POST_INC, $1); }
     886        5594 :         |       T_INC variable { $$ = zend_ast_create(ZEND_AST_PRE_INC, $2); }
     887         531 :         |       variable T_DEC { $$ = zend_ast_create(ZEND_AST_POST_DEC, $1); }
     888          84 :         |       T_DEC variable { $$ = zend_ast_create(ZEND_AST_PRE_DEC, $2); }
     889          17 :         |       expr T_BOOLEAN_OR expr
     890        4312 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     891        4312 :         |       expr T_BOOLEAN_AND expr
     892        6775 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     893        6775 :         |       expr T_LOGICAL_OR expr
     894         913 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     895         913 :         |       expr T_LOGICAL_AND expr
     896          14 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     897          14 :         |       expr T_LOGICAL_XOR expr
     898           4 :                         { $$ = zend_ast_create_binary_op(ZEND_BOOL_XOR, $1, $3); }
     899         689 :         |       expr '|' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_OR, $1, $3); }
     900        1889 :         |       expr '&' expr       { $$ = zend_ast_create_binary_op(ZEND_BW_AND, $1, $3); }
     901        1226 :         |       expr '^' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_XOR, $1, $3); }
     902       33746 :         |       expr '.' expr   { $$ = zend_ast_create_binary_op(ZEND_CONCAT, $1, $3); }
     903       37367 :         |       expr '+' expr   { $$ = zend_ast_create_binary_op(ZEND_ADD, $1, $3); }
     904        4784 :         |       expr '-' expr   { $$ = zend_ast_create_binary_op(ZEND_SUB, $1, $3); }
     905        3988 :         |       expr '*' expr   { $$ = zend_ast_create_binary_op(ZEND_MUL, $1, $3); }
     906        2860 :         |       expr T_POW expr { $$ = zend_ast_create_binary_op(ZEND_POW, $1, $3); }
     907         547 :         |       expr '/' expr   { $$ = zend_ast_create_binary_op(ZEND_DIV, $1, $3); }
     908         665 :         |       expr '%' expr   { $$ = zend_ast_create_binary_op(ZEND_MOD, $1, $3); }
     909         271 :         |       expr T_SL expr  { $$ = zend_ast_create_binary_op(ZEND_SL, $1, $3); }
     910         213 :         |       expr T_SR expr  { $$ = zend_ast_create_binary_op(ZEND_SR, $1, $3); }
     911          71 :         |       '+' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_PLUS, $2); }
     912         251 :         |       '-' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_MINUS, $2); }
     913        6243 :         |       '!' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BOOL_NOT, $2); }
     914       27737 :         |       '~' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BW_NOT, $2); }
     915          91 :         |       expr T_IS_IDENTICAL expr
     916       11570 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_IDENTICAL, $1, $3); }
     917        5785 :         |       expr T_IS_NOT_IDENTICAL expr
     918       13552 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_IDENTICAL, $1, $3); }
     919        6776 :         |       expr T_IS_EQUAL expr
     920       32212 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_EQUAL, $1, $3); }
     921       16106 :         |       expr T_IS_NOT_EQUAL expr
     922        5728 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_EQUAL, $1, $3); }
     923        2864 :         |       expr '<' expr
     924        4258 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER, $1, $3); }
     925        2129 :         |       expr T_IS_SMALLER_OR_EQUAL expr
     926        3502 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER_OR_EQUAL, $1, $3); }
     927        1751 :         |       expr '>' expr
     928         898 :                         { $$ = zend_ast_create(ZEND_AST_GREATER, $1, $3); }
     929         898 :         |       expr T_IS_GREATER_OR_EQUAL expr
     930         469 :                         { $$ = zend_ast_create(ZEND_AST_GREATER_EQUAL, $1, $3); }
     931         469 :         |       expr T_SPACESHIP expr
     932          20 :                         { $$ = zend_ast_create_binary_op(ZEND_SPACESHIP, $1, $3); }
     933          10 :         |       expr T_INSTANCEOF class_name_reference
     934          69 :                         { $$ = zend_ast_create(ZEND_AST_INSTANCEOF, $1, $3); }
     935          69 :         |       '(' expr ')' { $$ = $2; }
     936       25677 :         |       new_expr { $$ = $1; }
     937       14601 :         |       expr '?' expr ':' expr
     938       25180 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, $3, $5); }
     939       25180 :         |       expr '?' ':' expr
     940         201 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, NULL, $4); }
     941         201 :         |       expr T_COALESCE expr
     942          20 :                         { $$ = zend_ast_create(ZEND_AST_COALESCE, $1, $3); }
     943          20 :         |       internal_functions_in_yacc { $$ = $1; }
     944       28242 :         |       T_INT_CAST expr         { $$ = zend_ast_create_cast(IS_LONG, $2); }
     945        4830 :         |       T_DOUBLE_CAST expr      { $$ = zend_ast_create_cast(IS_DOUBLE, $2); }
     946        1346 :         |       T_STRING_CAST expr      { $$ = zend_ast_create_cast(IS_STRING, $2); }
     947        1350 :         |       T_ARRAY_CAST expr       { $$ = zend_ast_create_cast(IS_ARRAY, $2); }
     948         202 :         |       T_OBJECT_CAST expr      { $$ = zend_ast_create_cast(IS_OBJECT, $2); }
     949         244 :         |       T_BOOL_CAST expr        { $$ = zend_ast_create_cast(_IS_BOOL, $2); }
     950          72 :         |       T_UNSET_CAST expr       { $$ = zend_ast_create_cast(IS_NULL, $2); }
     951           0 :         |       T_EXIT exit_expr        { $$ = zend_ast_create(ZEND_AST_EXIT, $2); }
     952       14694 :         |       '@' expr                        { $$ = zend_ast_create(ZEND_AST_SILENCE, $2); }
     953        5340 :         |       scalar { $$ = $1; }
     954      653730 :         |       '`' backticks_expr '`' { $$ = zend_ast_create(ZEND_AST_SHELL_EXEC, $2); }
     955         115 :         |       T_PRINT expr { $$ = zend_ast_create(ZEND_AST_PRINT, $2); }
     956        3356 :         |       T_YIELD { $$ = zend_ast_create(ZEND_AST_YIELD, NULL, NULL); }
     957          61 :         |       T_YIELD expr { $$ = zend_ast_create(ZEND_AST_YIELD, $2, NULL); }
     958         120 :         |       T_YIELD expr T_DOUBLE_ARROW expr { $$ = zend_ast_create(ZEND_AST_YIELD, $4, $2); }
     959          33 :         |       T_YIELD_FROM expr { $$ = zend_ast_create(ZEND_AST_YIELD_FROM, $2); }
     960          24 :         |       function returns_ref '(' parameter_list ')' lexical_vars return_type
     961             :                 backup_doc_comment '{' inner_statement_list '}'
     962        2265 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $2, $1, $8,
     963             :                                   zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     964        1812 :                               $4, $6, $10, $7); }
     965         453 :         |       T_STATIC function returns_ref '(' parameter_list ')' lexical_vars
     966             :                 return_type backup_doc_comment '{' inner_statement_list '}'
     967          55 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $3 | ZEND_ACC_STATIC, $2, $9,
     968             :                               zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     969          44 :                               $5, $7, $11, $8); }
     970          11 : ;
     971             : 
     972             : function:
     973       36210 :         T_FUNCTION { $$ = CG(zend_lineno); }
     974       36210 : ;
     975             : 
     976             : backup_doc_comment:
     977       43789 :         /* empty */ { $$ = CG(doc_comment); CG(doc_comment) = NULL; }
     978       43789 : ;
     979             : 
     980             : returns_ref:
     981       36121 :                 /* empty */     { $$ = 0; }
     982       36121 :         |       '&'                 { $$ = ZEND_ACC_RETURN_REFERENCE; }
     983          89 : ;
     984             : 
     985             : lexical_vars:
     986         290 :                 /* empty */ { $$ = NULL; }
     987         290 :         |       T_USE '(' lexical_var_list ')' { $$ = $3; }
     988         174 : ;
     989             : 
     990             : lexical_var_list:
     991          10 :                 lexical_var_list ',' lexical_var { $$ = zend_ast_list_add($1, $3); }
     992          10 :         |       lexical_var { $$ = zend_ast_create_list(1, ZEND_AST_CLOSURE_USES, $1); }
     993         174 : ;
     994             : 
     995             : lexical_var:
     996         153 :                 T_VARIABLE              { $$ = $1; }
     997         153 :         |       '&' T_VARIABLE      { $$ = $2; $$->attr = 1; }
     998          31 : ;
     999             : 
    1000             : function_call:
    1001             :                 name argument_list
    1002      248820 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
    1003      248820 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
    1004       10506 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
    1005       10506 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
    1006          43 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
    1007          43 :         |       callable_expr argument_list
    1008        2154 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
    1009        2154 : ;
    1010             : 
    1011             : class_name:
    1012             :                 T_STATIC
    1013         142 :                         { zval zv; ZVAL_STRINGL(&zv, "static", sizeof("static")-1);
    1014          71 :                           $$ = zend_ast_create_zval_ex(&zv, ZEND_NAME_NOT_FQ); }
    1015          71 :         |       name { $$ = $1; }
    1016       34092 : ;
    1017             : 
    1018             : class_name_reference:
    1019       13491 :                 class_name              { $$ = $1; }
    1020       13491 :         |       new_variable    { $$ = $1; }
    1021        1161 : ;
    1022             : 
    1023             : exit_expr:
    1024         407 :                 /* empty */                             { $$ = NULL; }
    1025         407 :         |       '(' optional_expr ')'   { $$ = $2; }
    1026       14287 : ;
    1027             : 
    1028             : backticks_expr:
    1029             :                 /* empty */
    1030           0 :                         { $$ = zend_ast_create_zval_from_str(ZSTR_EMPTY_ALLOC()); }
    1031           0 :         |       T_ENCAPSED_AND_WHITESPACE { $$ = $1; }
    1032           7 :         |       encaps_list { $$ = $1; }
    1033         108 : ;
    1034             : 
    1035             : 
    1036             : ctor_arguments:
    1037        2822 :                 /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
    1038        2822 :         |       argument_list { $$ = $1; }
    1039       11779 : ;
    1040             : 
    1041             : 
    1042             : dereferencable_scalar:
    1043       25380 :                 T_ARRAY '(' array_pair_list ')' { $$ = $3; }
    1044       25380 :         |       '[' array_pair_list ']'                 { $$ = $2; }
    1045         902 :         |       T_CONSTANT_ENCAPSED_STRING              { $$ = $1; }
    1046      345637 : ;
    1047             : 
    1048             : scalar:
    1049      161551 :                 T_LNUMBER       { $$ = $1; }
    1050      161551 :         |       T_DNUMBER       { $$ = $1; }
    1051        6662 :         |       T_LINE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_LINE); }
    1052          18 :         |       T_FILE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FILE); }
    1053        7453 :         |       T_DIR           { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_DIR); }
    1054         509 :         |       T_TRAIT_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_TRAIT_C); }
    1055           5 :         |       T_METHOD_C      { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_METHOD_C); }
    1056         922 :         |       T_FUNC_C        { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FUNC_C); }
    1057         130 :         |       T_NS_C          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_NS_C); }
    1058          36 :         |       T_CLASS_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C); }
    1059          93 :         |       T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = $2; }
    1060        1370 :         |       T_START_HEREDOC T_END_HEREDOC
    1061         118 :                         { $$ = zend_ast_create_zval_from_str(ZSTR_EMPTY_ALLOC()); }
    1062          59 :         |       '"' encaps_list '"'   { $$ = $2; }
    1063       15637 :         |       T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; }
    1064         145 :         |       dereferencable_scalar   { $$ = $1; }
    1065      371883 :         |       constant                        { $$ = $1; }
    1066       87257 : ;
    1067             : 
    1068             : constant:
    1069       77839 :                 name { $$ = zend_ast_create(ZEND_AST_CONST, $1); }
    1070       77839 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM identifier
    1071        9423 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
    1072        9423 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier
    1073           8 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
    1074           8 : ;
    1075             : 
    1076             : possible_comma:
    1077             :                 /* empty */
    1078             :         |       ','
    1079             : ;
    1080             : 
    1081             : expr:
    1082      691528 :                 variable                                        { $$ = $1; }
    1083      691528 :         |       expr_without_variable           { $$ = $1; }
    1084     1043158 : ;
    1085             : 
    1086             : optional_expr:
    1087        2932 :                 /* empty */     { $$ = NULL; }
    1088        2932 :         |       expr            { $$ = $1; }
    1089      180632 : ;
    1090             : 
    1091             : variable_class_name:
    1092          65 :         dereferencable { $$ = $1; }
    1093          65 : ;
    1094             : 
    1095             : dereferencable:
    1096      169713 :                 variable                                { $$ = $1; }
    1097      169713 :         |       '(' expr ')'                    { $$ = $2; }
    1098          59 :         |       dereferencable_scalar   { $$ = $1; }
    1099          30 : ;
    1100             : 
    1101             : callable_expr:
    1102        2132 :                 callable_variable               { $$ = $1; }
    1103        2132 :         |       '(' expr ')'                    { $$ = $2; }
    1104          16 :         |       dereferencable_scalar   { $$ = $1; }
    1105           6 : ;
    1106             : 
    1107             : callable_variable:
    1108             :                 simple_variable
    1109      592201 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1110      592201 :         |       dereferencable '[' optional_expr ']'
    1111      123333 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1112      123333 :         |       constant '[' optional_expr ']'
    1113          12 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1114          12 :         |       dereferencable '{' expr '}'
    1115          21 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1116          21 :         |       dereferencable T_OBJECT_OPERATOR property_name argument_list
    1117       35788 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_CALL, $1, $3, $4); }
    1118       35788 :         |       function_call { $$ = $1; }
    1119      261523 : ;
    1120             : 
    1121             : variable:
    1122             :                 callable_variable
    1123     1010746 :                         { $$ = $1; }
    1124     1010746 :         |       static_member
    1125         756 :                         { $$ = $1; }
    1126         756 :         |       dereferencable T_OBJECT_OPERATOR property_name
    1127       10595 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1128       10595 : ;
    1129             : 
    1130             : simple_variable:
    1131      599413 :                 T_VARIABLE                      { $$ = $1; }
    1132      599413 :         |       '$' '{' expr '}'        { $$ = $3; }
    1133          45 :         |       '$' simple_variable     { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1134         160 : ;
    1135             : 
    1136             : static_member:
    1137             :                 class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1138         742 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1139         742 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1140          14 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1141          14 : ;
    1142             : 
    1143             : new_variable:
    1144             :                 simple_variable
    1145        1160 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1146        1160 :         |       new_variable '[' optional_expr ']'
    1147          11 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1148          11 :         |       new_variable '{' expr '}'
    1149           1 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1150           1 :         |       new_variable T_OBJECT_OPERATOR property_name
    1151           4 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1152           4 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1153           1 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1154           1 :         |       new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1155           2 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1156           2 : ;
    1157             : 
    1158             : member_name:
    1159       10507 :                 identifier { $$ = $1; }
    1160       10507 :         |       '{' expr '}'    { $$ = $2; }
    1161           8 :         |       simple_variable { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1162          34 : ;
    1163             : 
    1164             : property_name:
    1165       46142 :                 T_STRING { $$ = $1; }
    1166       46142 :         |       '{' expr '}'    { $$ = $2; }
    1167          69 :         |       simple_variable { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1168         176 : ;
    1169             : 
    1170             : assignment_list:
    1171             :                 assignment_list ',' assignment_list_element
    1172         244 :                         { $$ = zend_ast_list_add($1, $3); }
    1173         244 :         |       assignment_list_element
    1174         182 :                         { $$ = zend_ast_create_list(1, ZEND_AST_LIST, $1); }
    1175         182 : ;
    1176             : 
    1177             : assignment_list_element:
    1178         373 :                 variable                                                { $$ = $1; }
    1179         373 :         |       T_LIST '(' assignment_list ')'  { $$ = $3; }
    1180          21 :         |       /* empty */                                             { $$ = NULL; }
    1181          32 : ;
    1182             : 
    1183             : 
    1184             : array_pair_list:
    1185        3381 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_ARRAY); }
    1186        3381 :         |       non_empty_array_pair_list possible_comma { $$ = $1; }
    1187       22902 : ;
    1188             : 
    1189             : non_empty_array_pair_list:
    1190             :                 non_empty_array_pair_list ',' array_pair
    1191       74826 :                         { $$ = zend_ast_list_add($1, $3); }
    1192       74826 :         |       array_pair
    1193       22902 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARRAY, $1); }
    1194       22902 : ;
    1195             : 
    1196             : array_pair:
    1197             :                 expr T_DOUBLE_ARROW expr
    1198       27539 :                         { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $3, $1); }
    1199       27539 :         |       expr { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $1, NULL); }
    1200       70034 :         |       expr T_DOUBLE_ARROW '&' variable
    1201          61 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $4, $1); }
    1202          61 :         |       '&' variable
    1203          94 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $2, NULL); }
    1204          94 : ;
    1205             : 
    1206             : encaps_list:
    1207             :                 encaps_list encaps_var
    1208        6520 :                         { $$ = zend_ast_list_add($1, $2); }
    1209        6520 :         |       encaps_list T_ENCAPSED_AND_WHITESPACE
    1210       15483 :                         { $$ = zend_ast_list_add($1, $2); }
    1211       15483 :         |       encaps_var
    1212        4718 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ENCAPS_LIST, $1); }
    1213        4718 :         |       T_ENCAPSED_AND_WHITESPACE encaps_var
    1214       11173 :                         { $$ = zend_ast_create_list(2, ZEND_AST_ENCAPS_LIST, $1, $2); }
    1215       11173 : ;
    1216             : 
    1217             : encaps_var:
    1218             :                 T_VARIABLE
    1219       19577 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1220       19577 :         |       T_VARIABLE '[' encaps_var_offset ']'
    1221        1964 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1222        1964 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1223         982 :         |       T_VARIABLE T_OBJECT_OPERATOR T_STRING
    1224         180 :                         { $$ = zend_ast_create(ZEND_AST_PROP,
    1225          90 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1226          90 :         |       T_DOLLAR_OPEN_CURLY_BRACES expr '}'
    1227           4 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1228           4 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}'
    1229         376 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1230         376 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}'
    1231           0 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1232           0 :                               zend_ast_create(ZEND_AST_VAR, $2), $4); }
    1233           0 :         |       T_CURLY_OPEN variable '}' { $$ = $2; }
    1234        1382 : ;
    1235             : 
    1236             : encaps_var_offset:
    1237           4 :                 T_STRING                { $$ = $1; }
    1238           4 :         |       T_NUM_STRING    { $$ = $1; }
    1239         384 :         |       T_VARIABLE              { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1240         594 : ;
    1241             : 
    1242             : 
    1243             : internal_functions_in_yacc:
    1244        5535 :                 T_ISSET '(' isset_variables ')' { $$ = $3; }
    1245        5535 :         |       T_EMPTY '(' expr ')' { $$ = zend_ast_create(ZEND_AST_EMPTY, $3); }
    1246        7305 :         |       T_INCLUDE expr
    1247        1946 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE, $2); }
    1248        1946 :         |       T_INCLUDE_ONCE expr
    1249         508 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE_ONCE, $2); }
    1250         508 :         |       T_EVAL '(' expr ')'
    1251        1963 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_EVAL, $3); }
    1252        1963 :         |       T_REQUIRE expr
    1253         783 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE, $2); }
    1254         783 :         |       T_REQUIRE_ONCE expr
    1255        5398 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE_ONCE, $2); }
    1256        5398 : ;
    1257             : 
    1258             : isset_variables:
    1259        5535 :                 isset_variable { $$ = $1; }
    1260        5535 :         |       isset_variables ',' isset_variable
    1261          44 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
    1262          44 : ;
    1263             : 
    1264             : isset_variable:
    1265        5579 :                 expr { $$ = zend_ast_create(ZEND_AST_ISSET, $1); }
    1266             : ;
    1267             : 
    1268             : %%
    1269             : 
    1270             : /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
    1271             :    quotes and backslashes, so that it's suitable for yyerror.  The
    1272             :    heuristic is that double-quoting is unnecessary unless the string
    1273             :    contains an apostrophe, a comma, or backslash (other than
    1274             :    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
    1275             :    null, do not copy; instead, return the length of what the result
    1276             :    would have been.  */
    1277         548 : static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
    1278             : {
    1279         548 :         if (!yyres) {
    1280         440 :                 return yystrlen(yystr);
    1281             :         }
    1282             :         {
    1283         108 :                 if (CG(parse_error) == 0) {
    1284             :                         char buffer[120];
    1285          51 :                         const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
    1286          51 :                         unsigned int len = 0, toklen = 0, yystr_len;
    1287             : 
    1288          51 :                         CG(parse_error) = 1;
    1289             : 
    1290          61 :                         if (LANG_SCNG(yy_text)[0] == 0 &&
    1291           5 :                                 LANG_SCNG(yy_leng) == 1 &&
    1292           5 :                                 memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
    1293           5 :                                 yystpcpy(yyres, "end of file");
    1294           5 :                                 return sizeof("end of file")-1;
    1295             :                         }
    1296             : 
    1297          46 :                         str = LANG_SCNG(yy_text);
    1298          46 :                         end = memchr(str, '\n', LANG_SCNG(yy_leng));
    1299          46 :                         yystr_len = (unsigned int)yystrlen(yystr);
    1300             : 
    1301         100 :                         if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
    1302          27 :                                 && (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
    1303          27 :                                 toklen = (tok2 - tok1) + 1;
    1304             :                         } else {
    1305          19 :                                 tok1 = tok2 = NULL;
    1306          19 :                                 toklen = 0;
    1307             :                         }
    1308             : 
    1309          46 :                         if (end == NULL) {
    1310          45 :                                 len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
    1311             :                         } else {
    1312           1 :                                 len = (end - str) > 30 ? 30 : (end - str);
    1313             :                         }
    1314          46 :                         if (toklen) {
    1315          27 :                                 snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
    1316             :                         } else {
    1317          19 :                                 snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
    1318             :                         }
    1319          46 :                         yystpcpy(yyres, buffer);
    1320          46 :                         return len + (toklen ? toklen + 1 : 0) + 2;
    1321             :                 }
    1322             :         }
    1323          57 :         if (*yystr == '"') {
    1324          28 :                 YYSIZE_T yyn = 0;
    1325          28 :                 const char *yyp = yystr;
    1326             : 
    1327         558 :                 for (; *++yyp != '"'; ++yyn) {
    1328         530 :                         yyres[yyn] = *yyp;
    1329             :                 }
    1330          28 :                 yyres[yyn] = '\0';
    1331          28 :                 return yyn;
    1332             :         }
    1333          29 :         yystpcpy(yyres, yystr);
    1334          29 :         return strlen(yystr);
    1335             : }
    1336             : 
    1337             : /*
    1338             :  * Local variables:
    1339             :  * tab-width: 4
    1340             :  * c-basic-offset: 4
    1341             :  * indent-tabs-mode: t
    1342             :  * End:
    1343             :  */

Generated by: LCOV version 1.10

Generated at Wed, 02 Sep 2015 17:19:07 +0000 (45 hours ago)

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