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: 691 705 98.0 %
Date: 2015-07-31 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         148 : %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 const_decl inner_statement
     233             : %type <ast> expr optional_expr while_statement for_statement foreach_variable
     234             : %type <ast> foreach_statement declare_statement finally_statement unset_variable variable
     235             : %type <ast> extends_from parameter optional_type argument expr_without_variable global_var
     236             : %type <ast> static_var class_statement trait_adaptation trait_precedence trait_alias
     237             : %type <ast> absolute_trait_method_reference trait_method_reference property echo_expr
     238             : %type <ast> new_expr anonymous_class class_name class_name_reference simple_variable
     239             : %type <ast> internal_functions_in_yacc
     240             : %type <ast> exit_expr scalar backticks_expr lexical_var function_call member_name property_name
     241             : %type <ast> variable_class_name dereferencable_scalar constant dereferencable
     242             : %type <ast> callable_expr callable_variable static_member new_variable
     243             : %type <ast> assignment_list_element array_pair encaps_var encaps_var_offset isset_variables
     244             : %type <ast> top_statement_list use_declarations const_list inner_statement_list if_stmt
     245             : %type <ast> alt_if_stmt for_exprs switch_case_list global_var_list static_var_list
     246             : %type <ast> echo_expr_list unset_variables catch_list parameter_list class_statement_list
     247             : %type <ast> implements_list case_list if_stmt_without_else
     248             : %type <ast> non_empty_parameter_list argument_list non_empty_argument_list property_list
     249             : %type <ast> class_const_list class_const_decl name_list trait_adaptations method_body non_empty_for_exprs
     250             : %type <ast> ctor_arguments alt_if_stmt_without_else trait_adaptation_list lexical_vars
     251             : %type <ast> lexical_var_list encaps_list array_pair_list non_empty_array_pair_list
     252             : %type <ast> assignment_list isset_variable type return_type
     253             : %type <ast> identifier
     254             : 
     255             : %type <num> returns_ref function is_reference is_variadic variable_modifiers
     256             : %type <num> method_modifiers non_empty_member_modifiers member_modifier
     257             : %type <num> class_modifiers class_modifier use_type
     258             : 
     259             : %type <str> backup_doc_comment
     260             : 
     261             : %% /* Rules */
     262             : 
     263             : start:
     264       29945 :         top_statement_list      { CG(ast) = $1; }
     265       29945 : ;
     266             : 
     267             : reserved_non_modifiers:
     268             :           T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND
     269             :         | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE | T_ENDWHILE
     270             :         | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH | T_FINALLY
     271             :         | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO
     272             :         | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT | T_BREAK
     273             :         | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS
     274             : ;
     275             : 
     276             : semi_reserved:
     277             :           reserved_non_modifiers
     278             :         | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC
     279             : ;
     280             : 
     281             : identifier:
     282       37563 :                 T_STRING { $$ = $1; }
     283       37563 :         |       semi_reserved  {
     284             :                         zval zv;
     285         431 :                         zend_lex_tstring(&zv);
     286         431 :                         $$ = zend_ast_create_zval(&zv);
     287             :                 }
     288         431 : ;
     289             : 
     290             : top_statement_list:
     291      215949 :                 top_statement_list top_statement { $$ = zend_ast_list_add($1, $2); }
     292      215949 :         |       /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     293       30111 : ;
     294             : 
     295             : namespace_name:
     296      364395 :                 T_STRING                                                                { $$ = $1; }
     297      364395 :         |       namespace_name T_NS_SEPARATOR T_STRING  { $$ = zend_ast_append_str($1, $3); }
     298         434 : ;
     299             : 
     300             : name:
     301      363742 :                 namespace_name                                                          { $$ = $1; $$->attr = ZEND_NAME_NOT_FQ; }
     302      363742 :         |       T_NAMESPACE T_NS_SEPARATOR namespace_name       { $$ = $3; $$->attr = ZEND_NAME_RELATIVE; }
     303          56 :         |       T_NS_SEPARATOR namespace_name                           { $$ = $2; $$->attr = ZEND_NAME_FQ; }
     304         246 : ;
     305             : 
     306             : top_statement:
     307      194713 :                 statement                                                       { $$ = $1; }
     308      194713 :         |       function_declaration_statement          { $$ = $1; }
     309       13859 :         |       class_declaration_statement                     { $$ = $1; }
     310        6137 :         |       trait_declaration_statement                     { $$ = $1; }
     311         229 :         |       interface_declaration_statement         { $$ = $1; }
     312         203 :         |       T_HALT_COMPILER '(' ')' ';'
     313         552 :                         { $$ = zend_ast_create(ZEND_AST_HALT_COMPILER,
     314         276 :                               zend_ast_create_zval_from_long(zend_get_scanned_file_offset()));
     315         276 :                           zend_stop_lexing(); }
     316         276 :         |       T_NAMESPACE namespace_name ';'
     317         145 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, NULL);
     318         145 :                           RESET_DOC_COMMENT(); }
     319         146 :         |       T_NAMESPACE namespace_name { RESET_DOC_COMMENT(); }
     320          57 :                 '{' top_statement_list '}'
     321          54 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, $5); }
     322          54 :         |       T_NAMESPACE { RESET_DOC_COMMENT(); }
     323          37 :                 '{' top_statement_list '}'
     324          37 :                         { $$ = zend_ast_create(ZEND_AST_NAMESPACE, NULL, $4); }
     325          37 :         |       T_USE mixed_group_use_declaration ';'           { $$ = $2; }
     326           9 :         |       T_USE use_type group_use_declaration ';'        { $$ = $3; $$->attr = $2; }
     327           2 :         |       T_USE use_declarations ';'                                      { $$ = $2; $$->attr = T_CLASS; }
     328          62 :         |       T_USE use_type use_declarations ';'                     { $$ = $3; $$->attr = $2; }
     329          31 :         |       T_CONST const_list ';'                                          { $$ = $2; }
     330         192 : ;
     331             : 
     332             : use_type:
     333          22 :                 T_FUNCTION              { $$ = T_FUNCTION; }
     334          22 :         |       T_CONST                 { $$ = T_CONST; }
     335          21 : ;
     336             : 
     337             : group_use_declaration:
     338             :         namespace_name T_NS_SEPARATOR '{' use_declarations '}'
     339           2 :                 {$$ = zend_ast_create(ZEND_AST_GROUP_USE, $1, $4); }
     340           2 : ;
     341             : 
     342             : mixed_group_use_declaration:
     343             :         namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}'
     344           9 :                 {$$ = zend_ast_create(ZEND_AST_GROUP_USE, $1, $4);}
     345           9 : ;
     346             : 
     347             : inline_use_declarations:
     348             :                 inline_use_declarations ',' inline_use_declaration
     349          17 :                         { $$ = zend_ast_list_add($1, $3); }
     350          17 :         |       inline_use_declaration
     351          10 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     352          10 : ;
     353             : 
     354             : inline_use_declaration:
     355          18 :                 use_declaration { $$ = $1; $$->attr = T_CLASS; }
     356          18 :         |       use_type use_declaration { $$ = $2; $$->attr = $1; }
     357           9 : ;
     358             : 
     359             : use_declarations:
     360             :                 use_declarations ',' use_declaration
     361          13 :                         { $$ = zend_ast_list_add($1, $3); }
     362          13 :         |       use_declaration
     363          96 :                         { $$ = zend_ast_create_list(1, ZEND_AST_USE, $1); }
     364          96 : ;
     365             : 
     366             : use_declaration:
     367             :                 namespace_name
     368          64 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, NULL); }
     369          64 :         |       namespace_name T_AS T_STRING
     370          57 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $1, $3); }
     371          57 :         |       T_NS_SEPARATOR namespace_name
     372          11 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $2, NULL); }
     373          11 :         |       T_NS_SEPARATOR namespace_name T_AS T_STRING
     374           4 :                         { $$ = zend_ast_create(ZEND_AST_USE_ELEM, $2, $4); }
     375           4 : ;
     376             : 
     377             : const_list:
     378           2 :                 const_list ',' const_decl { $$ = zend_ast_list_add($1, $3); }
     379           2 :         |       const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CONST_DECL, $1); }
     380         258 : ;
     381             : 
     382             : inner_statement_list:
     383             :                 inner_statement_list inner_statement
     384      233848 :                         { $$ = zend_ast_list_add($1, $2); }
     385      233848 :         |       /* empty */
     386      112147 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     387      112147 : ;
     388             : 
     389             : 
     390             : inner_statement:
     391      228860 :                 statement { $$ = $1; }
     392      228860 :         |       function_declaration_statement          { $$ = $1; }
     393        4050 :         |       class_declaration_statement             { $$ = $1; }
     394         938 :         |       trait_declaration_statement                     { $$ = $1; }
     395           0 :         |       interface_declaration_statement         { $$ = $1; }
     396           0 :         |       T_HALT_COMPILER '(' ')' ';'
     397           1 :                         { $$ = NULL; zend_error_noreturn(E_COMPILE_ERROR,
     398             :                               "__HALT_COMPILER() can only be used from the outermost scope"); }
     399             : ;
     400             : 
     401             : 
     402             : statement:
     403       69578 :                 '{' inner_statement_list '}' { $$ = $2; }
     404       69578 :         |       if_stmt { $$ = $1; }
     405       67192 :         |       alt_if_stmt { $$ = $1; }
     406           4 :         |       T_WHILE '(' expr ')' while_statement
     407        1856 :                         { $$ = zend_ast_create(ZEND_AST_WHILE, $3, $5); }
     408        1856 :         |       T_DO statement T_WHILE '(' expr ')' ';'
     409         296 :                         { $$ = zend_ast_create(ZEND_AST_DO_WHILE, $2, $5); }
     410         296 :         |       T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement
     411        2065 :                         { $$ = zend_ast_create(ZEND_AST_FOR, $3, $5, $7, $9); }
     412        2065 :         |       T_SWITCH '(' expr ')' switch_case_list
     413         453 :                         { $$ = zend_ast_create(ZEND_AST_SWITCH, $3, $5); }
     414         453 :         |       T_BREAK optional_expr ';'               { $$ = zend_ast_create(ZEND_AST_BREAK, $2); }
     415        1888 :         |       T_CONTINUE optional_expr ';'    { $$ = zend_ast_create(ZEND_AST_CONTINUE, $2); }
     416         274 :         |       T_RETURN optional_expr ';'              { $$ = zend_ast_create(ZEND_AST_RETURN, $2); }
     417       43611 :         |       T_GLOBAL global_var_list ';'    { $$ = $2; }
     418        4185 :         |       T_STATIC static_var_list ';'    { $$ = $2; }
     419        1889 :         |       T_ECHO echo_expr_list ';'               { $$ = $2; }
     420       30503 :         |       T_INLINE_HTML { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     421        3584 :         |       expr ';' { $$ = $1; }
     422      254118 :         |       T_UNSET '(' unset_variables ')' ';' { $$ = $3; }
     423        1432 :         |       T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement
     424        5394 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $5, NULL, $7); }
     425        5394 :         |       T_FOREACH '(' expr T_AS foreach_variable T_DOUBLE_ARROW foreach_variable ')'
     426             :                 foreach_statement
     427        4722 :                         { $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $7, $5, $9); }
     428        4722 :         |       T_DECLARE '(' const_list ')'
     429          66 :                         { zend_handle_encoding_declaration($3); }
     430          62 :                 declare_statement
     431          62 :                         { $$ = zend_ast_create(ZEND_AST_DECLARE, $3, $6); }
     432          62 :         |       ';'     /* empty statement */ { $$ = NULL; }
     433       27765 :         |       T_TRY '{' inner_statement_list '}' catch_list finally_statement
     434        2392 :                         { $$ = zend_ast_create(ZEND_AST_TRY, $3, $5, $6); }
     435        2392 :         |       T_THROW expr ';' { $$ = zend_ast_create(ZEND_AST_THROW, $2); }
     436         346 :         |       T_GOTO T_STRING ';' { $$ = zend_ast_create(ZEND_AST_GOTO, $2); }
     437          37 :         |       T_STRING ':' { $$ = zend_ast_create(ZEND_AST_LABEL, $1); }
     438          38 : ;
     439             : 
     440             : catch_list:
     441             :                 /* empty */
     442        2392 :                         { $$ = zend_ast_create_list(0, ZEND_AST_CATCH_LIST); }
     443        2392 :         |       catch_list T_CATCH '(' name T_VARIABLE ')' '{' inner_statement_list '}'
     444        2357 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_CATCH, $4, $5, $8)); }
     445        2357 : ;
     446             : 
     447             : finally_statement:
     448        2318 :                 /* empty */ { $$ = NULL; }
     449        2318 :         |       T_FINALLY '{' inner_statement_list '}' { $$ = $3; }
     450          74 : ;
     451             : 
     452             : unset_variables:
     453        1432 :                 unset_variable { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     454        1432 :         |       unset_variables ',' unset_variable { $$ = zend_ast_list_add($1, $3); }
     455         118 : ;
     456             : 
     457             : unset_variable:
     458        1550 :                 variable { $$ = zend_ast_create(ZEND_AST_UNSET, $1); }
     459        1550 : ;
     460             : 
     461             : function_declaration_statement:
     462             :         function returns_ref T_STRING '(' parameter_list ')' return_type
     463             :         backup_doc_comment '{' inner_statement_list '}'
     464       89545 :                 { $$ = zend_ast_create_decl(ZEND_AST_FUNC_DECL, $2, $1, $8,
     465       71636 :                       zend_ast_get_str($3), $5, NULL, $10, $7); }
     466       17909 : ;
     467             : 
     468             : is_reference:
     469       82190 :                 /* empty */     { $$ = 0; }
     470       82190 :         |       '&'                 { $$ = ZEND_PARAM_REF; }
     471        1077 : ;
     472             : 
     473             : is_variadic:
     474       83226 :                 /* empty */ { $$ = 0; }
     475       83226 :         |       T_ELLIPSIS  { $$ = ZEND_PARAM_VARIADIC; }
     476          41 : ;
     477             : 
     478             : class_declaration_statement:
     479         112 :                 class_modifiers T_CLASS { $<num>$ = CG(zend_lineno); }
     480         112 :                 T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
     481         224 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, $1, $<num>3, $7, zend_ast_get_str($4), $5, $6, $9, NULL); }
     482         112 :         |       T_CLASS { $<num>$ = CG(zend_lineno); }
     483        6981 :                 T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
     484       13926 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, 0, $<num>2, $6, zend_ast_get_str($3), $4, $5, $8, NULL); }
     485        6963 : ;
     486             : 
     487             : class_modifiers:
     488         114 :                 class_modifier                                  { $$ = $1; }
     489         114 :         |       class_modifiers class_modifier  { $$ = zend_add_class_modifier($1, $2); }
     490           0 : ;
     491             : 
     492             : class_modifier:
     493          97 :                 T_ABSTRACT              { $$ = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
     494          97 :         |       T_FINAL                 { $$ = ZEND_ACC_FINAL; }
     495          19 : ;
     496             : 
     497             : trait_declaration_statement:
     498         231 :                 T_TRAIT { $<num>$ = CG(zend_lineno); }
     499         231 :                 T_STRING backup_doc_comment '{' class_statement_list '}'
     500         458 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, ZEND_ACC_TRAIT, $<num>2, $4, zend_ast_get_str($3), NULL, NULL, $6, NULL); }
     501         229 : ;
     502             : 
     503             : interface_declaration_statement:
     504         204 :                 T_INTERFACE { $<num>$ = CG(zend_lineno); }
     505         204 :                 T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}'
     506         406 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLASS, ZEND_ACC_INTERFACE, $<num>2, $5, zend_ast_get_str($3), NULL, $4, $7, NULL); }
     507         203 : ;
     508             : 
     509             : extends_from:
     510        4729 :                 /* empty */             { $$ = NULL; }
     511        4729 :         |       T_EXTENDS name  { $$ = $2; }
     512        2376 : ;
     513             : 
     514             : interface_extends_list:
     515         165 :                 /* empty */                     { $$ = NULL; }
     516         165 :         |       T_EXTENDS name_list     { $$ = $2; }
     517          38 : ;
     518             : 
     519             : implements_list:
     520        6795 :                 /* empty */                             { $$ = NULL; }
     521        6795 :         |       T_IMPLEMENTS name_list  { $$ = $2; }
     522         309 : ;
     523             : 
     524             : foreach_variable:
     525       14723 :                 variable                        { $$ = $1; }
     526       14723 :         |       '&' variable                { $$ = zend_ast_create(ZEND_AST_REF, $2); }
     527         106 :         |       T_LIST '(' assignment_list ')' { $$ = $3; }
     528           9 : ;
     529             : 
     530             : for_statement:
     531        2062 :                 statement { $$ = $1; }
     532        2062 :         |       ':' inner_statement_list T_ENDFOR ';' { $$ = $2; }
     533           3 : ;
     534             : 
     535             : foreach_statement:
     536       10116 :                 statement { $$ = $1; }
     537       10116 :         |       ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; }
     538           0 : ;
     539             : 
     540             : declare_statement:
     541          62 :                 statement { $$ = $1; }
     542          62 :         |       ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; }
     543           0 : ;
     544             : 
     545             : switch_case_list:
     546         452 :                 '{' case_list '}'                                       { $$ = $2; }
     547         452 :         |       '{' ';' case_list '}'                           { $$ = $3; }
     548           0 :         |       ':' case_list T_ENDSWITCH ';'           { $$ = $2; }
     549           1 :         |       ':' ';' case_list T_ENDSWITCH ';'       { $$ = $3; }
     550           0 : ;
     551             : 
     552             : case_list:
     553         453 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_SWITCH_LIST); }
     554         453 :         |       case_list T_CASE expr case_separator inner_statement_list
     555        1599 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, $3, $5)); }
     556        1599 :         |       case_list T_DEFAULT case_separator inner_statement_list
     557         269 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, NULL, $4)); }
     558         269 : ;
     559             : 
     560             : case_separator:
     561             :                 ':'
     562             :         |       ';'
     563             : ;
     564             : 
     565             : 
     566             : while_statement:
     567        1855 :                 statement { $$ = $1; }
     568        1855 :         |       ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; }
     569           1 : ;
     570             : 
     571             : 
     572             : if_stmt_without_else:
     573             :                 T_IF '(' expr ')' statement
     574      134384 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     575       67192 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $5)); }
     576       67192 :         |       if_stmt_without_else T_ELSEIF '(' expr ')' statement
     577        3492 :                         { $$ = zend_ast_list_add($1,
     578        1746 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $6)); }
     579        1746 : ;
     580             : 
     581             : if_stmt:
     582       50410 :                 if_stmt_without_else %prec T_NOELSE { $$ = $1; }
     583       50410 :         |       if_stmt_without_else T_ELSE statement
     584       16782 :                         { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_IF_ELEM, NULL, $3)); }
     585       16782 : ;
     586             : 
     587             : alt_if_stmt_without_else:
     588             :                 T_IF '(' expr ')' ':' inner_statement_list
     589           8 :                         { $$ = zend_ast_create_list(1, ZEND_AST_IF,
     590           4 :                               zend_ast_create(ZEND_AST_IF_ELEM, $3, $6)); }
     591           4 :         |       alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list
     592           2 :                         { $$ = zend_ast_list_add($1,
     593           1 :                               zend_ast_create(ZEND_AST_IF_ELEM, $4, $7)); }
     594           1 : ;
     595             : 
     596             : alt_if_stmt:
     597           2 :                 alt_if_stmt_without_else T_ENDIF ';' { $$ = $1; }
     598           2 :         |       alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';'
     599           2 :                         { $$ = zend_ast_list_add($1,
     600           2 :                               zend_ast_create(ZEND_AST_IF_ELEM, NULL, $4)); }
     601           2 : ;
     602             : 
     603             : parameter_list:
     604       26760 :                 non_empty_parameter_list { $$ = $1; }
     605       26760 :         |       /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_PARAM_LIST); }
     606        9293 : ;
     607             : 
     608             : 
     609             : non_empty_parameter_list:
     610             :                 parameter
     611       26760 :                         { $$ = zend_ast_create_list(1, ZEND_AST_PARAM_LIST, $1); }
     612       26760 :         |       non_empty_parameter_list ',' parameter
     613       56507 :                         { $$ = zend_ast_list_add($1, $3); }
     614       56507 : ;
     615             : 
     616             : parameter:
     617             :                 optional_type is_reference is_variadic T_VARIABLE
     618       68874 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, NULL); }
     619       68874 :         |       optional_type is_reference is_variadic T_VARIABLE '=' expr
     620       14393 :                         { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $2 | $3, $1, $4, $6); }
     621       14393 : ;
     622             : 
     623             : 
     624             : optional_type:
     625       82738 :                 /* empty */     { $$ = NULL; }
     626       82738 :         |       type            { $$ = $1; }
     627         529 : ;
     628             : 
     629             : type:
     630         249 :                 T_ARRAY         { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_ARRAY); }
     631         249 :         |       T_CALLABLE      { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_CALLABLE); }
     632          15 :         |       name            { $$ = $1; }
     633         366 : ;
     634             : 
     635             : return_type:
     636       35950 :                 /* empty */     { $$ = NULL; }
     637       35950 :         |       ':' type        { $$ = $2; }
     638         101 : ;
     639             : 
     640             : argument_list:
     641       37622 :                 '(' ')' { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
     642       37622 :         |       '(' non_empty_argument_list ')' { $$ = $2; }
     643      269229 : ;
     644             : 
     645             : non_empty_argument_list:
     646             :                 argument
     647      269230 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARG_LIST, $1); }
     648      269230 :         |       non_empty_argument_list ',' argument
     649      261772 :                         { $$ = zend_ast_list_add($1, $3); }
     650      261772 : ;
     651             : 
     652             : argument:
     653      530934 :                 expr                    { $$ = $1; }
     654      530934 :         |       T_ELLIPSIS expr { $$ = zend_ast_create(ZEND_AST_UNPACK, $2); }
     655          68 : ;
     656             : 
     657             : global_var_list:
     658         935 :                 global_var_list ',' global_var { $$ = zend_ast_list_add($1, $3); }
     659         935 :         |       global_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     660        4186 : ;
     661             : 
     662             : global_var:
     663             :         simple_variable
     664        5121 :                 { $$ = zend_ast_create(ZEND_AST_GLOBAL, zend_ast_create(ZEND_AST_VAR, $1)); }
     665        5121 : ;
     666             : 
     667             : 
     668             : static_var_list:
     669           9 :                 static_var_list ',' static_var { $$ = zend_ast_list_add($1, $3); }
     670           9 :         |       static_var { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     671        1889 : ;
     672             : 
     673             : static_var:
     674          21 :                 T_VARIABLE                      { $$ = zend_ast_create(ZEND_AST_STATIC, $1, NULL); }
     675          21 :         |       T_VARIABLE '=' expr     { $$ = zend_ast_create(ZEND_AST_STATIC, $1, $3); }
     676        1877 : ;
     677             : 
     678             : 
     679             : class_statement_list:
     680             :                 class_statement_list class_statement
     681       20761 :                         { $$ = zend_ast_list_add($1, $2); }
     682       20761 :         |       /* empty */
     683        7534 :                         { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
     684        7534 : ;
     685             : 
     686             : 
     687             : class_statement:
     688             :                 variable_modifiers property_list ';'
     689        2524 :                         { $$ = zend_ast_append_doc_comment($2); $$->attr = $1; }
     690        2524 :         |       T_CONST class_const_list ';'
     691         330 :                         { $$ = $2; RESET_DOC_COMMENT(); }
     692         328 :         |       T_USE name_list trait_adaptations
     693         216 :                         { $$ = zend_ast_create(ZEND_AST_USE_TRAIT, $2, $3); }
     694         216 :         |       method_modifiers function returns_ref identifier '(' parameter_list ')'
     695             :                 return_type backup_doc_comment method_body
     696       70772 :                         { $$ = zend_ast_create_decl(ZEND_AST_METHOD, $3 | $1, $2, $9,
     697       53079 :                                   zend_ast_get_str($4), $6, NULL, $10, $8); }
     698       17693 : ;
     699             : 
     700             : name_list:
     701         586 :                 name { $$ = zend_ast_create_list(1, ZEND_AST_NAME_LIST, $1); }
     702         586 :         |       name_list ',' name { $$ = zend_ast_list_add($1, $3); }
     703          86 : ;
     704             : 
     705             : trait_adaptations:
     706         151 :                 ';'                                                             { $$ = NULL; }
     707         151 :         |       '{' '}'                                                 { $$ = NULL; }
     708           0 :         |       '{' trait_adaptation_list '}'   { $$ = $2; }
     709          65 : ;
     710             : 
     711             : trait_adaptation_list:
     712             :                 trait_adaptation
     713          65 :                         { $$ = zend_ast_create_list(1, ZEND_AST_TRAIT_ADAPTATIONS, $1); }
     714          65 :         |       trait_adaptation_list trait_adaptation
     715          35 :                         { $$ = zend_ast_list_add($1, $2); }
     716          35 : ;
     717             : 
     718             : trait_adaptation:
     719          23 :                 trait_precedence ';'    { $$ = $1; }
     720          23 :         |       trait_alias ';'                 { $$ = $1; }
     721          77 : ;
     722             : 
     723             : trait_precedence:
     724             :         absolute_trait_method_reference T_INSTEADOF name_list
     725          23 :                 { $$ = zend_ast_create(ZEND_AST_TRAIT_PRECEDENCE, $1, $3); }
     726          23 : ;
     727             : 
     728             : trait_alias:
     729             :                 trait_method_reference T_AS T_STRING
     730          51 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, 0, $1, $3); }
     731          51 :         |       trait_method_reference T_AS reserved_non_modifiers
     732           6 :                         { zval zv; zend_lex_tstring(&zv); $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, 0, $1, zend_ast_create_zval(&zv)); }
     733           3 :         |       trait_method_reference T_AS member_modifier identifier
     734           9 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, $4); }
     735           9 :         |       trait_method_reference T_AS member_modifier
     736          14 :                         { $$ = zend_ast_create_ex(ZEND_AST_TRAIT_ALIAS, $3, $1, NULL); }
     737          14 : ;
     738             : 
     739             : trait_method_reference:
     740             :                 identifier
     741          43 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, NULL, $1); }
     742          43 :         |       absolute_trait_method_reference { $$ = $1; }
     743          34 : ;
     744             : 
     745             : absolute_trait_method_reference:
     746             :         name T_PAAMAYIM_NEKUDOTAYIM identifier
     747          57 :                 { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, $1, $3); }
     748          57 : ;
     749             : 
     750             : method_body:
     751         189 :                 ';' /* abstract method */               { $$ = NULL; }
     752         189 :         |       '{' inner_statement_list '}'    { $$ = $2; }
     753       17504 : ;
     754             : 
     755             : variable_modifiers:
     756        2349 :                 non_empty_member_modifiers              { $$ = $1; }
     757        2349 :         |       T_VAR                                                   { $$ = ZEND_ACC_PUBLIC; }
     758         175 : ;
     759             : 
     760             : method_modifiers:
     761        7017 :                 /* empty */                                             { $$ = ZEND_ACC_PUBLIC; }
     762        7017 :         |       non_empty_member_modifiers
     763       10677 :                         { $$ = $1; if (!($$ & ZEND_ACC_PPP_MASK)) { $$ |= ZEND_ACC_PUBLIC; } }
     764       10677 : ;
     765             : 
     766             : non_empty_member_modifiers:
     767       13037 :                 member_modifier                 { $$ = $1; }
     768       13037 :         |       non_empty_member_modifiers member_modifier
     769         779 :                         { $$ = zend_add_member_modifier($1, $2); }
     770         768 : ;
     771             : 
     772             : member_modifier:
     773        4728 :                 T_PUBLIC                                { $$ = ZEND_ACC_PUBLIC; }
     774        4728 :         |       T_PROTECTED                             { $$ = ZEND_ACC_PROTECTED; }
     775         584 :         |       T_PRIVATE                               { $$ = ZEND_ACC_PRIVATE; }
     776        1177 :         |       T_STATIC                                { $$ = ZEND_ACC_STATIC; }
     777        7245 :         |       T_ABSTRACT                              { $$ = ZEND_ACC_ABSTRACT; }
     778          78 :         |       T_FINAL                                 { $$ = ZEND_ACC_FINAL; }
     779          27 : ;
     780             : 
     781             : property_list:
     782          42 :                 property_list ',' property { $$ = zend_ast_list_add($1, $3); }
     783          42 :         |       property { $$ = zend_ast_create_list(1, ZEND_AST_PROP_DECL, $1); }
     784        2524 : ;
     785             : 
     786             : property:
     787        1181 :                 T_VARIABLE { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, NULL); }
     788        1181 :         |       T_VARIABLE '=' expr
     789        1385 :                         { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, $3); }
     790        1385 : ;
     791             : 
     792             : class_const_list:
     793           7 :                 class_const_list ',' class_const_decl { $$ = zend_ast_list_add($1, $3); }
     794           7 :         |       class_const_decl { $$ = zend_ast_create_list(1, ZEND_AST_CLASS_CONST_DECL, $1); }
     795         328 : ;
     796             : 
     797             : class_const_decl:
     798         335 :         identifier '=' expr { $$ = zend_ast_create(ZEND_AST_CONST_ELEM, $1, $3); }
     799         335 : ;
     800             : 
     801             : const_decl:
     802         260 :         T_STRING '=' expr { $$ = zend_ast_create(ZEND_AST_CONST_ELEM, $1, $3); }
     803         260 : ;
     804             : 
     805             : echo_expr_list:
     806        1885 :                 echo_expr_list ',' echo_expr { $$ = zend_ast_list_add($1, $3); }
     807        1885 :         |       echo_expr { $$ = zend_ast_create_list(1, ZEND_AST_STMT_LIST, $1); }
     808       30503 : ;
     809             : echo_expr:
     810       32388 :         expr { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
     811       32388 : ;
     812             : 
     813             : for_exprs:
     814           7 :                 /* empty */                     { $$ = NULL; }
     815           7 :         |       non_empty_for_exprs     { $$ = $1; }
     816        6188 : ;
     817             : 
     818             : non_empty_for_exprs:
     819           9 :                 non_empty_for_exprs ',' expr { $$ = zend_ast_list_add($1, $3); }
     820           9 :         |       expr { $$ = zend_ast_create_list(1, ZEND_AST_EXPR_LIST, $1); }
     821        6188 : ;
     822             : 
     823             : anonymous_class:
     824          14 :         T_CLASS { $<num>$ = CG(zend_lineno); } ctor_arguments
     825          14 :                 extends_from implements_list backup_doc_comment '{' class_statement_list '}' {
     826          70 :                         zend_ast *decl = zend_ast_create_decl(
     827          28 :                                 ZEND_AST_CLASS, ZEND_ACC_ANON_CLASS, $<num>2, $6, NULL,
     828          56 :                                 $4, $5, $8, NULL);
     829          14 :                         $$ = zend_ast_create(ZEND_AST_NEW, decl, $3);
     830             :                 }
     831          14 : ;
     832             : 
     833             : new_expr:
     834             :                 T_NEW class_name_reference ctor_arguments
     835       14483 :                         { $$ = zend_ast_create(ZEND_AST_NEW, $2, $3); }
     836       14483 :         |       T_NEW anonymous_class
     837          14 :                         { $$ = $2; }
     838          14 : ;
     839             : 
     840             : expr_without_variable:
     841             :                 T_LIST '(' assignment_list ')' '=' expr
     842         151 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $3, $6); }
     843         151 :         |       variable '=' expr
     844      130798 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN, $1, $3); }
     845      130798 :         |       variable '=' '&' variable
     846         426 :                         { $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
     847         426 :         |       T_CLONE expr { $$ = zend_ast_create(ZEND_AST_CLONE, $2); }
     848         117 :         |       variable T_PLUS_EQUAL expr
     849        1396 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_ADD, $1, $3); }
     850         698 :         |       variable T_MINUS_EQUAL expr
     851         278 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SUB, $1, $3); }
     852         139 :         |       variable T_MUL_EQUAL expr
     853          32 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MUL, $1, $3); }
     854          16 :         |       variable T_POW_EQUAL expr
     855           4 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_POW, $1, $3); }
     856           2 :         |       variable T_DIV_EQUAL expr
     857          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_DIV, $1, $3); }
     858           5 :         |       variable T_CONCAT_EQUAL expr
     859        5514 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_CONCAT, $1, $3); }
     860        2757 :         |       variable T_MOD_EQUAL expr
     861          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_MOD, $1, $3); }
     862           5 :         |       variable T_AND_EQUAL expr
     863          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_AND, $1, $3); }
     864           5 :         |       variable T_OR_EQUAL expr
     865         196 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_OR, $1, $3); }
     866          98 :         |       variable T_XOR_EQUAL expr
     867           8 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_BW_XOR, $1, $3); }
     868           4 :         |       variable T_SL_EQUAL expr
     869          14 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SL, $1, $3); }
     870           7 :         |       variable T_SR_EQUAL expr
     871          10 :                         { $$ = zend_ast_create_assign_op(ZEND_ASSIGN_SR, $1, $3); }
     872           5 :         |       variable T_INC { $$ = zend_ast_create(ZEND_AST_POST_INC, $1); }
     873        5579 :         |       T_INC variable { $$ = zend_ast_create(ZEND_AST_PRE_INC, $2); }
     874         528 :         |       variable T_DEC { $$ = zend_ast_create(ZEND_AST_POST_DEC, $1); }
     875          79 :         |       T_DEC variable { $$ = zend_ast_create(ZEND_AST_PRE_DEC, $2); }
     876          16 :         |       expr T_BOOLEAN_OR expr
     877        4302 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     878        4302 :         |       expr T_BOOLEAN_AND expr
     879        6739 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     880        6739 :         |       expr T_LOGICAL_OR expr
     881         913 :                         { $$ = zend_ast_create(ZEND_AST_OR, $1, $3); }
     882         913 :         |       expr T_LOGICAL_AND expr
     883          14 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
     884          14 :         |       expr T_LOGICAL_XOR expr
     885           4 :                         { $$ = zend_ast_create_binary_op(ZEND_BOOL_XOR, $1, $3); }
     886         688 :         |       expr '|' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_OR, $1, $3); }
     887        1887 :         |       expr '&' expr       { $$ = zend_ast_create_binary_op(ZEND_BW_AND, $1, $3); }
     888        1225 :         |       expr '^' expr   { $$ = zend_ast_create_binary_op(ZEND_BW_XOR, $1, $3); }
     889       33508 :         |       expr '.' expr   { $$ = zend_ast_create_binary_op(ZEND_CONCAT, $1, $3); }
     890       37111 :         |       expr '+' expr   { $$ = zend_ast_create_binary_op(ZEND_ADD, $1, $3); }
     891        4762 :         |       expr '-' expr   { $$ = zend_ast_create_binary_op(ZEND_SUB, $1, $3); }
     892        3977 :         |       expr '*' expr   { $$ = zend_ast_create_binary_op(ZEND_MUL, $1, $3); }
     893        2853 :         |       expr T_POW expr { $$ = zend_ast_create_binary_op(ZEND_POW, $1, $3); }
     894         542 :         |       expr '/' expr   { $$ = zend_ast_create_binary_op(ZEND_DIV, $1, $3); }
     895         657 :         |       expr '%' expr   { $$ = zend_ast_create_binary_op(ZEND_MOD, $1, $3); }
     896         268 :         |       expr T_SL expr  { $$ = zend_ast_create_binary_op(ZEND_SL, $1, $3); }
     897         213 :         |       expr T_SR expr  { $$ = zend_ast_create_binary_op(ZEND_SR, $1, $3); }
     898          71 :         |       '+' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_PLUS, $2); }
     899         251 :         |       '-' expr %prec T_INC { $$ = zend_ast_create(ZEND_AST_UNARY_MINUS, $2); }
     900        6233 :         |       '!' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BOOL_NOT, $2); }
     901       27562 :         |       '~' expr { $$ = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BW_NOT, $2); }
     902          91 :         |       expr T_IS_IDENTICAL expr
     903       11492 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_IDENTICAL, $1, $3); }
     904        5746 :         |       expr T_IS_NOT_IDENTICAL expr
     905       13452 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_IDENTICAL, $1, $3); }
     906        6726 :         |       expr T_IS_EQUAL expr
     907       32116 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_EQUAL, $1, $3); }
     908       16058 :         |       expr T_IS_NOT_EQUAL expr
     909        5696 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_NOT_EQUAL, $1, $3); }
     910        2848 :         |       expr '<' expr
     911        3820 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER, $1, $3); }
     912        1910 :         |       expr T_IS_SMALLER_OR_EQUAL expr
     913        3502 :                         { $$ = zend_ast_create_binary_op(ZEND_IS_SMALLER_OR_EQUAL, $1, $3); }
     914        1751 :         |       expr '>' expr
     915         896 :                         { $$ = zend_ast_create(ZEND_AST_GREATER, $1, $3); }
     916         896 :         |       expr T_IS_GREATER_OR_EQUAL expr
     917         469 :                         { $$ = zend_ast_create(ZEND_AST_GREATER_EQUAL, $1, $3); }
     918         469 :         |       expr T_SPACESHIP expr
     919          20 :                         { $$ = zend_ast_create_binary_op(ZEND_SPACESHIP, $1, $3); }
     920          10 :         |       expr T_INSTANCEOF class_name_reference
     921          68 :                         { $$ = zend_ast_create(ZEND_AST_INSTANCEOF, $1, $3); }
     922          68 :         |       '(' expr ')' { $$ = $2; }
     923       25463 :         |       new_expr { $$ = $1; }
     924       14497 :         |       expr '?' expr ':' expr
     925       25138 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, $3, $5); }
     926       25138 :         |       expr '?' ':' expr
     927         194 :                         { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, NULL, $4); }
     928         194 :         |       expr T_COALESCE expr
     929          20 :                         { $$ = zend_ast_create(ZEND_AST_COALESCE, $1, $3); }
     930          20 :         |       internal_functions_in_yacc { $$ = $1; }
     931       28156 :         |       T_INT_CAST expr         { $$ = zend_ast_create_cast(IS_LONG, $2); }
     932        4818 :         |       T_DOUBLE_CAST expr      { $$ = zend_ast_create_cast(IS_DOUBLE, $2); }
     933        1343 :         |       T_STRING_CAST expr      { $$ = zend_ast_create_cast(IS_STRING, $2); }
     934        1337 :         |       T_ARRAY_CAST expr       { $$ = zend_ast_create_cast(IS_ARRAY, $2); }
     935         192 :         |       T_OBJECT_CAST expr      { $$ = zend_ast_create_cast(IS_OBJECT, $2); }
     936         244 :         |       T_BOOL_CAST expr        { $$ = zend_ast_create_cast(_IS_BOOL, $2); }
     937          72 :         |       T_UNSET_CAST expr       { $$ = zend_ast_create_cast(IS_NULL, $2); }
     938           0 :         |       T_EXIT exit_expr        { $$ = zend_ast_create(ZEND_AST_EXIT, $2); }
     939       14562 :         |       '@' expr                        { $$ = zend_ast_create(ZEND_AST_SILENCE, $2); }
     940        5322 :         |       scalar { $$ = $1; }
     941      648394 :         |       '`' backticks_expr '`' { $$ = zend_ast_create(ZEND_AST_SHELL_EXEC, $2); }
     942         114 :         |       T_PRINT expr { $$ = zend_ast_create(ZEND_AST_PRINT, $2); }
     943        3348 :         |       T_YIELD { $$ = zend_ast_create(ZEND_AST_YIELD, NULL, NULL); }
     944          59 :         |       T_YIELD expr { $$ = zend_ast_create(ZEND_AST_YIELD, $2, NULL); }
     945         117 :         |       T_YIELD expr T_DOUBLE_ARROW expr { $$ = zend_ast_create(ZEND_AST_YIELD, $4, $2); }
     946          33 :         |       T_YIELD_FROM expr { $$ = zend_ast_create(ZEND_AST_YIELD_FROM, $2); }
     947          22 :         |       function returns_ref '(' parameter_list ')' lexical_vars return_type
     948             :                 backup_doc_comment '{' inner_statement_list '}'
     949        2170 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $2, $1, $8,
     950             :                                   zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     951        1736 :                               $4, $6, $10, $7); }
     952         434 :         |       T_STATIC function returns_ref '(' parameter_list ')' lexical_vars
     953             :                 return_type backup_doc_comment '{' inner_statement_list '}'
     954          55 :                         { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $3 | ZEND_ACC_STATIC, $2, $9,
     955             :                               zend_string_init("{closure}", sizeof("{closure}") - 1, 0),
     956          44 :                               $5, $7, $11, $8); }
     957          11 : ;
     958             : 
     959             : function:
     960       36054 :         T_FUNCTION { $$ = CG(zend_lineno); }
     961       36054 : ;
     962             : 
     963             : backup_doc_comment:
     964       43589 :         /* empty */ { $$ = CG(doc_comment); CG(doc_comment) = NULL; }
     965       43589 : ;
     966             : 
     967             : returns_ref:
     968       35971 :                 /* empty */     { $$ = 0; }
     969       35971 :         |       '&'                 { $$ = ZEND_ACC_RETURN_REFERENCE; }
     970          83 : ;
     971             : 
     972             : lexical_vars:
     973         276 :                 /* empty */ { $$ = NULL; }
     974         276 :         |       T_USE '(' lexical_var_list ')' { $$ = $3; }
     975         169 : ;
     976             : 
     977             : lexical_var_list:
     978          10 :                 lexical_var_list ',' lexical_var { $$ = zend_ast_list_add($1, $3); }
     979          10 :         |       lexical_var { $$ = zend_ast_create_list(1, ZEND_AST_CLOSURE_USES, $1); }
     980         169 : ;
     981             : 
     982             : lexical_var:
     983         148 :                 T_VARIABLE              { $$ = $1; }
     984         148 :         |       '&' T_VARIABLE      { $$ = $2; $$->attr = 1; }
     985          31 : ;
     986             : 
     987             : function_call:
     988             :                 name argument_list
     989      246808 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
     990      246808 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
     991       10477 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
     992       10477 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
     993          43 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
     994          43 :         |       callable_expr argument_list
     995        2118 :                         { $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
     996        2118 : ;
     997             : 
     998             : class_name:
     999             :                 T_STATIC
    1000         142 :                         { zval zv; ZVAL_STRINGL(&zv, "static", sizeof("static")-1);
    1001          71 :                           $$ = zend_ast_create_zval_ex(&zv, ZEND_NAME_NOT_FQ); }
    1002          71 :         |       name { $$ = $1; }
    1003       33915 : ;
    1004             : 
    1005             : class_name_reference:
    1006       13396 :                 class_name              { $$ = $1; }
    1007       13396 :         |       new_variable    { $$ = $1; }
    1008        1155 : ;
    1009             : 
    1010             : exit_expr:
    1011         407 :                 /* empty */                             { $$ = NULL; }
    1012         407 :         |       '(' optional_expr ')'   { $$ = $2; }
    1013       14155 : ;
    1014             : 
    1015             : backticks_expr:
    1016             :                 /* empty */
    1017           0 :                         { $$ = zend_ast_create_zval_from_str(STR_EMPTY_ALLOC()); }
    1018           0 :         |       T_ENCAPSED_AND_WHITESPACE { $$ = $1; }
    1019           7 :         |       encaps_list { $$ = $1; }
    1020         107 : ;
    1021             : 
    1022             : 
    1023             : ctor_arguments:
    1024        2772 :                 /* empty */     { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
    1025        2772 :         |       argument_list { $$ = $1; }
    1026       11725 : ;
    1027             : 
    1028             : 
    1029             : dereferencable_scalar:
    1030       24722 :                 T_ARRAY '(' array_pair_list ')' { $$ = $3; }
    1031       24722 :         |       '[' array_pair_list ']'                 { $$ = $2; }
    1032         851 :         |       T_CONSTANT_ENCAPSED_STRING              { $$ = $1; }
    1033      342492 : ;
    1034             : 
    1035             : scalar:
    1036      160819 :                 T_LNUMBER       { $$ = $1; }
    1037      160819 :         |       T_DNUMBER       { $$ = $1; }
    1038        6656 :         |       T_LINE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_LINE); }
    1039          18 :         |       T_FILE          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FILE); }
    1040        7434 :         |       T_DIR           { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_DIR); }
    1041         485 :         |       T_TRAIT_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_TRAIT_C); }
    1042           5 :         |       T_METHOD_C      { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_METHOD_C); }
    1043         915 :         |       T_FUNC_C        { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_FUNC_C); }
    1044         124 :         |       T_NS_C          { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_NS_C); }
    1045          36 :         |       T_CLASS_C       { $$ = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C); }
    1046          89 :         |       T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = $2; }
    1047        1370 :         |       T_START_HEREDOC T_END_HEREDOC
    1048         118 :                         { $$ = zend_ast_create_zval_from_str(STR_EMPTY_ALLOC()); }
    1049          59 :         |       '"' encaps_list '"'   { $$ = $2; }
    1050       15362 :         |       T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; }
    1051         143 :         |       dereferencable_scalar   { $$ = $1; }
    1052      368032 :         |       constant                        { $$ = $1; }
    1053       86847 : ;
    1054             : 
    1055             : constant:
    1056       77482 :                 name { $$ = zend_ast_create(ZEND_AST_CONST, $1); }
    1057       77482 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM identifier
    1058        9370 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
    1059        9370 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier
    1060           8 :                         { $$ = zend_ast_create(ZEND_AST_CLASS_CONST, $1, $3); }
    1061           8 : ;
    1062             : 
    1063             : possible_comma:
    1064             :                 /* empty */
    1065             :         |       ','
    1066             : ;
    1067             : 
    1068             : expr:
    1069      687306 :                 variable                                        { $$ = $1; }
    1070      687306 :         |       expr_without_variable           { $$ = $1; }
    1071     1035395 : ;
    1072             : 
    1073             : optional_expr:
    1074        2913 :                 /* empty */     { $$ = NULL; }
    1075        2913 :         |       expr            { $$ = $1; }
    1076      180089 : ;
    1077             : 
    1078             : variable_class_name:
    1079          65 :         dereferencable { $$ = $1; }
    1080          65 : ;
    1081             : 
    1082             : dereferencable:
    1083      169286 :                 variable                                { $$ = $1; }
    1084      169286 :         |       '(' expr ')'                    { $$ = $2; }
    1085          55 :         |       dereferencable_scalar   { $$ = $1; }
    1086          29 : ;
    1087             : 
    1088             : callable_expr:
    1089        2105 :                 callable_variable               { $$ = $1; }
    1090        2105 :         |       '(' expr ')'                    { $$ = $2; }
    1091           9 :         |       dereferencable_scalar   { $$ = $1; }
    1092           4 : ;
    1093             : 
    1094             : callable_variable:
    1095             :                 simple_variable
    1096      589013 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1097      589013 :         |       dereferencable '[' optional_expr ']'
    1098      123046 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1099      123046 :         |       constant '[' optional_expr ']'
    1100          12 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1101          12 :         |       dereferencable '{' expr '}'
    1102          21 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1103          21 :         |       dereferencable T_OBJECT_OPERATOR property_name argument_list
    1104       35680 :                         { $$ = zend_ast_create(ZEND_AST_METHOD_CALL, $1, $3, $4); }
    1105       35680 :         |       function_call { $$ = $1; }
    1106      259446 : ;
    1107             : 
    1108             : variable:
    1109             :                 callable_variable
    1110     1005113 :                         { $$ = $1; }
    1111     1005113 :         |       static_member
    1112         756 :                         { $$ = $1; }
    1113         756 :         |       dereferencable T_OBJECT_OPERATOR property_name
    1114       10558 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1115       10558 : ;
    1116             : 
    1117             : simple_variable:
    1118      596212 :                 T_VARIABLE                      { $$ = $1; }
    1119      596212 :         |       '$' '{' expr '}'        { $$ = $3; }
    1120          45 :         |       '$' simple_variable     { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1121         160 : ;
    1122             : 
    1123             : static_member:
    1124             :                 class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1125         742 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1126         742 :         |       variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1127          14 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1128          14 : ;
    1129             : 
    1130             : new_variable:
    1131             :                 simple_variable
    1132        1154 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1133        1154 :         |       new_variable '[' optional_expr ']'
    1134          11 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1135          11 :         |       new_variable '{' expr '}'
    1136           1 :                         { $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
    1137           1 :         |       new_variable T_OBJECT_OPERATOR property_name
    1138           4 :                         { $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
    1139           4 :         |       class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1140           1 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1141           1 :         |       new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable
    1142           2 :                         { $$ = zend_ast_create(ZEND_AST_STATIC_PROP, $1, $3); }
    1143           2 : ;
    1144             : 
    1145             : member_name:
    1146       10478 :                 identifier { $$ = $1; }
    1147       10478 :         |       '{' expr '}'    { $$ = $2; }
    1148           8 :         |       simple_variable { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1149          34 : ;
    1150             : 
    1151             : property_name:
    1152       46000 :                 T_STRING { $$ = $1; }
    1153       46000 :         |       '{' expr '}'    { $$ = $2; }
    1154          66 :         |       simple_variable { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1155         176 : ;
    1156             : 
    1157             : assignment_list:
    1158             :                 assignment_list ',' assignment_list_element
    1159         243 :                         { $$ = zend_ast_list_add($1, $3); }
    1160         243 :         |       assignment_list_element
    1161         181 :                         { $$ = zend_ast_create_list(1, ZEND_AST_LIST, $1); }
    1162         181 : ;
    1163             : 
    1164             : assignment_list_element:
    1165         371 :                 variable                                                { $$ = $1; }
    1166         371 :         |       T_LIST '(' assignment_list ')'  { $$ = $3; }
    1167          21 :         |       /* empty */                                             { $$ = NULL; }
    1168          32 : ;
    1169             : 
    1170             : 
    1171             : array_pair_list:
    1172        3369 :                 /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_ARRAY); }
    1173        3369 :         |       non_empty_array_pair_list possible_comma { $$ = $1; }
    1174       22205 : ;
    1175             : 
    1176             : non_empty_array_pair_list:
    1177             :                 non_empty_array_pair_list ',' array_pair
    1178       74125 :                         { $$ = zend_ast_list_add($1, $3); }
    1179       74125 :         |       array_pair
    1180       22205 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ARRAY, $1); }
    1181       22205 : ;
    1182             : 
    1183             : array_pair:
    1184             :                 expr T_DOUBLE_ARROW expr
    1185       27070 :                         { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $3, $1); }
    1186       27070 :         |       expr { $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $1, NULL); }
    1187       69105 :         |       expr T_DOUBLE_ARROW '&' variable
    1188          61 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $4, $1); }
    1189          61 :         |       '&' variable
    1190          94 :                         { $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $2, NULL); }
    1191          94 : ;
    1192             : 
    1193             : encaps_list:
    1194             :                 encaps_list encaps_var
    1195        6462 :                         { $$ = zend_ast_list_add($1, $2); }
    1196        6462 :         |       encaps_list T_ENCAPSED_AND_WHITESPACE
    1197       15393 :                         { $$ = zend_ast_list_add($1, $2); }
    1198       15393 :         |       encaps_var
    1199        4481 :                         { $$ = zend_ast_create_list(1, ZEND_AST_ENCAPS_LIST, $1); }
    1200        4481 :         |       T_ENCAPSED_AND_WHITESPACE encaps_var
    1201       11132 :                         { $$ = zend_ast_create_list(2, ZEND_AST_ENCAPS_LIST, $1, $2); }
    1202       11132 : ;
    1203             : 
    1204             : encaps_var:
    1205             :                 T_VARIABLE
    1206       19297 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1207       19297 :         |       T_VARIABLE '[' encaps_var_offset ']'
    1208        1962 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1209        1962 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1210         981 :         |       T_VARIABLE T_OBJECT_OPERATOR T_STRING
    1211         168 :                         { $$ = zend_ast_create(ZEND_AST_PROP,
    1212          84 :                               zend_ast_create(ZEND_AST_VAR, $1), $3); }
    1213          84 :         |       T_DOLLAR_OPEN_CURLY_BRACES expr '}'
    1214           3 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1215           3 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}'
    1216         376 :                         { $$ = zend_ast_create(ZEND_AST_VAR, $2); }
    1217         376 :         |       T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}'
    1218           0 :                         { $$ = zend_ast_create(ZEND_AST_DIM,
    1219           0 :                               zend_ast_create(ZEND_AST_VAR, $2), $4); }
    1220           0 :         |       T_CURLY_OPEN variable '}' { $$ = $2; }
    1221        1334 : ;
    1222             : 
    1223             : encaps_var_offset:
    1224           4 :                 T_STRING                { $$ = $1; }
    1225           4 :         |       T_NUM_STRING    { $$ = $1; }
    1226         383 :         |       T_VARIABLE              { $$ = zend_ast_create(ZEND_AST_VAR, $1); }
    1227         594 : ;
    1228             : 
    1229             : 
    1230             : internal_functions_in_yacc:
    1231        5524 :                 T_ISSET '(' isset_variables ')' { $$ = $3; }
    1232        5524 :         |       T_EMPTY '(' expr ')' { $$ = zend_ast_create(ZEND_AST_EMPTY, $3); }
    1233        7280 :         |       T_INCLUDE expr
    1234        1930 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE, $2); }
    1235        1930 :         |       T_INCLUDE_ONCE expr
    1236         508 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_INCLUDE_ONCE, $2); }
    1237         508 :         |       T_EVAL '(' expr ')'
    1238        1956 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_EVAL, $3); }
    1239        1956 :         |       T_REQUIRE expr
    1240         782 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE, $2); }
    1241         782 :         |       T_REQUIRE_ONCE expr
    1242        5384 :                         { $$ = zend_ast_create_ex(ZEND_AST_INCLUDE_OR_EVAL, ZEND_REQUIRE_ONCE, $2); }
    1243        5384 : ;
    1244             : 
    1245             : isset_variables:
    1246        5524 :                 isset_variable { $$ = $1; }
    1247        5524 :         |       isset_variables ',' isset_variable
    1248          44 :                         { $$ = zend_ast_create(ZEND_AST_AND, $1, $3); }
    1249          44 : ;
    1250             : 
    1251             : isset_variable:
    1252        5568 :                 expr { $$ = zend_ast_create(ZEND_AST_ISSET, $1); }
    1253             : ;
    1254             : 
    1255             : %%
    1256             : 
    1257             : /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
    1258             :    quotes and backslashes, so that it's suitable for yyerror.  The
    1259             :    heuristic is that double-quoting is unnecessary unless the string
    1260             :    contains an apostrophe, a comma, or backslash (other than
    1261             :    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
    1262             :    null, do not copy; instead, return the length of what the result
    1263             :    would have been.  */
    1264         489 : static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
    1265             : {
    1266         489 :         if (!yyres) {
    1267         390 :                 return yystrlen(yystr);
    1268             :         }
    1269             :         {
    1270          99 :                 if (CG(parse_error) == 0) {
    1271             :                         char buffer[120];
    1272          48 :                         const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
    1273          48 :                         unsigned int len = 0, toklen = 0, yystr_len;
    1274             : 
    1275          48 :                         CG(parse_error) = 1;
    1276             : 
    1277          58 :                         if (LANG_SCNG(yy_text)[0] == 0 &&
    1278           5 :                                 LANG_SCNG(yy_leng) == 1 &&
    1279           5 :                                 memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
    1280           5 :                                 yystpcpy(yyres, "end of file");
    1281           5 :                                 return sizeof("end of file")-1;
    1282             :                         }
    1283             : 
    1284          43 :                         str = LANG_SCNG(yy_text);
    1285          43 :                         end = memchr(str, '\n', LANG_SCNG(yy_leng));
    1286          43 :                         yystr_len = (unsigned int)yystrlen(yystr);
    1287             : 
    1288          95 :                         if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
    1289          26 :                                 && (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
    1290          26 :                                 toklen = (tok2 - tok1) + 1;
    1291             :                         } else {
    1292          17 :                                 tok1 = tok2 = NULL;
    1293          17 :                                 toklen = 0;
    1294             :                         }
    1295             : 
    1296          43 :                         if (end == NULL) {
    1297          42 :                                 len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
    1298             :                         } else {
    1299           1 :                                 len = (end - str) > 30 ? 30 : (end - str);
    1300             :                         }
    1301          43 :                         if (toklen) {
    1302          26 :                                 snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
    1303             :                         } else {
    1304          17 :                                 snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
    1305             :                         }
    1306          43 :                         yystpcpy(yyres, buffer);
    1307          43 :                         return len + (toklen ? toklen + 1 : 0) + 2;
    1308             :                 }
    1309             :         }
    1310          51 :         if (*yystr == '"') {
    1311          25 :                 YYSIZE_T yyn = 0;
    1312          25 :                 const char *yyp = yystr;
    1313             : 
    1314         506 :                 for (; *++yyp != '"'; ++yyn) {
    1315         481 :                         yyres[yyn] = *yyp;
    1316             :                 }
    1317          25 :                 yyres[yyn] = '\0';
    1318          25 :                 return yyn;
    1319             :         }
    1320          26 :         yystpcpy(yyres, yystr);
    1321          26 :         return strlen(yystr);
    1322             : }
    1323             : 
    1324             : /*
    1325             :  * Local variables:
    1326             :  * tab-width: 4
    1327             :  * c-basic-offset: 4
    1328             :  * indent-tabs-mode: t
    1329             :  * End:
    1330             :  */

Generated by: LCOV version 1.10

Generated at Fri, 31 Jul 2015 08:58:46 +0000 (23 minutes ago)

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