diff options
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/parser.h b/parser.h new file mode 100644 index 0000000..065ed2a --- /dev/null +++ b/parser.h @@ -0,0 +1,32 @@ +#ifndef PARSER_H +#define PARSER_H + +#include "model.h" +#include <string> + +using std::string; + +const int TOKEN_BUFF_SIZE = 65536; +const int PARSE_STACK_SIZE = 65536; + +class Tokenizor { + private: + FILE *stream; + char *buff_ptr; + public: + Tokenizor(); + void set_stream(FILE *stream); + bool get_token(string &ret); +}; + +class ASTGenerator { + private: + static EvalObj* to_float(const string &); + static EvalObj* to_int(const string &); + static EvalObj* to_obj(const string &); + public: + ASTGenerator(); + Cons *absorb(Tokenizor *tk); +}; + +#endif |