comparison src/tokenizer.h @ 5:276c4edc8521

initial coding
author carl
date Fri, 02 Dec 2005 17:52:44 -0800
parents 551433a01cab
children d76f9ff42487
comparison
equal deleted inserted replaced
4:2737ab01659a 5:276c4edc8521
56 void push_char(u_char c); 56 void push_char(u_char c);
57 57
58 public: 58 public:
59 TOKEN(char *fn, string_set *includes); 59 TOKEN(char *fn, string_set *includes);
60 ~TOKEN(); 60 ~TOKEN();
61 bool include(char *fn); 61 bool include(char *fn);
62 char *next(); // return next token 62 char *next(); // return next token
63 int nextint(); 63 int nextint();
64 void skipeol(); // skip to eol 64 void skipeol(); // skip to eol
65 void push(char *token) {pending_tokens.push_front(token);}; 65 void push(char *token) {pending_tokens.push_front(token);};
66 char *cur_fn() {return filenames.front();}; 66 const char *cur_fn() {return filenames.empty() ? "" : filenames.front();};
67 int cur_line() {return linenumbers.front();}; 67 int cur_line() {return linenumbers.empty() ? 0 : linenumbers.front();};
68 void token_error(const char *err); 68 void token_error(const char *err);
69 void token_error(const char *fmt, int d, const char *s); 69 void token_error(const char *fmt, int d, const char *s);
70 void token_error(const char *fmt, const char *t, const char *h); 70 void token_error(const char *fmt, const char *t, const char *h);
71 void token_error(const char *want, const char *have); 71 void token_error(const char *want, const char *have);
72 void token_error(); 72 void token_error();
73 }; 73 };
74 74
75 #endif 75 #endif