php7.2.5 opcodes附录 作者: lovingyu_er 时间: 2019-05-15 17:32:42 分类: php附录 评论 ```php /* +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ | Copyright (c) 1998-2018 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.zend.com/license/2_00.txt. | | If you did not receive a copy of the Zend license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@zend.com so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | | Dmitry Stogov | +----------------------------------------------------------------------+ */ #ifndef ZEND_VM_OPCODES_H #define ZEND_VM_OPCODES_H #define ZEND_VM_SPEC 1 #define ZEND_VM_LINES 0 #define ZEND_VM_KIND_CALL 1 #define ZEND_VM_KIND_SWITCH 2 #define ZEND_VM_KIND_GOTO 3 #define ZEND_VM_KIND_HYBRID 4 /* HYBRID requires support for computed GOTO and global register variables*/ #if (defined(__GNUC__) && defined(HAVE_GCC_GLOBAL_REGS)) # define ZEND_VM_KIND ZEND_VM_KIND_HYBRID #else # define ZEND_VM_KIND ZEND_VM_KIND_CALL #endif #define ZEND_VM_OP_SPEC 0x00000001 #define ZEND_VM_OP_CONST 0x00000002 #define ZEND_VM_OP_TMPVAR 0x00000004 #define ZEND_VM_OP_TMPVARCV 0x00000008 #define ZEND_VM_OP_MASK 0x000000f0 #define ZEND_VM_OP_NUM 0x00000010 #define ZEND_VM_OP_JMP_ADDR 0x00000020 #define ZEND_VM_OP_TRY_CATCH 0x00000030 #define ZEND_VM_OP_THIS 0x00000050 #define ZEND_VM_OP_NEXT 0x00000060 #define ZEND_VM_OP_CLASS_FETCH 0x00000070 #define ZEND_VM_OP_CONSTRUCTOR 0x00000080 #define ZEND_VM_OP_CONST_FETCH 0x00000090 #define ZEND_VM_OP_CACHE_SLOT 0x000000a0 #define ZEND_VM_EXT_VAR_FETCH 0x00010000 #define ZEND_VM_EXT_ISSET 0x00020000 #define ZEND_VM_EXT_CACHE_SLOT 0x00040000 #define ZEND_VM_EXT_ARRAY_INIT 0x00080000 #define ZEND_VM_EXT_REF 0x00100000 #define ZEND_VM_EXT_MASK 0x0f000000 #define ZEND_VM_EXT_NUM 0x01000000 #define ZEND_VM_EXT_LAST_CATCH 0x02000000 #define ZEND_VM_EXT_JMP_ADDR 0x03000000 #define ZEND_VM_EXT_DIM_OBJ 0x04000000 #define ZEND_VM_EXT_TYPE 0x07000000 #define ZEND_VM_EXT_EVAL 0x08000000 #define ZEND_VM_EXT_TYPE_MASK 0x09000000 #define ZEND_VM_EXT_SRC 0x0b000000 #define ZEND_VM_NO_CONST_CONST 0x40000000 #define ZEND_VM_COMMUTATIVE 0x80000000 #define ZEND_VM_OP1_FLAGS(flags) (flags & 0xff) #define ZEND_VM_OP2_FLAGS(flags) ((flags >> 8) & 0xff) BEGIN_EXTERN_C() ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode); ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode); END_EXTERN_C() #define ZEND_NOP 0 #define ZEND_ADD 1 #define ZEND_SUB 2 #define ZEND_MUL 3 #define ZEND_DIV 4 #define ZEND_MOD 5 #define ZEND_SL 6 #define ZEND_SR 7 #define ZEND_CONCAT 8 #define ZEND_BW_OR 9 #define ZEND_BW_AND 10 #define ZEND_BW_XOR 11 #define ZEND_BW_NOT 12 #define ZEND_BOOL_NOT 13 #define ZEND_BOOL_XOR 14 #define ZEND_IS_IDENTICAL 15 #define ZEND_IS_NOT_IDENTICAL 16 #define ZEND_IS_EQUAL 17 #define ZEND_IS_NOT_EQUAL 18 #define ZEND_IS_SMALLER 19 #define ZEND_IS_SMALLER_OR_EQUAL 20 #define ZEND_CAST 21 #define ZEND_QM_ASSIGN 22 #define ZEND_ASSIGN_ADD 23 #define ZEND_ASSIGN_SUB 24 #define ZEND_ASSIGN_MUL 25 #define ZEND_ASSIGN_DIV 26 #define ZEND_ASSIGN_MOD 27 #define ZEND_ASSIGN_SL 28 #define ZEND_ASSIGN_SR 29 #define ZEND_ASSIGN_CONCAT 30 #define ZEND_ASSIGN_BW_OR 31 #define ZEND_ASSIGN_BW_AND 32 #define ZEND_ASSIGN_BW_XOR 33 #define ZEND_PRE_INC 34 #define ZEND_PRE_DEC 35 #define ZEND_POST_INC 36 #define ZEND_POST_DEC 37 #define ZEND_ASSIGN 38 #define ZEND_ASSIGN_REF 39 #define ZEND_ECHO 40 #define ZEND_GENERATOR_CREATE 41 #define ZEND_JMP 42 #define ZEND_JMPZ 43 #define ZEND_JMPNZ 44 #define ZEND_JMPZNZ 45 #define ZEND_JMPZ_EX 46 #define ZEND_JMPNZ_EX 47 #define ZEND_CASE 48 #define ZEND_CHECK_VAR 49 #define ZEND_SEND_VAR_NO_REF_EX 50 #define ZEND_MAKE_REF 51 #define ZEND_BOOL 52 #define ZEND_FAST_CONCAT 53 #define ZEND_ROPE_INIT 54 #define ZEND_ROPE_ADD 55 #define ZEND_ROPE_END 56 #define ZEND_BEGIN_SILENCE 57 #define ZEND_END_SILENCE 58 #define ZEND_INIT_FCALL_BY_NAME 59 #define ZEND_DO_FCALL 60 #define ZEND_INIT_FCALL 61 #define ZEND_RETURN 62 #define ZEND_RECV 63 #define ZEND_RECV_INIT 64 #define ZEND_SEND_VAL 65 #define ZEND_SEND_VAR_EX 66 #define ZEND_SEND_REF 67 #define ZEND_NEW 68 #define ZEND_INIT_NS_FCALL_BY_NAME 69 #define ZEND_FREE 70 #define ZEND_INIT_ARRAY 71 #define ZEND_ADD_ARRAY_ELEMENT 72 #define ZEND_INCLUDE_OR_EVAL 73 #define ZEND_UNSET_VAR 74 #define ZEND_UNSET_DIM 75 #define ZEND_UNSET_OBJ 76 #define ZEND_FE_RESET_R 77 #define ZEND_FE_FETCH_R 78 #define ZEND_EXIT 79 #define ZEND_FETCH_R 80 #define ZEND_FETCH_DIM_R 81 #define ZEND_FETCH_OBJ_R 82 #define ZEND_FETCH_W 83 #define ZEND_FETCH_DIM_W 84 #define ZEND_FETCH_OBJ_W 85 #define ZEND_FETCH_RW 86 #define ZEND_FETCH_DIM_RW 87 #define ZEND_FETCH_OBJ_RW 88 #define ZEND_FETCH_IS 89 #define ZEND_FETCH_DIM_IS 90 #define ZEND_FETCH_OBJ_IS 91 #define ZEND_FETCH_FUNC_ARG 92 #define ZEND_FETCH_DIM_FUNC_ARG 93 #define ZEND_FETCH_OBJ_FUNC_ARG 94 #define ZEND_FETCH_UNSET 95 #define ZEND_FETCH_DIM_UNSET 96 #define ZEND_FETCH_OBJ_UNSET 97 #define ZEND_FETCH_LIST_R 98 #define ZEND_FETCH_CONSTANT 99 #define ZEND_CHECK_FUNC_ARG 100 #define ZEND_EXT_STMT 101 #define ZEND_EXT_FCALL_BEGIN 102 #define ZEND_EXT_FCALL_END 103 #define ZEND_EXT_NOP 104 #define ZEND_TICKS 105 #define ZEND_SEND_VAR_NO_REF 106 #define ZEND_CATCH 107 #define ZEND_THROW 108 #define ZEND_FETCH_CLASS 109 #define ZEND_CLONE 110 #define ZEND_RETURN_BY_REF 111 #define ZEND_INIT_METHOD_CALL 112 #define ZEND_INIT_STATIC_METHOD_CALL 113 #define ZEND_ISSET_ISEMPTY_VAR 114 #define ZEND_ISSET_ISEMPTY_DIM_OBJ 115 #define ZEND_SEND_VAL_EX 116 #define ZEND_SEND_VAR 117 #define ZEND_INIT_USER_CALL 118 #define ZEND_SEND_ARRAY 119 #define ZEND_SEND_USER 120 #define ZEND_STRLEN 121 #define ZEND_DEFINED 122 #define ZEND_TYPE_CHECK 123 #define ZEND_VERIFY_RETURN_TYPE 124 #define ZEND_FE_RESET_RW 125 #define ZEND_FE_FETCH_RW 126 #define ZEND_FE_FREE 127 #define ZEND_INIT_DYNAMIC_CALL 128 #define ZEND_DO_ICALL 129 #define ZEND_DO_UCALL 130 #define ZEND_DO_FCALL_BY_NAME 131 #define ZEND_PRE_INC_OBJ 132 #define ZEND_PRE_DEC_OBJ 133 #define ZEND_POST_INC_OBJ 134 #define ZEND_POST_DEC_OBJ 135 #define ZEND_ASSIGN_OBJ 136 #define ZEND_OP_DATA 137 #define ZEND_INSTANCEOF 138 #define ZEND_DECLARE_CLASS 139 #define ZEND_DECLARE_INHERITED_CLASS 140 #define ZEND_DECLARE_FUNCTION 141 #define ZEND_YIELD_FROM 142 #define ZEND_DECLARE_CONST 143 #define ZEND_ADD_INTERFACE 144 #define ZEND_DECLARE_INHERITED_CLASS_DELAYED 145 #define ZEND_VERIFY_ABSTRACT_CLASS 146 #define ZEND_ASSIGN_DIM 147 #define ZEND_ISSET_ISEMPTY_PROP_OBJ 148 #define ZEND_HANDLE_EXCEPTION 149 #define ZEND_USER_OPCODE 150 #define ZEND_ASSERT_CHECK 151 #define ZEND_JMP_SET 152 #define ZEND_DECLARE_LAMBDA_FUNCTION 153 #define ZEND_ADD_TRAIT 154 #define ZEND_BIND_TRAITS 155 #define ZEND_SEPARATE 156 #define ZEND_FETCH_CLASS_NAME 157 #define ZEND_CALL_TRAMPOLINE 158 #define ZEND_DISCARD_EXCEPTION 159 #define ZEND_YIELD 160 #define ZEND_GENERATOR_RETURN 161 #define ZEND_FAST_CALL 162 #define ZEND_FAST_RET 163 #define ZEND_RECV_VARIADIC 164 #define ZEND_SEND_UNPACK 165 #define ZEND_POW 166 #define ZEND_ASSIGN_POW 167 #define ZEND_BIND_GLOBAL 168 #define ZEND_COALESCE 169 #define ZEND_SPACESHIP 170 #define ZEND_DECLARE_ANON_CLASS 171 #define ZEND_DECLARE_ANON_INHERITED_CLASS 172 #define ZEND_FETCH_STATIC_PROP_R 173 #define ZEND_FETCH_STATIC_PROP_W 174 #define ZEND_FETCH_STATIC_PROP_RW 175 #define ZEND_FETCH_STATIC_PROP_IS 176 #define ZEND_FETCH_STATIC_PROP_FUNC_ARG 177 #define ZEND_FETCH_STATIC_PROP_UNSET 178 #define ZEND_UNSET_STATIC_PROP 179 #define ZEND_ISSET_ISEMPTY_STATIC_PROP 180 #define ZEND_FETCH_CLASS_CONSTANT 181 #define ZEND_BIND_LEXICAL 182 #define ZEND_BIND_STATIC 183 #define ZEND_FETCH_THIS 184 #define ZEND_SEND_FUNC_ARG 185 #define ZEND_ISSET_ISEMPTY_THIS 186 #define ZEND_SWITCH_LONG 187 #define ZEND_SWITCH_STRING 188 #define ZEND_IN_ARRAY 189 #define ZEND_COUNT 190 #define ZEND_GET_CLASS 191 #define ZEND_GET_CALLED_CLASS 192 #define ZEND_GET_TYPE 193 #define ZEND_FUNC_NUM_ARGS 194 #define ZEND_FUNC_GET_ARGS 195 #define ZEND_UNSET_CV 196 #define ZEND_ISSET_ISEMPTY_CV 197 #define ZEND_FETCH_LIST_W 198 #define ZEND_VM_LAST_OPCODE 198 #endif ```
php7.3.5 token对应表 作者: lovingyu_er 时间: 2019-05-15 11:27:58 分类: php附录 评论 php词法分析器,会将php的函数等一些 标签,解析成token ,token的映射关系如下: ```c /* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_ZEND_ZEND_ZEND_LANGUAGE_PARSER_H_INCLUDED # define YY_ZEND_ZEND_ZEND_LANGUAGE_PARSER_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int zenddebug; #endif /* "%code requires" blocks. */ /* Token type. */ #include "zend.h" #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { END = 0, T_INCLUDE = 258, T_INCLUDE_ONCE = 259, T_EVAL = 260, T_REQUIRE = 261, T_REQUIRE_ONCE = 262, T_LOGICAL_OR = 263, T_LOGICAL_XOR = 264, T_LOGICAL_AND = 265, T_PRINT = 266, T_YIELD = 267, T_DOUBLE_ARROW = 268, T_YIELD_FROM = 269, T_PLUS_EQUAL = 270, T_MINUS_EQUAL = 271, T_MUL_EQUAL = 272, T_DIV_EQUAL = 273, T_CONCAT_EQUAL = 274, T_MOD_EQUAL = 275, T_AND_EQUAL = 276, T_OR_EQUAL = 277, T_XOR_EQUAL = 278, T_SL_EQUAL = 279, T_SR_EQUAL = 280, T_POW_EQUAL = 281, T_COALESCE = 282, T_BOOLEAN_OR = 283, T_BOOLEAN_AND = 284, T_IS_EQUAL = 285, T_IS_NOT_EQUAL = 286, T_IS_IDENTICAL = 287, T_IS_NOT_IDENTICAL = 288, T_SPACESHIP = 289, T_IS_SMALLER_OR_EQUAL = 290, T_IS_GREATER_OR_EQUAL = 291, T_SL = 292, T_SR = 293, T_INSTANCEOF = 294, T_INC = 295, T_DEC = 296, T_INT_CAST = 297, T_DOUBLE_CAST = 298, T_STRING_CAST = 299, T_ARRAY_CAST = 300, T_OBJECT_CAST = 301, T_BOOL_CAST = 302, T_UNSET_CAST = 303, T_POW = 304, T_NEW = 305, T_CLONE = 306, T_NOELSE = 307, T_ELSEIF = 308, T_ELSE = 309, T_ENDIF = 310, T_STATIC = 311, T_ABSTRACT = 312, T_FINAL = 313, T_PRIVATE = 314, T_PROTECTED = 315, T_PUBLIC = 316, T_LNUMBER = 317, T_DNUMBER = 318, T_STRING = 319, T_VARIABLE = 320, T_INLINE_HTML = 321, T_ENCAPSED_AND_WHITESPACE = 322, T_CONSTANT_ENCAPSED_STRING = 323, T_STRING_VARNAME = 324, T_NUM_STRING = 325, T_EXIT = 326, T_IF = 327, T_ECHO = 328, T_DO = 329, T_WHILE = 330, T_ENDWHILE = 331, T_FOR = 332, T_ENDFOR = 333, T_FOREACH = 334, T_ENDFOREACH = 335, T_DECLARE = 336, T_ENDDECLARE = 337, T_AS = 338, T_SWITCH = 339, T_ENDSWITCH = 340, T_CASE = 341, T_DEFAULT = 342, T_BREAK = 343, T_CONTINUE = 344, T_GOTO = 345, T_FUNCTION = 346, T_CONST = 347, T_RETURN = 348, T_TRY = 349, T_CATCH = 350, T_FINALLY = 351, T_THROW = 352, T_USE = 353, T_INSTEADOF = 354, T_GLOBAL = 355, T_VAR = 356, T_UNSET = 357, T_ISSET = 358, T_EMPTY = 359, T_HALT_COMPILER = 360, T_CLASS = 361, T_TRAIT = 362, T_INTERFACE = 363, T_EXTENDS = 364, T_IMPLEMENTS = 365, T_OBJECT_OPERATOR = 366, T_LIST = 367, T_ARRAY = 368, T_CALLABLE = 369, T_LINE = 370, T_FILE = 371, T_DIR = 372, T_CLASS_C = 373, T_TRAIT_C = 374, T_METHOD_C = 375, T_FUNC_C = 376, T_COMMENT = 377, T_DOC_COMMENT = 378, T_OPEN_TAG = 379, T_OPEN_TAG_WITH_ECHO = 380, T_CLOSE_TAG = 381, T_WHITESPACE = 382, T_START_HEREDOC = 383, T_END_HEREDOC = 384, T_DOLLAR_OPEN_CURLY_BRACES = 385, T_CURLY_OPEN = 386, T_PAAMAYIM_NEKUDOTAYIM = 387, T_NAMESPACE = 388, T_NS_C = 389, T_NS_SEPARATOR = 390, T_ELLIPSIS = 391, T_ERROR = 392 }; #endif /* Tokens. */ #define END 0 #define T_INCLUDE 258 #define T_INCLUDE_ONCE 259 #define T_EVAL 260 #define T_REQUIRE 261 #define T_REQUIRE_ONCE 262 #define T_LOGICAL_OR 263 #define T_LOGICAL_XOR 264 #define T_LOGICAL_AND 265 #define T_PRINT 266 #define T_YIELD 267 #define T_DOUBLE_ARROW 268 #define T_YIELD_FROM 269 #define T_PLUS_EQUAL 270 #define T_MINUS_EQUAL 271 #define T_MUL_EQUAL 272 #define T_DIV_EQUAL 273 #define T_CONCAT_EQUAL 274 #define T_MOD_EQUAL 275 #define T_AND_EQUAL 276 #define T_OR_EQUAL 277 #define T_XOR_EQUAL 278 #define T_SL_EQUAL 279 #define T_SR_EQUAL 280 #define T_POW_EQUAL 281 #define T_COALESCE 282 #define T_BOOLEAN_OR 283 #define T_BOOLEAN_AND 284 #define T_IS_EQUAL 285 #define T_IS_NOT_EQUAL 286 #define T_IS_IDENTICAL 287 #define T_IS_NOT_IDENTICAL 288 #define T_SPACESHIP 289 #define T_IS_SMALLER_OR_EQUAL 290 #define T_IS_GREATER_OR_EQUAL 291 #define T_SL 292 #define T_SR 293 #define T_INSTANCEOF 294 #define T_INC 295 #define T_DEC 296 #define T_INT_CAST 297 #define T_DOUBLE_CAST 298 #define T_STRING_CAST 299 #define T_ARRAY_CAST 300 #define T_OBJECT_CAST 301 #define T_BOOL_CAST 302 #define T_UNSET_CAST 303 #define T_POW 304 #define T_NEW 305 #define T_CLONE 306 #define T_NOELSE 307 #define T_ELSEIF 308 #define T_ELSE 309 #define T_ENDIF 310 #define T_STATIC 311 #define T_ABSTRACT 312 #define T_FINAL 313 #define T_PRIVATE 314 #define T_PROTECTED 315 #define T_PUBLIC 316 #define T_LNUMBER 317 #define T_DNUMBER 318 #define T_STRING 319 #define T_VARIABLE 320 #define T_INLINE_HTML 321 #define T_ENCAPSED_AND_WHITESPACE 322 #define T_CONSTANT_ENCAPSED_STRING 323 #define T_STRING_VARNAME 324 #define T_NUM_STRING 325 #define T_EXIT 326 #define T_IF 327 #define T_ECHO 328 #define T_DO 329 #define T_WHILE 330 #define T_ENDWHILE 331 #define T_FOR 332 #define T_ENDFOR 333 #define T_FOREACH 334 #define T_ENDFOREACH 335 #define T_DECLARE 336 #define T_ENDDECLARE 337 #define T_AS 338 #define T_SWITCH 339 #define T_ENDSWITCH 340 #define T_CASE 341 #define T_DEFAULT 342 #define T_BREAK 343 #define T_CONTINUE 344 #define T_GOTO 345 #define T_FUNCTION 346 #define T_CONST 347 #define T_RETURN 348 #define T_TRY 349 #define T_CATCH 350 #define T_FINALLY 351 #define T_THROW 352 #define T_USE 353 #define T_INSTEADOF 354 #define T_GLOBAL 355 #define T_VAR 356 #define T_UNSET 357 #define T_ISSET 358 #define T_EMPTY 359 #define T_HALT_COMPILER 360 #define T_CLASS 361 #define T_TRAIT 362 #define T_INTERFACE 363 #define T_EXTENDS 364 #define T_IMPLEMENTS 365 #define T_OBJECT_OPERATOR 366 #define T_LIST 367 #define T_ARRAY 368 #define T_CALLABLE 369 #define T_LINE 370 #define T_FILE 371 #define T_DIR 372 #define T_CLASS_C 373 #define T_TRAIT_C 374 #define T_METHOD_C 375 #define T_FUNC_C 376 #define T_COMMENT 377 #define T_DOC_COMMENT 378 #define T_OPEN_TAG 379 #define T_OPEN_TAG_WITH_ECHO 380 #define T_CLOSE_TAG 381 #define T_WHITESPACE 382 #define T_START_HEREDOC 383 #define T_END_HEREDOC 384 #define T_DOLLAR_OPEN_CURLY_BRACES 385 #define T_CURLY_OPEN 386 #define T_PAAMAYIM_NEKUDOTAYIM 387 #define T_NAMESPACE 388 #define T_NS_C 389 #define T_NS_SEPARATOR 390 #define T_ELLIPSIS 391 #define T_ERROR 392 /* Value type. */ ZEND_API int zendparse (void); #endif /* !YY_ZEND_ZEND_ZEND_LANGUAGE_PARSER_H_INCLUDED */ ```