1 #ifndef SP_VAR_PARSER_H
2 #define SP_VAR_PARSER_H
3 #include "php_snuffleupagus.h"
4 
5 typedef struct sp_token_s {
6   elem_type type;
7   char *text_repr;
8   size_t pos;
9 } sp_conf_token;
10 
11 zval *sp_get_var_value(zend_execute_data *, const sp_tree *, bool);
12 sp_tree *sp_parse_var(const char *);
13 
14 #define OBJECT_TOKEN "->"
15 #define ARRAY_TOKEN "["
16 #define ARRAY_END_TOKEN "]"
17 #define STRING_TOKEN "\""
18 #define ESC_STRING_TOKEN "\'"
19 #define CLASS_TOKEN "::"
20 
21 #define VARIABLE_TOKEN '$'
22 
23 #define PRIVATE_PROP_FMT "%c%s%c%s"
24 #define PROTECTED_PROP_FMT "%c*%c%s"
25 
26 #define REGEXP_VAR "^\\$[a-z_][a-z0-9_]*$"
27 #define REGEXP_CONST "^[a-z_0-9\\\\]*$"
28 
29 #endif
30