28#include "zend_language_scanner_defs.h"
29#include <zend_language_parser.h>
35#define zendtext LANG_SCNG(yy_text)
36#define zendleng LANG_SCNG(yy_leng)
37#define zendcursor LANG_SCNG(yy_cursor)
38#define zendlimit LANG_SCNG(yy_limit)
57#ifdef COMPILE_DL_TOKENIZER
61static zval *php_token_get_id(
zval *obj) {
65 "Typed property PhpToken::$id must not be accessed before initialization");
78 "Typed property PhpToken::$text must not be accessed before initialization");
87static bool tokenize_common(
249 register_tokenizer_data_symbols(module_number);
250 register_tokenizer_symbols(module_number);
269 }
else if (interned_strings) {
270 zend_string *interned_str = zend_hash_str_find_ptr(interned_strings, (
char *)
text, leng);
272 return zend_string_copy(interned_str);
274 interned_str = zend_string_init((
char *)
text, leng, 0);
275 zend_hash_add_new_ptr(interned_strings, interned_str, interned_str);
278 return zend_string_init((
char *)
text, leng, 0);
282static void add_token(
300 for (; src <
end; src++, dst++) {
304 }
else if (token_type >= 256) {
316 ZVAL_STR(&token, make_str(
text, leng, interned_strings));
328 int need_tokens = -1;
345 token_class, &interned_strings);
348 zval_ptr_dtor_nogc(&token);
353 if (need_tokens != -1) {
356 && --need_tokens == 0
362 token_line, token_class, &interned_strings);
370 if (
CG(increment_lineno)) {
372 CG(increment_lineno) = 0;
375 token_line =
CG(zend_lineno);
378 zval_ptr_dtor_str(&source_zval);
390static zval *extract_token_id_to_replace(
zval *token_zv,
const char *
text,
size_t length) {
391 zval *id_zv, *text_zv;
420 if (token == END)
break;
422 if (token ==
';' &&
LANG_SCNG(yy_leng) > 1) {
424 }
else if (token ==
T_ECHO &&
LANG_SCNG(yy_leng) ==
sizeof(
"<?=") - 1) {
434 id_zv = extract_token_id_to_replace(token_zv,
text, length);
453static bool tokenize_parse(
460 bool original_in_compilation;
465 original_in_compilation =
CG(in_compilation);
466 CG(in_compilation) = 1;
472 ctx.
tokens = &token_stream;
476 CG(ast_arena) = zend_arena_create(1024 * 32);
488 zend_arena_destroy(
CG(ast_arena));
492 CG(in_compilation) = original_in_compilation;
494 zval_ptr_dtor_str(&source_zval);
499static bool tokenize_common(
php_info_print_table_start()
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled")
php_info_print_table_end()
#define PHP_MINIT_FUNCTION
#define PHP_MINFO_FUNCTION
unsigned const char * end
unsigned const char * pos
unsigned const char * text
#define PHP_TOKENIZER_VERSION
char * get_token_type_name(int token_type)
zend_module_entry tokenizer_module_entry
int default_properties_count
zval * default_properties_table
zend_class_entry * token_class
token_get_all(string $code, int $flags=0)
const T_OPEN_TAG_WITH_ECHO
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type)
ZEND_API const char * zend_zval_value_name(const zval *arg)
ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format,...)
#define ZEND_PARSE_PARAMETERS_END()
#define ZEND_PARSE_PARAMETERS_NONE()
#define array_init_size(arg, size)
#define ZEND_GET_MODULE(name)
#define Z_PARAM_STR(dest)
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
#define Z_PARAM_LONG(dest)
#define Z_PARAM_ZVAL(dest)
#define RETURN_STR_COPY(s)
ZEND_API void ZEND_FASTCALL zend_ast_destroy(zend_ast *ast)
#define OBJ_PROP_NUM(obj, num)
#define ZEND_ACC_EXPLICIT_ABSTRACT_CLASS
ZEND_API int ZEND_FASTCALL lex_scan(zval *zendlval, zend_parser_stack_elem *elem)
ZEND_API void zend_clear_exception(void)
ZEND_API zend_class_entry * zend_get_called_scope(zend_execute_data *ex)
ZEND_API int zendparse(void)
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
ZEND_API void ZEND_FASTCALL zend_hash_real_init_packed(HashTable *ht)
ZEND_API zval *ZEND_FASTCALL zend_hash_next_index_insert_new(HashTable *ht, zval *pData)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
#define ZEND_HASH_REVERSE_FOREACH_VAL(ht, _val)
#define ZEND_HASH_FILL_PACKED(ht)
#define ZEND_HASH_FILL_END()
#define ZEND_HASH_FILL_SET_STR(_val)
#define ZEND_HASH_FILL_SET_LONG(_val)
#define ZEND_HASH_FOREACH_END()
#define ZEND_HASH_FILL_NEXT()
#define ZEND_HASH_FOREACH_VAL(ht, _val)
ZEND_API zend_class_entry * zend_ce_stringable
ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state)
struct _zend_lex_state zend_lex_state
ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state)
ZEND_API void zend_prepare_string_for_scanning(zval *str, zend_string *filename)
struct _zend_string zend_string
#define STANDARD_MODULE_HEADER
struct _zend_module_entry zend_module_entry
#define STANDARD_MODULE_PROPERTIES
ZEND_API zend_object *ZEND_FASTCALL zend_objects_new(zend_class_entry *ce)
#define UNEXPECTED(condition)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
#define ZSTR_EMPTY_ALLOC()
#define Z_STRVAL_P(zval_p)
#define Z_ISUNDEF_P(zval_p)
#define Z_ARRVAL_P(zval_p)
#define ZVAL_STR_COPY(z, s)
struct _zend_array HashTable
#define Z_STRLEN_P(zval_p)
#define ZVAL_COPY_PROP(z, v)
#define ZVAL_COPY_VALUE(z, v)
ZEND_API void zval_ptr_dtor(zval *zval_ptr)