zend_language_scanner.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. /* $Id$ */
  20. #ifndef ZEND_SCANNER_H
  21. #define ZEND_SCANNER_H
  22. typedef struct _zend_lex_state {
  23. unsigned int yy_leng;
  24. unsigned char *yy_start;
  25. unsigned char *yy_text;
  26. unsigned char *yy_cursor;
  27. unsigned char *yy_marker;
  28. unsigned char *yy_limit;
  29. int yy_state;
  30. zend_stack state_stack;
  31. zend_ptr_stack heredoc_label_stack;
  32. zend_file_handle *in;
  33. uint lineno;
  34. char *filename;
  35. /* original (unfiltered) script */
  36. unsigned char *script_org;
  37. size_t script_org_size;
  38. /* filtered script */
  39. unsigned char *script_filtered;
  40. size_t script_filtered_size;
  41. /* input/output filters */
  42. zend_encoding_filter input_filter;
  43. zend_encoding_filter output_filter;
  44. const zend_encoding *script_encoding;
  45. } zend_lex_state;
  46. typedef struct _zend_heredoc_label {
  47. char *label;
  48. int length;
  49. } zend_heredoc_label;
  50. BEGIN_EXTERN_C()
  51. int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2);
  52. ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC);
  53. ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC);
  54. ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC);
  55. ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC);
  56. ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC);
  57. END_EXTERN_C()
  58. #endif
  59. /*
  60. * Local variables:
  61. * tab-width: 4
  62. * c-basic-offset: 4
  63. * indent-tabs-mode: t
  64. * End:
  65. */