121 |
121 |
122 enum{ |
122 enum{ |
123 TOKZ_IGNORE_NEXTLINE=0x1, |
123 TOKZ_IGNORE_NEXTLINE=0x1, |
124 TOKZ_READ_COMMENTS=0x2, |
124 TOKZ_READ_COMMENTS=0x2, |
125 TOKZ_PARSER_INDENT_MODE=0x04, |
125 TOKZ_PARSER_INDENT_MODE=0x04, |
126 TOKZ_ERROR_TOLERANT=0x8 |
126 TOKZ_ERROR_TOLERANT=0x8, |
|
127 TOKZ_READ_FROM_BUFFER=0x10, |
|
128 TOKZ_DEFAULT_OPTION=0x20 |
127 }; |
129 }; |
128 |
130 |
129 |
131 |
130 enum{ |
132 enum{ |
131 E_TOKZ_UNEXPECTED_EOF=1, |
133 E_TOKZ_UNEXPECTED_EOF=1, |
182 } Tokenizer; |
192 } Tokenizer; |
183 |
193 |
184 |
194 |
185 extern Tokenizer *tokz_open(const char *fname); |
195 extern Tokenizer *tokz_open(const char *fname); |
186 extern Tokenizer *tokz_open_file(FILE *file, const char *fname); |
196 extern Tokenizer *tokz_open_file(FILE *file, const char *fname); |
|
197 extern Tokenizer *tokz_prepare_buffer(char *buffer, int len); |
187 extern void tokz_close(Tokenizer *tokz); |
198 extern void tokz_close(Tokenizer *tokz); |
188 extern bool tokz_get_token(Tokenizer *tokz, Token *tok); |
199 extern bool tokz_get_token(Tokenizer *tokz, Token *tok); |
189 extern void tokz_unget_token(Tokenizer *tokz, Token *tok); |
200 extern void tokz_unget_token(Tokenizer *tokz, Token *tok); |
190 extern void tokz_warn_error(const Tokenizer *tokz, int line, int e); |
201 extern void tokz_warn_error(const Tokenizer *tokz, int line, int e); |
191 extern void tokz_warn(const Tokenizer *tokz, int line, const char *fmt, ...); |
202 extern void tokz_warn(const Tokenizer *tokz, int line, const char *fmt, ...); |