Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 7a7b2a0642
Fetching contributors…

Cannot retrieve contributors at this time

7889 lines (7647 sloc) 187.526 kB
/* Generated by re2c 0.13.5 on Mon Aug 20 13:34:50 2012 */
#line 1 "Zend/zend_language_scanner.l"
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2012 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: Marcus Boerger <helly@php.net> |
| Nuno Lopes <nlopess@php.net> |
| Scott MacVicar <scottmac@php.net> |
| Flex version authors: |
| Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#if 0
# define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c)
#else
# define YYDEBUG(s, c)
#endif
#include "zend_language_scanner_defs.h"
#include <errno.h>
#include "zend.h"
#ifdef PHP_WIN32
# include <Winuser.h>
#endif
#include "zend_alloc.h"
#include <zend_language_parser.h>
#include "zend_compile.h"
#include "zend_language_scanner.h"
#include "zend_highlight.h"
#include "zend_constants.h"
#include "zend_variables.h"
#include "zend_operators.h"
#include "zend_API.h"
#include "zend_strtod.h"
#include "zend_exceptions.h"
#include "tsrm_virtual_cwd.h"
#include "tsrm_config_common.h"
#define YYCTYPE unsigned char
#define YYFILL(n) { if ((YYCURSOR + n) >= (YYLIMIT + ZEND_MMAP_AHEAD)) { return 0; } }
#define YYCURSOR SCNG(yy_cursor)
#define YYLIMIT SCNG(yy_limit)
#define YYMARKER SCNG(yy_marker)
#define YYGETCONDITION() SCNG(yy_state)
#define YYSETCONDITION(s) SCNG(yy_state) = s
#define STATE(name) yyc##name
/* emulate flex constructs */
#define BEGIN(state) YYSETCONDITION(STATE(state))
#define YYSTATE YYGETCONDITION()
#define yytext ((char*)SCNG(yy_text))
#define yyleng SCNG(yy_leng)
#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \
yyleng = (unsigned int)x; } while(0)
#define yymore() goto yymore_restart
/* perform sanity check. If this message is triggered you should
increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
#define YYMAXFILL 16
#if ZEND_MMAP_AHEAD < YYMAXFILL
# error ZEND_MMAP_AHEAD should be greater than or equal to YYMAXFILL
#endif
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
/* Globals Macros */
#define SCNG LANG_SCNG
#ifdef ZTS
ZEND_API ts_rsrc_id language_scanner_globals_id;
#else
ZEND_API zend_php_scanner_globals language_scanner_globals;
#endif
#define HANDLE_NEWLINES(s, l) \
do { \
char *p = (s), *boundary = p+(l); \
\
while (p<boundary) { \
if (*p == '\n' || (*p == '\r' && (*(p+1) != '\n'))) { \
CG(zend_lineno)++; \
} \
p++; \
} \
} while (0)
#define HANDLE_NEWLINE(c) \
{ \
if (c == '\n' || c == '\r') { \
CG(zend_lineno)++; \
} \
}
/* To save initial string length after scanning to first variable, CG(doc_comment_len) can be reused */
#define SET_DOUBLE_QUOTES_SCANNED_LENGTH(len) CG(doc_comment_len) = (len)
#define GET_DOUBLE_QUOTES_SCANNED_LENGTH() CG(doc_comment_len)
#define IS_LABEL_START(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z') || (c) == '_' || (c) >= 0x7F)
#define ZEND_IS_OCT(c) ((c)>='0' && (c)<='7')
#define ZEND_IS_HEX(c) (((c)>='0' && (c)<='9') || ((c)>='a' && (c)<='f') || ((c)>='A' && (c)<='F'))
BEGIN_EXTERN_C()
static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
{
const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding));
return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding) TSRMLS_CC);
}
static size_t encoding_filter_script_to_intermediate(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
{
return zend_multibyte_encoding_converter(to, to_length, from, from_length, zend_multibyte_encoding_utf8, LANG_SCNG(script_encoding) TSRMLS_CC);
}
static size_t encoding_filter_intermediate_to_script(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
{
return zend_multibyte_encoding_converter(to, to_length, from, from_length,
LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8 TSRMLS_CC);
}
static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
{
const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding));
return zend_multibyte_encoding_converter(to, to_length, from, from_length,
internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC);
}
static void _yy_push_state(int new_state TSRMLS_DC)
{
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int));
YYSETCONDITION(new_state);
}
#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm)
static void yy_pop_state(TSRMLS_D)
{
int *stack_state;
zend_stack_top(&SCNG(state_stack), (void **) &stack_state);
YYSETCONDITION(*stack_state);
zend_stack_del_top(&SCNG(state_stack));
}
static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
{
YYCURSOR = (YYCTYPE*)str;
YYLIMIT = YYCURSOR + len;
if (!SCNG(yy_start)) {
SCNG(yy_start) = YYCURSOR;
}
}
void startup_scanner(TSRMLS_D)
{
CG(parse_error) = 0;
CG(doc_comment) = NULL;
CG(doc_comment_len) = 0;
zend_stack_init(&SCNG(state_stack));
zend_ptr_stack_init(&SCNG(heredoc_label_stack));
}
static void heredoc_label_dtor(zend_heredoc_label *heredoc_label) {
efree(heredoc_label->label);
}
void shutdown_scanner(TSRMLS_D)
{
CG(parse_error) = 0;
RESET_DOC_COMMENT();
zend_stack_destroy(&SCNG(state_stack));
zend_ptr_stack_clean(&SCNG(heredoc_label_stack), (void (*)(void *)) &heredoc_label_dtor, 1);
zend_ptr_stack_destroy(&SCNG(heredoc_label_stack));
}
ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
{
lex_state->yy_leng = SCNG(yy_leng);
lex_state->yy_start = SCNG(yy_start);
lex_state->yy_text = SCNG(yy_text);
lex_state->yy_cursor = SCNG(yy_cursor);
lex_state->yy_marker = SCNG(yy_marker);
lex_state->yy_limit = SCNG(yy_limit);
lex_state->state_stack = SCNG(state_stack);
zend_stack_init(&SCNG(state_stack));
lex_state->heredoc_label_stack = SCNG(heredoc_label_stack);
zend_ptr_stack_init(&SCNG(heredoc_label_stack));
lex_state->in = SCNG(yy_in);
lex_state->yy_state = YYSTATE;
lex_state->filename = zend_get_compiled_filename(TSRMLS_C);
lex_state->lineno = CG(zend_lineno);
lex_state->script_org = SCNG(script_org);
lex_state->script_org_size = SCNG(script_org_size);
lex_state->script_filtered = SCNG(script_filtered);
lex_state->script_filtered_size = SCNG(script_filtered_size);
lex_state->input_filter = SCNG(input_filter);
lex_state->output_filter = SCNG(output_filter);
lex_state->script_encoding = SCNG(script_encoding);
}
ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
{
SCNG(yy_leng) = lex_state->yy_leng;
SCNG(yy_start) = lex_state->yy_start;
SCNG(yy_text) = lex_state->yy_text;
SCNG(yy_cursor) = lex_state->yy_cursor;
SCNG(yy_marker) = lex_state->yy_marker;
SCNG(yy_limit) = lex_state->yy_limit;
zend_stack_destroy(&SCNG(state_stack));
SCNG(state_stack) = lex_state->state_stack;
zend_ptr_stack_clean(&SCNG(heredoc_label_stack), (void (*)(void *)) &heredoc_label_dtor, 1);
zend_ptr_stack_destroy(&SCNG(heredoc_label_stack));
SCNG(heredoc_label_stack) = lex_state->heredoc_label_stack;
SCNG(yy_in) = lex_state->in;
YYSETCONDITION(lex_state->yy_state);
CG(zend_lineno) = lex_state->lineno;
zend_restore_compiled_filename(lex_state->filename TSRMLS_CC);
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
SCNG(script_org) = lex_state->script_org;
SCNG(script_org_size) = lex_state->script_org_size;
SCNG(script_filtered) = lex_state->script_filtered;
SCNG(script_filtered_size) = lex_state->script_filtered_size;
SCNG(input_filter) = lex_state->input_filter;
SCNG(output_filter) = lex_state->output_filter;
SCNG(script_encoding) = lex_state->script_encoding;
}
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
{
zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
/* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */
file_handle->opened_path = NULL;
if (file_handle->free_filename) {
file_handle->filename = NULL;
}
}
#define BOM_UTF32_BE "\x00\x00\xfe\xff"
#define BOM_UTF32_LE "\xff\xfe\x00\x00"
#define BOM_UTF16_BE "\xfe\xff"
#define BOM_UTF16_LE "\xff\xfe"
#define BOM_UTF8 "\xef\xbb\xbf"
static const zend_encoding *zend_multibyte_detect_utf_encoding(const unsigned char *script, size_t script_size TSRMLS_DC)
{
const unsigned char *p;
int wchar_size = 2;
int le = 0;
/* utf-16 or utf-32? */
p = script;
while ((p-script) < script_size) {
p = memchr(p, 0, script_size-(p-script)-2);
if (!p) {
break;
}
if (*(p+1) == '\0' && *(p+2) == '\0') {
wchar_size = 4;
break;
}
/* searching for UTF-32 specific byte orders, so this will do */
p += 4;
}
/* BE or LE? */
p = script;
while ((p-script) < script_size) {
if (*p == '\0' && *(p+wchar_size-1) != '\0') {
/* BE */
le = 0;
break;
} else if (*p != '\0' && *(p+wchar_size-1) == '\0') {
/* LE* */
le = 1;
break;
}
p += wchar_size;
}
if (wchar_size == 2) {
return le ? zend_multibyte_encoding_utf16le : zend_multibyte_encoding_utf16be;
} else {
return le ? zend_multibyte_encoding_utf32le : zend_multibyte_encoding_utf32be;
}
return NULL;
}
static const zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D)
{
const zend_encoding *script_encoding = NULL;
int bom_size;
unsigned char *pos1, *pos2;
if (LANG_SCNG(script_org_size) < sizeof(BOM_UTF32_LE)-1) {
return NULL;
}
/* check out BOM */
if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_BE, sizeof(BOM_UTF32_BE)-1)) {
script_encoding = zend_multibyte_encoding_utf32be;
bom_size = sizeof(BOM_UTF32_BE)-1;
} else if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_LE, sizeof(BOM_UTF32_LE)-1)) {
script_encoding = zend_multibyte_encoding_utf32le;
bom_size = sizeof(BOM_UTF32_LE)-1;
} else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_BE, sizeof(BOM_UTF16_BE)-1)) {
script_encoding = zend_multibyte_encoding_utf16be;
bom_size = sizeof(BOM_UTF16_BE)-1;
} else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_LE, sizeof(BOM_UTF16_LE)-1)) {
script_encoding = zend_multibyte_encoding_utf16le;
bom_size = sizeof(BOM_UTF16_LE)-1;
} else if (!memcmp(LANG_SCNG(script_org), BOM_UTF8, sizeof(BOM_UTF8)-1)) {
script_encoding = zend_multibyte_encoding_utf8;
bom_size = sizeof(BOM_UTF8)-1;
}
if (script_encoding) {
/* remove BOM */
LANG_SCNG(script_org) += bom_size;
LANG_SCNG(script_org_size) -= bom_size;
return script_encoding;
}
/* script contains NULL bytes -> auto-detection */
if ((pos1 = memchr(LANG_SCNG(script_org), 0, LANG_SCNG(script_org_size)))) {
/* check if the NULL byte is after the __HALT_COMPILER(); */
pos2 = LANG_SCNG(script_org);
while (pos1 - pos2 >= sizeof("__HALT_COMPILER();")-1) {
pos2 = memchr(pos2, '_', pos1 - pos2);
if (!pos2) break;
pos2++;
if (strncasecmp((char*)pos2, "_HALT_COMPILER", sizeof("_HALT_COMPILER")-1) == 0) {
pos2 += sizeof("_HALT_COMPILER")-1;
while (*pos2 == ' ' ||
*pos2 == '\t' ||
*pos2 == '\r' ||
*pos2 == '\n') {
pos2++;
}
if (*pos2 == '(') {
pos2++;
while (*pos2 == ' ' ||
*pos2 == '\t' ||
*pos2 == '\r' ||
*pos2 == '\n') {
pos2++;
}
if (*pos2 == ')') {
pos2++;
while (*pos2 == ' ' ||
*pos2 == '\t' ||
*pos2 == '\r' ||
*pos2 == '\n') {
pos2++;
}
if (*pos2 == ';') {
return NULL;
}
}
}
}
}
/* make best effort if BOM is missing */
return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_SCNG(script_org_size) TSRMLS_CC);
}
return NULL;
}
static const zend_encoding* zend_multibyte_find_script_encoding(TSRMLS_D)
{
const zend_encoding *script_encoding;
if (CG(detect_unicode)) {
/* check out bom(byte order mark) and see if containing wchars */
script_encoding = zend_multibyte_detect_unicode(TSRMLS_C);
if (script_encoding != NULL) {
/* bom or wchar detection is prior to 'script_encoding' option */
return script_encoding;
}
}
/* if no script_encoding specified, just leave alone */
if (!CG(script_encoding_list) || !CG(script_encoding_list_size)) {
return NULL;
}
/* if multiple encodings specified, detect automagically */
if (CG(script_encoding_list_size) > 1) {
return zend_multibyte_encoding_detector(LANG_SCNG(script_org), LANG_SCNG(script_org_size), CG(script_encoding_list), CG(script_encoding_list_size) TSRMLS_CC);
}
return CG(script_encoding_list)[0];
}
ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC)
{
const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
const zend_encoding *script_encoding = onetime_encoding ? onetime_encoding: zend_multibyte_find_script_encoding(TSRMLS_C);
if (!script_encoding) {
return FAILURE;
}
/* judge input/output filter */
LANG_SCNG(script_encoding) = script_encoding;
LANG_SCNG(input_filter) = NULL;
LANG_SCNG(output_filter) = NULL;
if (!internal_encoding || LANG_SCNG(script_encoding) == internal_encoding) {
if (!zend_multibyte_check_lexer_compatibility(LANG_SCNG(script_encoding))) {
/* and if not, work around w/ script_encoding -> utf-8 -> script_encoding conversion */
LANG_SCNG(input_filter) = encoding_filter_script_to_intermediate;
LANG_SCNG(output_filter) = encoding_filter_intermediate_to_script;
} else {
LANG_SCNG(input_filter) = NULL;
LANG_SCNG(output_filter) = NULL;
}
return SUCCESS;
}
if (zend_multibyte_check_lexer_compatibility(internal_encoding)) {
LANG_SCNG(input_filter) = encoding_filter_script_to_internal;
LANG_SCNG(output_filter) = NULL;
} else if (zend_multibyte_check_lexer_compatibility(LANG_SCNG(script_encoding))) {
LANG_SCNG(input_filter) = NULL;
LANG_SCNG(output_filter) = encoding_filter_script_to_internal;
} else {
/* both script and internal encodings are incompatible w/ flex */
LANG_SCNG(input_filter) = encoding_filter_script_to_intermediate;
LANG_SCNG(output_filter) = encoding_filter_intermediate_to_internal;
}
return 0;
}
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
{
const char *file_path = NULL;
char *buf;
size_t size, offset = 0;
/* The shebang line was read, get the current position to obtain the buffer start */
if (CG(start_lineno) == 2 && file_handle->type == ZEND_HANDLE_FP && file_handle->handle.fp) {
if ((offset = ftell(file_handle->handle.fp)) == -1) {
offset = 0;
}
}
if (zend_stream_fixup(file_handle, &buf, &size TSRMLS_CC) == FAILURE) {
return FAILURE;
}
zend_llist_add_element(&CG(open_files), file_handle);
if (file_handle->handle.stream.handle >= (void*)file_handle && file_handle->handle.stream.handle <= (void*)(file_handle+1)) {
zend_file_handle *fh = (zend_file_handle*)zend_llist_get_last(&CG(open_files));
size_t diff = (char*)file_handle->handle.stream.handle - (char*)file_handle;
fh->handle.stream.handle = (void*)(((char*)fh) + diff);
file_handle->handle.stream.handle = fh->handle.stream.handle;
}
/* Reset the scanner for scanning the new file */
SCNG(yy_in) = file_handle;
SCNG(yy_start) = NULL;
if (size != -1) {
if (CG(multibyte)) {
SCNG(script_org) = (unsigned char*)buf;
SCNG(script_org_size) = size;
SCNG(script_filtered) = NULL;
zend_multibyte_set_filter(NULL TSRMLS_CC);
if (SCNG(input_filter)) {
if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
"encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
}
buf = (char*)SCNG(script_filtered);
size = SCNG(script_filtered_size);
}
}
SCNG(yy_start) = (unsigned char *)buf - offset;
yy_scan_buffer(buf, size TSRMLS_CC);
} else {
zend_error_noreturn(E_COMPILE_ERROR, "zend_stream_mmap() failed");
}
BEGIN(INITIAL);
if (file_handle->opened_path) {
file_path = file_handle->opened_path;
} else {
file_path = file_handle->filename;
}
zend_set_compiled_filename(file_path TSRMLS_CC);
if (CG(start_lineno)) {
CG(zend_lineno) = CG(start_lineno);
CG(start_lineno) = 0;
} else {
CG(zend_lineno) = 1;
}
CG(increment_lineno) = 0;
return SUCCESS;
}
END_EXTERN_C()
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
{
zend_lex_state original_lex_state;
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
zend_op_array *original_active_op_array = CG(active_op_array);
zend_op_array *retval=NULL;
int compiler_result;
zend_bool compilation_successful=0;
znode retval_znode;
zend_bool original_in_compilation = CG(in_compilation);
retval_znode.op_type = IS_CONST;
retval_znode.u.constant.type = IS_LONG;
retval_znode.u.constant.value.lval = 1;
Z_UNSET_ISREF(retval_znode.u.constant);
Z_SET_REFCOUNT(retval_znode.u.constant, 1);
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
retval = op_array; /* success oriented */
if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) {
if (type==ZEND_REQUIRE) {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
zend_bailout();
} else {
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC);
}
compilation_successful=0;
} else {
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
zend_init_compiler_context(TSRMLS_C);
compiler_result = zendparse(TSRMLS_C);
zend_do_return(&retval_znode, 0 TSRMLS_CC);
CG(in_compilation) = original_in_compilation;
if (compiler_result==1) { /* parser error */
zend_bailout();
}
compilation_successful=1;
}
if (retval) {
CG(active_op_array) = original_active_op_array;
if (compilation_successful) {
pass_two(op_array TSRMLS_CC);
zend_release_labels(TSRMLS_C);
} else {
efree(op_array);
retval = NULL;
}
}
zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
return retval;
}
zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
{
zend_file_handle file_handle;
zval tmp;
zend_op_array *retval;
char *opened_path = NULL;
if (filename->type != IS_STRING) {
tmp = *filename;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
filename = &tmp;
}
file_handle.filename = filename->value.str.val;
file_handle.free_filename = 0;
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.opened_path = NULL;
file_handle.handle.fp = NULL;
retval = zend_compile_file(&file_handle, type TSRMLS_CC);
if (retval && file_handle.handle.stream.handle) {
int dummy = 1;
if (!file_handle.opened_path) {
file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len);
}
zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL);
if (opened_path) {
efree(opened_path);
}
}
zend_destroy_file_handle(&file_handle TSRMLS_CC);
if (filename==&tmp) {
zval_dtor(&tmp);
}
return retval;
}
ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC)
{
char *buf;
size_t size;
/* enforce two trailing NULLs for flex... */
if (IS_INTERNED(str->value.str.val)) {
char *tmp = safe_emalloc(1, str->value.str.len, ZEND_MMAP_AHEAD);
memcpy(tmp, str->value.str.val, str->value.str.len + ZEND_MMAP_AHEAD);
str->value.str.val = tmp;
} else {
str->value.str.val = safe_erealloc(str->value.str.val, 1, str->value.str.len, ZEND_MMAP_AHEAD);
}
memset(str->value.str.val + str->value.str.len, 0, ZEND_MMAP_AHEAD);
SCNG(yy_in) = NULL;
SCNG(yy_start) = NULL;
buf = str->value.str.val;
size = str->value.str.len;
if (CG(multibyte)) {
SCNG(script_org) = (unsigned char*)buf;
SCNG(script_org_size) = size;
SCNG(script_filtered) = NULL;
zend_multibyte_set_filter(zend_multibyte_get_internal_encoding(TSRMLS_C) TSRMLS_CC);
if (SCNG(input_filter)) {
if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
"encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
}
buf = (char*)SCNG(script_filtered);
size = SCNG(script_filtered_size);
}
}
yy_scan_buffer(buf, size TSRMLS_CC);
zend_set_compiled_filename(filename TSRMLS_CC);
CG(zend_lineno) = 1;
CG(increment_lineno) = 0;
return SUCCESS;
}
ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D)
{
size_t offset = SCNG(yy_cursor) - SCNG(yy_start);
if (SCNG(input_filter)) {
size_t original_offset = offset, length = 0;
do {
unsigned char *p = NULL;
if ((size_t)-1 == SCNG(input_filter)(&p, &length, SCNG(script_org), offset TSRMLS_CC)) {
return (size_t)-1;
}
efree(p);
if (length > original_offset) {
offset--;
} else if (length < original_offset) {
offset++;
}
} while (original_offset != length);
}
return offset;
}
zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
{
zend_lex_state original_lex_state;
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
zend_op_array *original_active_op_array = CG(active_op_array);
zend_op_array *retval;
zval tmp;
int compiler_result;
zend_bool original_in_compilation = CG(in_compilation);
if (source_string->value.str.len==0) {
efree(op_array);
return NULL;
}
CG(in_compilation) = 1;
tmp = *source_string;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
source_string = &tmp;
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
if (zend_prepare_string_for_scanning(source_string, filename TSRMLS_CC)==FAILURE) {
efree(op_array);
retval = NULL;
} else {
zend_bool orig_interactive = CG(interactive);
CG(interactive) = 0;
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
CG(interactive) = orig_interactive;
CG(active_op_array) = op_array;
zend_init_compiler_context(TSRMLS_C);
BEGIN(ST_IN_SCRIPTING);
compiler_result = zendparse(TSRMLS_C);
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
if (compiler_result==1) {
CG(active_op_array) = original_active_op_array;
CG(unclean_shutdown)=1;
destroy_op_array(op_array TSRMLS_CC);
efree(op_array);
retval = NULL;
} else {
zend_do_return(NULL, 0 TSRMLS_CC);
CG(active_op_array) = original_active_op_array;
pass_two(op_array TSRMLS_CC);
zend_release_labels(TSRMLS_C);
retval = op_array;
}
}
zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
zval_dtor(&tmp);
CG(in_compilation) = original_in_compilation;
return retval;
}
BEGIN_EXTERN_C()
int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC)
{
zend_lex_state original_lex_state;
zend_file_handle file_handle;
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = filename;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) {
zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename TSRMLS_CC);
zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
return FAILURE;
}
zend_highlight(syntax_highlighter_ini TSRMLS_CC);
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
zend_destroy_file_handle(&file_handle TSRMLS_CC);
zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
return SUCCESS;
}
int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC)
{
zend_lex_state original_lex_state;
zval tmp = *str;
str = &tmp;
zval_copy_ctor(str);
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) {
zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
return FAILURE;
}
BEGIN(INITIAL);
zend_highlight(syntax_highlighter_ini TSRMLS_CC);
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
zval_dtor(str);
return SUCCESS;
}
ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC)
{
size_t length;
unsigned char *new_yy_start;
/* convert and set */
if (!SCNG(input_filter)) {
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
SCNG(script_filtered_size) = 0;
length = SCNG(script_org_size);
new_yy_start = SCNG(script_org);
} else {
if ((size_t)-1 == SCNG(input_filter)(&new_yy_start, &length, SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
"encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
}
SCNG(script_filtered) = new_yy_start;
SCNG(script_filtered_size) = length;
}
SCNG(yy_cursor) = new_yy_start + (SCNG(yy_cursor) - SCNG(yy_start));
SCNG(yy_marker) = new_yy_start + (SCNG(yy_marker) - SCNG(yy_start));
SCNG(yy_text) = new_yy_start + (SCNG(yy_text) - SCNG(yy_start));
SCNG(yy_limit) = new_yy_start + (SCNG(yy_limit) - SCNG(yy_start));
SCNG(yy_start) = new_yy_start;
}
# define zend_copy_value(zendlval, yytext, yyleng) \
if (SCNG(output_filter)) { \
size_t sz = 0; \
SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \
zendlval->value.str.len = sz; \
} else { \
zendlval->value.str.val = (char *) estrndup(yytext, yyleng); \
zendlval->value.str.len = yyleng; \
}
static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC)
{
register char *s, *t;
char *end;
ZVAL_STRINGL(zendlval, str, len, 1);
/* convert escape sequences */
s = t = zendlval->value.str.val;
end = s+zendlval->value.str.len;
while (s<end) {
if (*s=='\\') {
s++;
if (s >= end) {
*t++ = '\\';
break;
}
switch(*s) {
case 'n':
*t++ = '\n';
zendlval->value.str.len--;
break;
case 'r':
*t++ = '\r';
zendlval->value.str.len--;
break;
case 't':
*t++ = '\t';
zendlval->value.str.len--;
break;
case 'f':
*t++ = '\f';
zendlval->value.str.len--;
break;
case 'v':
*t++ = '\v';
zendlval->value.str.len--;
break;
case 'e':
#ifdef PHP_WIN32
*t++ = VK_ESCAPE;
#else
*t++ = '\e';
#endif
zendlval->value.str.len--;
break;
case '"':
case '`':
if (*s != quote_type) {
*t++ = '\\';
*t++ = *s;
break;
}
case '\\':
case '$':
*t++ = *s;
zendlval->value.str.len--;
break;
case 'x':
case 'X':
if (ZEND_IS_HEX(*(s+1))) {
char hex_buf[3] = { 0, 0, 0 };
zendlval->value.str.len--; /* for the 'x' */
hex_buf[0] = *(++s);
zendlval->value.str.len--;
if (ZEND_IS_HEX(*(s+1))) {
hex_buf[1] = *(++s);
zendlval->value.str.len--;
}
*t++ = (char) strtol(hex_buf, NULL, 16);
} else {
*t++ = '\\';
*t++ = *s;
}
break;
default:
/* check for an octal */
if (ZEND_IS_OCT(*s)) {
char octal_buf[4] = { 0, 0, 0, 0 };
octal_buf[0] = *s;
zendlval->value.str.len--;
if (ZEND_IS_OCT(*(s+1))) {
octal_buf[1] = *(++s);
zendlval->value.str.len--;
if (ZEND_IS_OCT(*(s+1))) {
octal_buf[2] = *(++s);
zendlval->value.str.len--;
}
}
*t++ = (char) strtol(octal_buf, NULL, 8);
} else {
*t++ = '\\';
*t++ = *s;
}
break;
}
} else {
*t++ = *s;
}
if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) {
CG(zend_lineno)++;
}
s++;
}
*t = 0;
if (SCNG(output_filter)) {
size_t sz = 0;
s = zendlval->value.str.val;
SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC);
zendlval->value.str.len = sz;
efree(s);
}
}
int lex_scan(zval *zendlval TSRMLS_DC)
{
restart:
SCNG(yy_text) = YYCURSOR;
yymore_restart:
#line 1004 "Zend/zend_language_scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if (YYGETCONDITION() < 5) {
if (YYGETCONDITION() < 2) {
if (YYGETCONDITION() < 1) {
goto yyc_ST_IN_SCRIPTING;
} else {
goto yyc_ST_LOOKING_FOR_PROPERTY;
}
} else {
if (YYGETCONDITION() < 3) {
goto yyc_ST_BACKQUOTE;
} else {
if (YYGETCONDITION() < 4) {
goto yyc_ST_DOUBLE_QUOTES;
} else {
goto yyc_ST_HEREDOC;
}
}
}
} else {
if (YYGETCONDITION() < 7) {
if (YYGETCONDITION() < 6) {
goto yyc_ST_LOOKING_FOR_VARNAME;
} else {
goto yyc_ST_VAR_OFFSET;
}
} else {
if (YYGETCONDITION() < 8) {
goto yyc_INITIAL;
} else {
if (YYGETCONDITION() < 9) {
goto yyc_ST_END_HEREDOC;
} else {
goto yyc_ST_NOWDOC;
}
}
}
}
/* *********************************** */
yyc_INITIAL:
{
static const unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 128, 128, 0, 0, 128, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
128, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
YYDEBUG(0, *YYCURSOR);
YYFILL(8);
yych = *YYCURSOR;
if (yych != '<') goto yy4;
YYDEBUG(2, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '?') {
if (yych == '%') goto yy7;
if (yych >= '?') goto yy5;
} else {
if (yych <= 'S') {
if (yych >= 'S') goto yy9;
} else {
if (yych == 's') goto yy9;
}
}
yy3:
YYDEBUG(3, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1801 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
}
inline_char_handler:
while (1) {
YYCTYPE *ptr = memchr(YYCURSOR, '<', YYLIMIT - YYCURSOR);
YYCURSOR = ptr ? ptr + 1 : YYLIMIT;
if (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR) {
case '?':
if (CG(short_tags) || !strncasecmp((char*)YYCURSOR + 1, "php", 3) || (*(YYCURSOR + 1) == '=')) { /* Assume [ \t\n\r] follows "php" */
break;
}
continue;
case '%':
if (CG(asp_tags)) {
break;
}
continue;
case 's':
case 'S':
/* Probably NOT an opening PHP <script> tag, so don't end the HTML chunk yet
* If it is, the PHP <script> tag rule checks for any HTML scanned before it */
YYCURSOR--;
yymore();
default:
continue;
}
YYCURSOR--;
}
break;
}
inline_html:
yyleng = YYCURSOR - SCNG(yy_text);
if (SCNG(output_filter)) {
int readsize;
size_t sz = 0;
readsize = SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC);
zendlval->value.str.len = sz;
if (readsize < yyleng) {
yyless(readsize);
}
} else {
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
zendlval->value.str.len = yyleng;
}
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext, yyleng);
return T_INLINE_HTML;
}
#line 1163 "Zend/zend_language_scanner.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yych = *++YYCURSOR;
goto yy3;
yy5:
YYDEBUG(5, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 'O') {
if (yych == '=') goto yy45;
} else {
if (yych <= 'P') goto yy47;
if (yych == 'p') goto yy47;
}
yy6:
YYDEBUG(6, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1789 "Zend/zend_language_scanner.l"
{
if (CG(short_tags)) {
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
} else {
goto inline_char_handler;
}
}
#line 1193 "Zend/zend_language_scanner.c"
yy7:
YYDEBUG(7, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '=') goto yy43;
YYDEBUG(8, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1766 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
} else {
goto inline_char_handler;
}
}
#line 1212 "Zend/zend_language_scanner.c"
yy9:
YYDEBUG(9, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'C') goto yy11;
if (yych == 'c') goto yy11;
yy10:
YYDEBUG(10, *YYCURSOR);
YYCURSOR = YYMARKER;
if (yyaccept <= 0) {
goto yy3;
} else {
goto yy6;
}
yy11:
YYDEBUG(11, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'R') goto yy12;
if (yych != 'r') goto yy10;
yy12:
YYDEBUG(12, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'I') goto yy13;
if (yych != 'i') goto yy10;
yy13:
YYDEBUG(13, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'P') goto yy14;
if (yych != 'p') goto yy10;
yy14:
YYDEBUG(14, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'T') goto yy15;
if (yych != 't') goto yy10;
yy15:
YYDEBUG(15, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'L') goto yy10;
if (yych == 'l') goto yy10;
goto yy17;
yy16:
YYDEBUG(16, *YYCURSOR);
++YYCURSOR;
YYFILL(8);
yych = *YYCURSOR;
yy17:
YYDEBUG(17, *YYCURSOR);
if (yybm[0+yych] & 128) {
goto yy16;
}
if (yych == 'L') goto yy18;
if (yych != 'l') goto yy10;
yy18:
YYDEBUG(18, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'A') goto yy19;
if (yych != 'a') goto yy10;
yy19:
YYDEBUG(19, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'N') goto yy20;
if (yych != 'n') goto yy10;
yy20:
YYDEBUG(20, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'G') goto yy21;
if (yych != 'g') goto yy10;
yy21:
YYDEBUG(21, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'U') goto yy22;
if (yych != 'u') goto yy10;
yy22:
YYDEBUG(22, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'A') goto yy23;
if (yych != 'a') goto yy10;
yy23:
YYDEBUG(23, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'G') goto yy24;
if (yych != 'g') goto yy10;
yy24:
YYDEBUG(24, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'E') goto yy25;
if (yych != 'e') goto yy10;
yy25:
YYDEBUG(25, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(26, *YYCURSOR);
if (yych <= '\r') {
if (yych <= 0x08) goto yy10;
if (yych <= '\n') goto yy25;
if (yych <= '\f') goto yy10;
goto yy25;
} else {
if (yych <= ' ') {
if (yych <= 0x1F) goto yy10;
goto yy25;
} else {
if (yych != '=') goto yy10;
}
}
yy27:
YYDEBUG(27, *YYCURSOR);
++YYCURSOR;
YYFILL(5);
yych = *YYCURSOR;
YYDEBUG(28, *YYCURSOR);
if (yych <= '!') {
if (yych <= '\f') {
if (yych <= 0x08) goto yy10;
if (yych <= '\n') goto yy27;
goto yy10;
} else {
if (yych <= '\r') goto yy27;
if (yych == ' ') goto yy27;
goto yy10;
}
} else {
if (yych <= 'O') {
if (yych <= '"') goto yy30;
if (yych == '\'') goto yy31;
goto yy10;
} else {
if (yych <= 'P') goto yy29;
if (yych != 'p') goto yy10;
}
}
yy29:
YYDEBUG(29, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'H') goto yy42;
if (yych == 'h') goto yy42;
goto yy10;
yy30:
YYDEBUG(30, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'P') goto yy39;
if (yych == 'p') goto yy39;
goto yy10;
yy31:
YYDEBUG(31, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'P') goto yy32;
if (yych != 'p') goto yy10;
yy32:
YYDEBUG(32, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'H') goto yy33;
if (yych != 'h') goto yy10;
yy33:
YYDEBUG(33, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'P') goto yy34;
if (yych != 'p') goto yy10;
yy34:
YYDEBUG(34, *YYCURSOR);
yych = *++YYCURSOR;
if (yych != '\'') goto yy10;
yy35:
YYDEBUG(35, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(36, *YYCURSOR);
if (yych <= '\r') {
if (yych <= 0x08) goto yy10;
if (yych <= '\n') goto yy35;
if (yych <= '\f') goto yy10;
goto yy35;
} else {
if (yych <= ' ') {
if (yych <= 0x1F) goto yy10;
goto yy35;
} else {
if (yych != '>') goto yy10;
}
}
YYDEBUG(37, *YYCURSOR);
++YYCURSOR;
YYDEBUG(38, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1726 "Zend/zend_language_scanner.l"
{
YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
if (bracket != SCNG(yy_text)) {
/* Handle previously scanned HTML, as possible <script> tags found are assumed to not be PHP's */
YYCURSOR = bracket;
goto inline_html;
}
HANDLE_NEWLINES(yytext, yyleng);
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
}
#line 1415 "Zend/zend_language_scanner.c"
yy39:
YYDEBUG(39, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'H') goto yy40;
if (yych != 'h') goto yy10;
yy40:
YYDEBUG(40, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'P') goto yy41;
if (yych != 'p') goto yy10;
yy41:
YYDEBUG(41, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '"') goto yy35;
goto yy10;
yy42:
YYDEBUG(42, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'P') goto yy35;
if (yych == 'p') goto yy35;
goto yy10;
yy43:
YYDEBUG(43, *YYCURSOR);
++YYCURSOR;
YYDEBUG(44, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1744 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
} else {
goto inline_char_handler;
}
}
#line 1454 "Zend/zend_language_scanner.c"
yy45:
YYDEBUG(45, *YYCURSOR);
++YYCURSOR;
YYDEBUG(46, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1757 "Zend/zend_language_scanner.l"
{
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
}
#line 1468 "Zend/zend_language_scanner.c"
yy47:
YYDEBUG(47, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'H') goto yy48;
if (yych != 'h') goto yy10;
yy48:
YYDEBUG(48, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'P') goto yy49;
if (yych != 'p') goto yy10;
yy49:
YYDEBUG(49, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '\f') {
if (yych <= 0x08) goto yy10;
if (yych >= '\v') goto yy10;
} else {
if (yych <= '\r') goto yy52;
if (yych != ' ') goto yy10;
}
yy50:
YYDEBUG(50, *YYCURSOR);
++YYCURSOR;
yy51:
YYDEBUG(51, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1779 "Zend/zend_language_scanner.l"
{
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
HANDLE_NEWLINE(yytext[yyleng-1]);
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
}
#line 1504 "Zend/zend_language_scanner.c"
yy52:
YYDEBUG(52, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '\n') goto yy50;
goto yy51;
}
/* *********************************** */
yyc_ST_BACKQUOTE:
{
static const unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 0, 0, 0, 0, 0, 0,
0, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 0, 0, 0, 0, 128,
0, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 0, 0, 0, 0, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
YYDEBUG(53, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
if (yych <= '_') {
if (yych != '$') goto yy60;
} else {
if (yych <= '`') goto yy58;
if (yych == '{') goto yy57;
goto yy60;
}
YYDEBUG(55, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '_') {
if (yych <= '@') goto yy56;
if (yych <= 'Z') goto yy63;
if (yych >= '_') goto yy63;
} else {
if (yych <= 'z') {
if (yych >= 'a') goto yy63;
} else {
if (yych <= '{') goto yy66;
if (yych >= 0x7F) goto yy63;
}
}
yy56:
YYDEBUG(56, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2252 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
}
if (yytext[0] == '\\' && YYCURSOR < YYLIMIT) {
YYCURSOR++;
}
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
case '`':
break;
case '$':
if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
break;
}
continue;
case '{':
if (*YYCURSOR == '$') {
break;
}
continue;
case '\\':
if (YYCURSOR < YYLIMIT) {
YYCURSOR++;
}
/* fall through */
default:
continue;
}
YYCURSOR--;
break;
}
yyleng = YYCURSOR - SCNG(yy_text);
zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC);
return T_ENCAPSED_AND_WHITESPACE;
}
#line 1616 "Zend/zend_language_scanner.c"
yy57:
YYDEBUG(57, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '$') goto yy61;
goto yy56;
yy58:
YYDEBUG(58, *YYCURSOR);
++YYCURSOR;
YYDEBUG(59, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2196 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return '`';
}
#line 1632 "Zend/zend_language_scanner.c"
yy60:
YYDEBUG(60, *YYCURSOR);
yych = *++YYCURSOR;
goto yy56;
yy61:
YYDEBUG(61, *YYCURSOR);
++YYCURSOR;
YYDEBUG(62, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2183 "Zend/zend_language_scanner.l"
{
zendlval->value.lval = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
yyless(1);
return T_CURLY_OPEN;
}
#line 1649 "Zend/zend_language_scanner.c"
yy63:
YYDEBUG(63, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(3);
yych = *YYCURSOR;
YYDEBUG(64, *YYCURSOR);
if (yybm[0+yych] & 128) {
goto yy63;
}
if (yych == '-') goto yy68;
if (yych == '[') goto yy70;
yy65:
YYDEBUG(65, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1883 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
#line 1671 "Zend/zend_language_scanner.c"
yy66:
YYDEBUG(66, *YYCURSOR);
++YYCURSOR;
YYDEBUG(67, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1459 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
#line 1682 "Zend/zend_language_scanner.c"
yy68:
YYDEBUG(68, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '>') goto yy72;
yy69:
YYDEBUG(69, *YYCURSOR);
YYCURSOR = YYMARKER;
goto yy65;
yy70:
YYDEBUG(70, *YYCURSOR);
++YYCURSOR;
YYDEBUG(71, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1875 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
#line 1704 "Zend/zend_language_scanner.c"
yy72:
YYDEBUG(72, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '_') {
if (yych <= '@') goto yy69;
if (yych <= 'Z') goto yy73;
if (yych <= '^') goto yy69;
} else {
if (yych <= '`') goto yy69;
if (yych <= 'z') goto yy73;
if (yych <= '~') goto yy69;
}
yy73:
YYDEBUG(73, *YYCURSOR);
++YYCURSOR;
YYDEBUG(74, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1865 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
#line 1730 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_DOUBLE_QUOTES:
{
static const unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 0, 0, 0, 0, 0, 0,
0, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 0, 0, 0, 0, 128,
0, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 0, 0, 0, 0, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
YYDEBUG(75, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
if (yych <= '#') {
if (yych == '"') goto yy80;
goto yy82;
} else {
if (yych <= '$') goto yy77;
if (yych == '{') goto yy79;
goto yy82;
}
yy77:
YYDEBUG(77, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '_') {
if (yych <= '@') goto yy78;
if (yych <= 'Z') goto yy85;
if (yych >= '_') goto yy85;
} else {
if (yych <= 'z') {
if (yych >= 'a') goto yy85;
} else {
if (yych <= '{') goto yy88;
if (yych >= 0x7F) goto yy85;
}
}
yy78:
YYDEBUG(78, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2202 "Zend/zend_language_scanner.l"
{
if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
SET_DOUBLE_QUOTES_SCANNED_LENGTH(0);
goto double_quotes_scan_done;
}
if (YYCURSOR > YYLIMIT) {
return 0;
}
if (yytext[0] == '\\' && YYCURSOR < YYLIMIT) {
YYCURSOR++;
}
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
case '"':
break;
case '$':
if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
break;
}
continue;
case '{':
if (*YYCURSOR == '$') {
break;
}
continue;
case '\\':
if (YYCURSOR < YYLIMIT) {
YYCURSOR++;
}
/* fall through */
default:
continue;
}
YYCURSOR--;
break;
}
double_quotes_scan_done:
yyleng = YYCURSOR - SCNG(yy_text);
zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC);
return T_ENCAPSED_AND_WHITESPACE;
}
#line 1847 "Zend/zend_language_scanner.c"
yy79:
YYDEBUG(79, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '$') goto yy83;
goto yy78;
yy80:
YYDEBUG(80, *YYCURSOR);
++YYCURSOR;
YYDEBUG(81, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2191 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return '"';
}
#line 1863 "Zend/zend_language_scanner.c"
yy82:
YYDEBUG(82, *YYCURSOR);
yych = *++YYCURSOR;
goto yy78;
yy83:
YYDEBUG(83, *YYCURSOR);
++YYCURSOR;
YYDEBUG(84, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2183 "Zend/zend_language_scanner.l"
{
zendlval->value.lval = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
yyless(1);
return T_CURLY_OPEN;
}
#line 1880 "Zend/zend_language_scanner.c"
yy85:
YYDEBUG(85, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(3);
yych = *YYCURSOR;
YYDEBUG(86, *YYCURSOR);
if (yybm[0+yych] & 128) {
goto yy85;
}
if (yych == '-') goto yy90;
if (yych == '[') goto yy92;
yy87:
YYDEBUG(87, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1883 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
#line 1902 "Zend/zend_language_scanner.c"
yy88:
YYDEBUG(88, *YYCURSOR);
++YYCURSOR;
YYDEBUG(89, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1459 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
#line 1913 "Zend/zend_language_scanner.c"
yy90:
YYDEBUG(90, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '>') goto yy94;
yy91:
YYDEBUG(91, *YYCURSOR);
YYCURSOR = YYMARKER;
goto yy87;
yy92:
YYDEBUG(92, *YYCURSOR);
++YYCURSOR;
YYDEBUG(93, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1875 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
#line 1935 "Zend/zend_language_scanner.c"
yy94:
YYDEBUG(94, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '_') {
if (yych <= '@') goto yy91;
if (yych <= 'Z') goto yy95;
if (yych <= '^') goto yy91;
} else {
if (yych <= '`') goto yy91;
if (yych <= 'z') goto yy95;
if (yych <= '~') goto yy91;
}
yy95:
YYDEBUG(95, *YYCURSOR);
++YYCURSOR;
YYDEBUG(96, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1865 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
#line 1961 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_END_HEREDOC:
YYDEBUG(97, *YYCURSOR);
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(99, *YYCURSOR);
++YYCURSOR;
YYDEBUG(100, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2169 "Zend/zend_language_scanner.l"
{
zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack));
YYCURSOR += heredoc_label->length - 1;
yyleng = heredoc_label->length;
heredoc_label_dtor(heredoc_label);
efree(heredoc_label);
BEGIN(ST_IN_SCRIPTING);
return T_END_HEREDOC;
}
#line 1985 "Zend/zend_language_scanner.c"
/* *********************************** */
yyc_ST_HEREDOC:
{
static const unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 0, 0, 0, 0, 0, 0,
0, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 0, 0, 0, 0, 128,
0, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 0, 0, 0, 0, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
YYDEBUG(101, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
if (yych == '$') goto yy103;
if (yych == '{') goto yy105;
goto yy106;
yy103:
YYDEBUG(103, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '_') {
if (yych <= '@') goto yy104;
if (yych <= 'Z') goto yy109;
if (yych >= '_') goto yy109;
} else {
if (yych <= 'z') {
if (yych >= 'a') goto yy109;
} else {
if (yych <= '{') goto yy112;
if (yych >= 0x7F) goto yy109;
}
}
yy104:
YYDEBUG(104, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2294 "Zend/zend_language_scanner.l"
{
int newline = 0;
zend_heredoc_label *heredoc_label = zend_ptr_stack_top(&SCNG(heredoc_label_stack));
if (YYCURSOR > YYLIMIT) {
return 0;
}
YYCURSOR--;
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
case '\r':
if (*YYCURSOR == '\n') {
YYCURSOR++;
}
/* fall through */
case '\n':
/* Check for ending label on the next line */
if (IS_LABEL_START(*YYCURSOR) && heredoc_label->length < YYLIMIT - YYCURSOR && !memcmp(YYCURSOR, heredoc_label->label, heredoc_label->length)) {
YYCTYPE *end = YYCURSOR + heredoc_label->length;
if (*end == ';') {
end++;
}
if (*end == '\n' || *end == '\r') {
/* newline before label will be subtracted from returned text, but
* yyleng/yytext will include it, for zend_highlight/strip, tokenizer, etc. */
if (YYCURSOR[-2] == '\r' && YYCURSOR[-1] == '\n') {
newline = 2; /* Windows newline */
} else {
newline = 1;
}
CG(increment_lineno) = 1; /* For newline before label */
BEGIN(ST_END_HEREDOC);
goto heredoc_scan_done;
}
}
continue;
case '$':
if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
break;
}
continue;
case '{':
if (*YYCURSOR == '$') {
break;
}
continue;
case '\\':
if (YYCURSOR < YYLIMIT && *YYCURSOR != '\n' && *YYCURSOR != '\r') {
YYCURSOR++;
}
/* fall through */
default:
continue;
}
YYCURSOR--;
break;
}
heredoc_scan_done:
yyleng = YYCURSOR - SCNG(yy_text);
zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC);
return T_ENCAPSED_AND_WHITESPACE;
}
#line 2120 "Zend/zend_language_scanner.c"
yy105:
YYDEBUG(105, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '$') goto yy107;
goto yy104;
yy106:
YYDEBUG(106, *YYCURSOR);
yych = *++YYCURSOR;
goto yy104;
yy107:
YYDEBUG(107, *YYCURSOR);
++YYCURSOR;
YYDEBUG(108, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2183 "Zend/zend_language_scanner.l"
{
zendlval->value.lval = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
yyless(1);
return T_CURLY_OPEN;
}
#line 2142 "Zend/zend_language_scanner.c"
yy109:
YYDEBUG(109, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(3);
yych = *YYCURSOR;
YYDEBUG(110, *YYCURSOR);
if (yybm[0+yych] & 128) {
goto yy109;
}
if (yych == '-') goto yy114;
if (yych == '[') goto yy116;
yy111:
YYDEBUG(111, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1883 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
#line 2164 "Zend/zend_language_scanner.c"
yy112:
YYDEBUG(112, *YYCURSOR);
++YYCURSOR;
YYDEBUG(113, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1459 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
#line 2175 "Zend/zend_language_scanner.c"
yy114:
YYDEBUG(114, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '>') goto yy118;
yy115:
YYDEBUG(115, *YYCURSOR);
YYCURSOR = YYMARKER;
goto yy111;
yy116:
YYDEBUG(116, *YYCURSOR);
++YYCURSOR;
YYDEBUG(117, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1875 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
#line 2197 "Zend/zend_language_scanner.c"
yy118:
YYDEBUG(118, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '_') {
if (yych <= '@') goto yy115;
if (yych <= 'Z') goto yy119;
if (yych <= '^') goto yy115;
} else {
if (yych <= '`') goto yy115;
if (yych <= 'z') goto yy119;
if (yych <= '~') goto yy115;
}
yy119:
YYDEBUG(119, *YYCURSOR);
++YYCURSOR;
YYDEBUG(120, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1865 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
#line 2223 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_IN_SCRIPTING:
{
static const unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 192, 64, 0, 0, 64, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
192, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
60, 60, 44, 44, 44, 44, 44, 44,
44, 44, 0, 0, 0, 0, 0, 0,
0, 36, 36, 36, 36, 36, 36, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 0, 0, 0, 0, 4,
0, 36, 36, 36, 36, 36, 36, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 0, 0, 0, 0, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
};
YYDEBUG(121, *YYCURSOR);
YYFILL(16);
yych = *YYCURSOR;
YYDEBUG(-1, yych);
switch (yych) {
case 0x00:
case 0x01:
case 0x02:
case 0x03:
case 0x04:
case 0x05:
case 0x06:
case 0x07:
case 0x08:
case '\v':
case '\f':
case 0x0E:
case 0x0F:
case 0x10:
case 0x11:
case 0x12:
case 0x13:
case 0x14:
case 0x15:
case 0x16:
case 0x17:
case 0x18:
case 0x19:
case 0x1A:
case 0x1B:
case 0x1C:
case 0x1D:
case 0x1E:
case 0x1F: goto yy184;
case '\t':
case '\n':
case '\r':
case ' ': goto yy140;
case '!': goto yy153;
case '"': goto yy180;
case '#': goto yy176;
case '$': goto yy165;
case '%': goto yy159;
case '&': goto yy160;
case '\'': goto yy178;
case '(': goto yy147;
case ')':
case ',':
case ';':
case '@':
case '[':
case ']':
case '~': goto yy166;
case '*': goto yy156;
case '+': goto yy152;
case '-': goto yy138;
case '.': goto yy158;
case '/': goto yy157;
case '0': goto yy172;
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy174;
case ':': goto yy142;
case '<': goto yy154;
case '=': goto yy150;
case '>': goto yy155;
case '?': goto yy167;
case 'A':
case 'a': goto yy133;
case 'B':
case 'b': goto yy135;
case 'C':
case 'c': goto yy127;
case 'D':
case 'd': goto yy125;
case 'E':
case 'e': goto yy123;
case 'F':
case 'f': goto yy126;
case 'G':
case 'g': goto yy136;
case 'I':
case 'i': goto yy131;
case 'L':
case 'l': goto yy151;
case 'N':
case 'n': goto yy145;
case 'O':
case 'o': goto yy163;
case 'P':
case 'p': goto yy137;
case 'R':
case 'r': goto yy128;
case 'S':
case 's': goto yy134;
case 'T':
case 't': goto yy130;
case 'U':
case 'u': goto yy148;
case 'V':
case 'v': goto yy146;
case 'W':
case 'w': goto yy132;
case 'X':
case 'x': goto yy164;
case 'Y':
case 'y': goto yy129;
case '\\': goto yy143;
case '^': goto yy162;
case '_': goto yy149;
case '`': goto yy182;
case '{': goto yy168;
case '|': goto yy161;
case '}': goto yy170;
default: goto yy175;
}
yy123:
YYDEBUG(123, *YYCURSOR);
++YYCURSOR;
YYDEBUG(-1, yych);
switch ((yych = *YYCURSOR)) {
case 'C':
case 'c': goto yy735;
case 'L':
case 'l': goto yy736;
case 'M':
case 'm': goto yy737;
case 'N':
case 'n': goto yy738;
case 'V':
case 'v': goto yy739;
case 'X':
case 'x': goto yy740;
default: goto yy187;
}
yy124:
YYDEBUG(124, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1906 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, yytext, yyleng);
zendlval->type = IS_STRING;
return T_STRING;
}
#line 2412 "Zend/zend_language_scanner.c"
yy125:
YYDEBUG(125, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'O') {
if (yych <= 'H') {
if (yych == 'E') goto yy717;
goto yy187;
} else {
if (yych <= 'I') goto yy718;
if (yych <= 'N') goto yy187;
goto yy719;
}
} else {
if (yych <= 'h') {
if (yych == 'e') goto yy717;
goto yy187;
} else {
if (yych <= 'i') goto yy718;
if (yych == 'o') goto yy719;
goto yy187;
}
}
yy126:
YYDEBUG(126, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'U') {
if (yych <= 'N') {
if (yych == 'I') goto yy693;
goto yy187;
} else {
if (yych <= 'O') goto yy694;
if (yych <= 'T') goto yy187;
goto yy695;
}
} else {
if (yych <= 'n') {
if (yych == 'i') goto yy693;
goto yy187;
} else {
if (yych <= 'o') goto yy694;
if (yych == 'u') goto yy695;
goto yy187;
}
}
yy127:
YYDEBUG(127, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'O') {
if (yych <= 'K') {
if (yych == 'A') goto yy658;
goto yy187;
} else {
if (yych <= 'L') goto yy659;
if (yych <= 'N') goto yy187;
goto yy660;
}
} else {
if (yych <= 'k') {
if (yych == 'a') goto yy658;
goto yy187;
} else {
if (yych <= 'l') goto yy659;
if (yych == 'o') goto yy660;
goto yy187;
}
}
yy128:
YYDEBUG(128, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'E') goto yy640;
if (yych == 'e') goto yy640;
goto yy187;
yy129:
YYDEBUG(129, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'I') goto yy635;
if (yych == 'i') goto yy635;
goto yy187;
yy130:
YYDEBUG(130, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'R') {
if (yych == 'H') goto yy623;
if (yych <= 'Q') goto yy187;
goto yy624;
} else {
if (yych <= 'h') {
if (yych <= 'g') goto yy187;
goto yy623;
} else {
if (yych == 'r') goto yy624;
goto yy187;
}
}
yy131:
YYDEBUG(131, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'S') {
if (yych <= 'L') {
if (yych == 'F') goto yy570;
goto yy187;
} else {
if (yych <= 'M') goto yy572;
if (yych <= 'N') goto yy573;
if (yych <= 'R') goto yy187;
goto yy574;
}
} else {
if (yych <= 'm') {
if (yych == 'f') goto yy570;
if (yych <= 'l') goto yy187;
goto yy572;
} else {
if (yych <= 'n') goto yy573;
if (yych == 's') goto yy574;
goto yy187;
}
}
yy132:
YYDEBUG(132, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'H') goto yy565;
if (yych == 'h') goto yy565;
goto yy187;
yy133:
YYDEBUG(133, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'S') {
if (yych <= 'M') {
if (yych == 'B') goto yy547;
goto yy187;
} else {
if (yych <= 'N') goto yy548;
if (yych <= 'Q') goto yy187;
if (yych <= 'R') goto yy549;
goto yy550;
}
} else {
if (yych <= 'n') {
if (yych == 'b') goto yy547;
if (yych <= 'm') goto yy187;
goto yy548;
} else {
if (yych <= 'q') goto yy187;
if (yych <= 'r') goto yy549;
if (yych <= 's') goto yy550;
goto yy187;
}
}
yy134:
YYDEBUG(134, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'W') {
if (yych == 'T') goto yy535;
if (yych <= 'V') goto yy187;
goto yy536;
} else {
if (yych <= 't') {
if (yych <= 's') goto yy187;
goto yy535;
} else {
if (yych == 'w') goto yy536;
goto yy187;
}
}
yy135:
YYDEBUG(135, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= ';') {
if (yych <= '"') {
if (yych <= '!') goto yy187;
goto yy527;
} else {
if (yych == '\'') goto yy528;
goto yy187;
}
} else {
if (yych <= 'R') {
if (yych <= '<') goto yy526;
if (yych <= 'Q') goto yy187;
goto yy529;
} else {
if (yych == 'r') goto yy529;
goto yy187;
}
}
yy136:
YYDEBUG(136, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'O') {
if (yych == 'L') goto yy516;
if (yych <= 'N') goto yy187;
goto yy517;
} else {
if (yych <= 'l') {
if (yych <= 'k') goto yy187;
goto yy516;
} else {
if (yych == 'o') goto yy517;
goto yy187;
}
}
yy137:
YYDEBUG(137, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'U') {
if (yych == 'R') goto yy492;
if (yych <= 'T') goto yy187;
goto yy493;
} else {
if (yych <= 'r') {
if (yych <= 'q') goto yy187;
goto yy492;
} else {
if (yych == 'u') goto yy493;
goto yy187;
}
}
yy138:
YYDEBUG(138, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '<') {
if (yych == '-') goto yy488;
} else {
if (yych <= '=') goto yy486;
if (yych <= '>') goto yy490;
}
yy139:
YYDEBUG(139, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1448 "Zend/zend_language_scanner.l"
{
return yytext[0];
}
#line 2648 "Zend/zend_language_scanner.c"
yy140:
YYDEBUG(140, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
goto yy485;
yy141:
YYDEBUG(141, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1179 "Zend/zend_language_scanner.l"
{
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext, yyleng);
return T_WHITESPACE;
}
#line 2665 "Zend/zend_language_scanner.c"
yy142:
YYDEBUG(142, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == ':') goto yy482;
goto yy139;
yy143:
YYDEBUG(143, *YYCURSOR);
++YYCURSOR;
YYDEBUG(144, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1208 "Zend/zend_language_scanner.l"
{
return T_NS_SEPARATOR;
}
#line 2680 "Zend/zend_language_scanner.c"
yy145:
YYDEBUG(145, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'E') {
if (yych == 'A') goto yy470;
if (yych <= 'D') goto yy187;
goto yy471;
} else {
if (yych <= 'a') {
if (yych <= '`') goto yy187;
goto yy470;
} else {
if (yych == 'e') goto yy471;
goto yy187;
}
}
yy146:
YYDEBUG(146, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'A') goto yy467;
if (yych == 'a') goto yy467;
goto yy187;
yy147:
YYDEBUG(147, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 'S') {
if (yych <= 'D') {
if (yych <= ' ') {
if (yych == '\t') goto yy392;
if (yych <= 0x1F) goto yy139;
goto yy392;
} else {
if (yych <= '@') goto yy139;
if (yych == 'C') goto yy139;
goto yy392;
}
} else {
if (yych <= 'I') {
if (yych == 'F') goto yy392;
if (yych <= 'H') goto yy139;
goto yy392;
} else {
if (yych == 'O') goto yy392;
if (yych <= 'Q') goto yy139;
goto yy392;
}
}
} else {
if (yych <= 'f') {
if (yych <= 'b') {
if (yych == 'U') goto yy392;
if (yych <= '`') goto yy139;
goto yy392;
} else {
if (yych == 'd') goto yy392;
if (yych <= 'e') goto yy139;
goto yy392;
}
} else {
if (yych <= 'o') {
if (yych == 'i') goto yy392;
if (yych <= 'n') goto yy139;
goto yy392;
} else {
if (yych <= 's') {
if (yych <= 'q') goto yy139;
goto yy392;
} else {
if (yych == 'u') goto yy392;
goto yy139;
}
}
}
}
yy148:
YYDEBUG(148, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'S') {
if (yych == 'N') goto yy383;
if (yych <= 'R') goto yy187;
goto yy384;
} else {
if (yych <= 'n') {
if (yych <= 'm') goto yy187;
goto yy383;
} else {
if (yych == 's') goto yy384;
goto yy187;
}
}
yy149:
YYDEBUG(149, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '_') goto yy301;
goto yy187;
yy150:
YYDEBUG(150, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '<') goto yy139;
if (yych <= '=') goto yy295;
if (yych <= '>') goto yy297;
goto yy139;
yy151:
YYDEBUG(151, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'I') goto yy291;
if (yych == 'i') goto yy291;
goto yy187;
yy152:
YYDEBUG(152, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '+') goto yy289;
if (yych == '=') goto yy287;
goto yy139;
yy153:
YYDEBUG(153, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '=') goto yy284;
goto yy139;
yy154:
YYDEBUG(154, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= ';') {
if (yych == '/') goto yy256;
goto yy139;
} else {
if (yych <= '<') goto yy254;
if (yych <= '=') goto yy257;
if (yych <= '>') goto yy259;
goto yy139;
}
yy155:
YYDEBUG(155, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '<') goto yy139;
if (yych <= '=') goto yy250;
if (yych <= '>') goto yy248;
goto yy139;
yy156:
YYDEBUG(156, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '=') goto yy246;
goto yy139;
yy157:
YYDEBUG(157, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '.') {
if (yych == '*') goto yy238;
goto yy139;
} else {
if (yych <= '/') goto yy240;
if (yych == '=') goto yy241;
goto yy139;
}
yy158:
YYDEBUG(158, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy139;
if (yych <= '9') goto yy234;
if (yych == '=') goto yy236;
goto yy139;
yy159:
YYDEBUG(159, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '<') goto yy139;
if (yych <= '=') goto yy230;
if (yych <= '>') goto yy228;
goto yy139;
yy160:
YYDEBUG(160, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '&') goto yy224;
if (yych == '=') goto yy226;
goto yy139;
yy161:
YYDEBUG(161, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '=') goto yy222;
if (yych == '|') goto yy220;
goto yy139;
yy162:
YYDEBUG(162, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '=') goto yy218;
goto yy139;
yy163:
YYDEBUG(163, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'R') goto yy216;
if (yych == 'r') goto yy216;
goto yy187;
yy164:
YYDEBUG(164, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'O') goto yy213;
if (yych == 'o') goto yy213;
goto yy187;
yy165:
YYDEBUG(165, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '_') {
if (yych <= '@') goto yy139;
if (yych <= 'Z') goto yy210;
if (yych <= '^') goto yy139;
goto yy210;
} else {
if (yych <= '`') goto yy139;
if (yych <= 'z') goto yy210;
if (yych <= '~') goto yy139;
goto yy210;
}
yy166:
YYDEBUG(166, *YYCURSOR);
yych = *++YYCURSOR;
goto yy139;
yy167:
YYDEBUG(167, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '>') goto yy206;
goto yy139;
yy168:
YYDEBUG(168, *YYCURSOR);
++YYCURSOR;
YYDEBUG(169, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1453 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return '{';
}
#line 2913 "Zend/zend_language_scanner.c"
yy170:
YYDEBUG(170, *YYCURSOR);
++YYCURSOR;
YYDEBUG(171, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1465 "Zend/zend_language_scanner.l"
{
RESET_DOC_COMMENT();
if (!zend_stack_is_empty(&SCNG(state_stack))) {
yy_pop_state(TSRMLS_C);
}
return '}';
}
#line 2927 "Zend/zend_language_scanner.c"
yy172:
YYDEBUG(172, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 'E') {
if (yych <= '9') {
if (yych == '.') goto yy188;
if (yych >= '0') goto yy191;
} else {
if (yych == 'B') goto yy199;
if (yych >= 'E') goto yy193;
}
} else {
if (yych <= 'b') {
if (yych == 'X') goto yy198;
if (yych >= 'b') goto yy199;
} else {
if (yych <= 'e') {
if (yych >= 'e') goto yy193;
} else {
if (yych == 'x') goto yy198;
}
}
}
yy173:
YYDEBUG(173, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1516 "Zend/zend_language_scanner.l"
{
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
zendlval->value.lval = strtol(yytext, NULL, 0);
} else {
errno = 0;
zendlval->value.lval = strtol(yytext, NULL, 0);
if (errno == ERANGE) { /* Overflow */
if (yytext[0] == '0') { /* octal overflow */
zendlval->value.dval = zend_oct_strtod(yytext, NULL);
} else {
zendlval->value.dval = zend_strtod(yytext, NULL);
}
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
}
}
zendlval->type = IS_LONG;
return T_LNUMBER;
}
#line 2976 "Zend/zend_language_scanner.c"
yy174:
YYDEBUG(174, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '9') {
if (yych == '.') goto yy188;
if (yych <= '/') goto yy173;
goto yy191;
} else {
if (yych <= 'E') {
if (yych <= 'D') goto yy173;
goto yy193;
} else {
if (yych == 'e') goto yy193;
goto yy173;
}
}
yy175:
YYDEBUG(175, *YYCURSOR);
yych = *++YYCURSOR;
goto yy187;
yy176:
YYDEBUG(176, *YYCURSOR);
++YYCURSOR;
yy177:
YYDEBUG(177, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1913 "Zend/zend_language_scanner.l"
{
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
case '\r':
if (*YYCURSOR == '\n') {
YYCURSOR++;
}
/* fall through */
case '\n':
CG(zend_lineno)++;
break;
case '%':
if (!CG(asp_tags)) {
continue;
}
/* fall through */
case '?':
if (*YYCURSOR == '>') {
YYCURSOR--;
break;
}
/* fall through */
default:
continue;
}
break;
}
yyleng = YYCURSOR - SCNG(yy_text);
return T_COMMENT;
}
#line 3038 "Zend/zend_language_scanner.c"
yy178:
YYDEBUG(178, *YYCURSOR);
++YYCURSOR;
yy179:
YYDEBUG(179, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2004 "Zend/zend_language_scanner.l"
{
register char *s, *t;
char *end;
int bprefix = (yytext[0] != '\'') ? 1 : 0;
while (1) {
if (YYCURSOR < YYLIMIT) {
if (*YYCURSOR == '\'') {
YYCURSOR++;
yyleng = YYCURSOR - SCNG(yy_text);
break;
} else if (*YYCURSOR++ == '\\' && YYCURSOR < YYLIMIT) {
YYCURSOR++;
}
} else {
yyleng = YYLIMIT - SCNG(yy_text);
/* Unclosed single quotes; treat similar to double quotes, but without a separate token
* for ' (unrecognized by parser), instead of old flex fallback to "Unexpected character..."
* rule, which continued in ST_IN_SCRIPTING state after the quote */
return T_ENCAPSED_AND_WHITESPACE;
}
}
zendlval->value.str.val = estrndup(yytext+bprefix+1, yyleng-bprefix-2);
zendlval->value.str.len = yyleng-bprefix-2;
zendlval->type = IS_STRING;
/* convert escape sequences */
s = t = zendlval->value.str.val;
end = s+zendlval->value.str.len;
while (s<end) {
if (*s=='\\') {
s++;
switch(*s) {
case '\\':
case '\'':
*t++ = *s;
zendlval->value.str.len--;
break;
default:
*t++ = '\\';
*t++ = *s;
break;
}
} else {
*t++ = *s;
}
if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) {
CG(zend_lineno)++;
}
s++;
}
*t = 0;
if (SCNG(output_filter)) {
size_t sz = 0;
s = zendlval->value.str.val;
SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC);
zendlval->value.str.len = sz;
efree(s);
}
return T_CONSTANT_ENCAPSED_STRING;
}
#line 3113 "Zend/zend_language_scanner.c"
yy180:
YYDEBUG(180, *YYCURSOR);
++YYCURSOR;
yy181:
YYDEBUG(181, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2073 "Zend/zend_language_scanner.l"
{
int bprefix = (yytext[0] != '"') ? 1 : 0;
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
case '"':
yyleng = YYCURSOR - SCNG(yy_text);
zend_scan_escape_string(zendlval, yytext+bprefix+1, yyleng-bprefix-2, '"' TSRMLS_CC);
return T_CONSTANT_ENCAPSED_STRING;
case '$':
if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
break;
}
continue;
case '{':
if (*YYCURSOR == '$') {
break;
}
continue;
case '\\':
if (YYCURSOR < YYLIMIT) {
YYCURSOR++;
}
/* fall through */
default:
continue;
}
YYCURSOR--;
break;
}
/* Remember how much was scanned to save rescanning */
SET_DOUBLE_QUOTES_SCANNED_LENGTH(YYCURSOR - SCNG(yy_text) - yyleng);
YYCURSOR = SCNG(yy_text) + yyleng;
BEGIN(ST_DOUBLE_QUOTES);
return '"';
}
#line 3161 "Zend/zend_language_scanner.c"
yy182:
YYDEBUG(182, *YYCURSOR);
++YYCURSOR;
YYDEBUG(183, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2163 "Zend/zend_language_scanner.l"
{
BEGIN(ST_BACKQUOTE);
return '`';
}
#line 3172 "Zend/zend_language_scanner.c"
yy184:
YYDEBUG(184, *YYCURSOR);
++YYCURSOR;
YYDEBUG(185, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 2426 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
}
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
goto restart;
}
#line 3187 "Zend/zend_language_scanner.c"
yy186:
YYDEBUG(186, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
yy187:
YYDEBUG(187, *YYCURSOR);
if (yybm[0+yych] & 4) {
goto yy186;
}
goto yy124;
yy188:
YYDEBUG(188, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(3);
yych = *YYCURSOR;
YYDEBUG(189, *YYCURSOR);
if (yybm[0+yych] & 8) {
goto yy188;
}
if (yych == 'E') goto yy193;
if (yych == 'e') goto yy193;
yy190:
YYDEBUG(190, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1581 "Zend/zend_language_scanner.l"
{
zendlval->value.dval = zend_strtod(yytext, NULL);
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
}
#line 3220 "Zend/zend_language_scanner.c"
yy191:
YYDEBUG(191, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(3);
yych = *YYCURSOR;
YYDEBUG(192, *YYCURSOR);
if (yych <= '9') {
if (yych == '.') goto yy188;
if (yych <= '/') goto yy173;
goto yy191;
} else {
if (yych <= 'E') {
if (yych <= 'D') goto yy173;
} else {
if (yych != 'e') goto yy173;
}
}
yy193:
YYDEBUG(193, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= ',') {
if (yych == '+') goto yy195;
} else {
if (yych <= '-') goto yy195;
if (yych <= '/') goto yy194;
if (yych <= '9') goto yy196;
}
yy194:
YYDEBUG(194, *YYCURSOR);
YYCURSOR = YYMARKER;
if (yyaccept <= 2) {
if (yyaccept <= 1) {
if (yyaccept <= 0) {
goto yy124;
} else {
goto yy139;
}
} else {
goto yy173;
}
} else {
if (yyaccept <= 4) {
if (yyaccept <= 3) {
goto yy190;
} else {
goto yy239;
}
} else {
goto yy255;
}
}
yy195:
YYDEBUG(195, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '/') goto yy194;
if (yych >= ':') goto yy194;
yy196:
YYDEBUG(196, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(197, *YYCURSOR);
if (yych <= '/') goto yy190;
if (yych <= '9') goto yy196;
goto yy190;
yy198:
YYDEBUG(198, *YYCURSOR);
yych = *++YYCURSOR;
if (yybm[0+yych] & 32) {
goto yy203;
}
goto yy194;
yy199:
YYDEBUG(199, *YYCURSOR);
yych = *++YYCURSOR;
if (yybm[0+yych] & 16) {
goto yy200;
}
goto yy194;
yy200:
YYDEBUG(200, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(201, *YYCURSOR);
if (yybm[0+yych] & 16) {
goto yy200;
}
YYDEBUG(202, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1491 "Zend/zend_language_scanner.l"
{
char *bin = yytext + 2; /* Skip "0b" */
int len = yyleng - 2;
/* Skip any leading 0s */
while (*bin == '0') {
++bin;
--len;
}
if (len < SIZEOF_LONG * 8) {
if (len == 0) {
zendlval->value.lval = 0;
} else {
zendlval->value.lval = strtol(bin, NULL, 2);
}
zendlval->type = IS_LONG;
return T_LNUMBER;
} else {
zendlval->value.dval = zend_bin_strtod(bin, NULL);
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
}
}
#line 3337 "Zend/zend_language_scanner.c"
yy203:
YYDEBUG(203, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(204, *YYCURSOR);
if (yybm[0+yych] & 32) {
goto yy203;
}
YYDEBUG(205, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1537 "Zend/zend_language_scanner.l"
{
char *hex = yytext + 2; /* Skip "0x" */
int len = yyleng - 2;
/* Skip any leading 0s */
while (*hex == '0') {
hex++;
len--;
}
if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) {
if (len == 0) {
zendlval->value.lval = 0;
} else {
zendlval->value.lval = strtol(hex, NULL, 16);
}
zendlval->type = IS_LONG;
return T_LNUMBER;
} else {
zendlval->value.dval = zend_hex_strtod(hex, NULL);
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
}
}
#line 3374 "Zend/zend_language_scanner.c"
yy206:
YYDEBUG(206, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '\n') goto yy208;
if (yych == '\r') goto yy209;
yy207:
YYDEBUG(207, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 198