diff options
author | Márcio Almada <marcio3w@gmail.com> | 2015-04-05 08:50:35 -0300 |
---|---|---|
committer | Márcio Almada <marcio3w@gmail.com> | 2015-04-30 03:03:29 -0300 |
commit | 110759386e2f9b4d88bf68c669b6c54ad4b5c04f (patch) | |
tree | c0dc58e312c77662a5f6e10941408560a4b440ac /Zend/zend_globals.h | |
parent | 02a9eb4f8c736089808b51d862def0e648383e09 (diff) | |
download | php-git-110759386e2f9b4d88bf68c669b6c54ad4b5c04f.tar.gz |
ext tokenizer port + cleanup unused lexer states
we basically added a mechanism to store the token stream during parsing
and exposed the entire parser stack on the tokenizer extension through
an opt in flag: token_get_all($src, TOKEN_PARSE).
this change allows easy future language enhancements regarding context
aware parsing & scanning without further maintance on the tokenizer
extension while solves known inconsistencies "parseless" tokenizer
extension has when it handles `__halt_compiler()` presence.
Diffstat (limited to 'Zend/zend_globals.h')
-rw-r--r-- | Zend/zend_globals.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 326955a103..28487a2a4a 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -249,6 +249,12 @@ struct _zend_ini_scanner_globals { int scanner_mode; }; +typedef enum { + ON_TOKEN, + ON_FEEDBACK, + ON_STOP +} zend_php_scanner_event; + struct _zend_php_scanner_globals { zend_file_handle *yy_in; zend_file_handle *yy_out; @@ -278,6 +284,9 @@ struct _zend_php_scanner_globals { /* initial string length after scanning to first variable */ int scanned_string_len; + + /* hooks */ + void (* on_event)(zend_php_scanner_event event, int token, int line); }; #endif /* ZEND_GLOBALS_H */ |