1 /* 2 +----------------------------------------------------------------------+ 3 | Zend Engine | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) | 6 +----------------------------------------------------------------------+ 7 | This source file is subject to version 2.00 of the Zend license, | 8 | that is bundled with this package in the file LICENSE, and is | 9 | available through the world-wide-web at the following url: | 10 | http://www.zend.com/license/2_00.txt. | 11 | If you did not receive a copy of the Zend license and are unable to | 12 | obtain it through the world-wide-web, please send a note to | 13 | license@zend.com so we can mail you a copy immediately. | 14 +----------------------------------------------------------------------+ 15 | Authors: Andi Gutmans <andi@zend.com> | 16 | Zeev Suraski <zeev@zend.com> | 17 +----------------------------------------------------------------------+ 18 */ 19 20 /* $Id$ */ 21 22 #ifndef ZEND_SCANNER_H 23 #define ZEND_SCANNER_H 24 25 typedef struct _zend_lex_state { 26 unsigned int yy_leng; 27 unsigned char *yy_start; 28 unsigned char *yy_text; 29 unsigned char *yy_cursor; 30 unsigned char *yy_marker; 31 unsigned char *yy_limit; 32 int yy_state; 33 zend_stack state_stack; 34 zend_ptr_stack heredoc_label_stack; 35 36 zend_file_handle *in; 37 uint lineno; 38 char *filename; 39 40 /* original (unfiltered) script */ 41 unsigned char *script_org; 42 size_t script_org_size; 43 44 /* filtered script */ 45 unsigned char *script_filtered; 46 size_t script_filtered_size; 47 48 /* input/output filters */ 49 zend_encoding_filter input_filter; 50 zend_encoding_filter output_filter; 51 const zend_encoding *script_encoding; 52 } zend_lex_state; 53 54 typedef struct _zend_heredoc_label { 55 char *label; 56 int length; 57 } zend_heredoc_label; 58 59 BEGIN_EXTERN_C() 60 int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2); 61 ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC); 62 ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC); 63 ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC); 64 ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC); 65 ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC); 66 67 END_EXTERN_C() 68 69 #endif 70 71 /* 72 * Local variables: 73 * tab-width: 4 74 * c-basic-offset: 4 75 * indent-tabs-mode: t 76 * End: 77 */ 78