-/* Generated by re2c 0.13.3.dev on Tue Mar 4 00:16:12 2008 */
+/* Generated by re2c 0.13.3.dev on Tue Mar 4 00:28:13 2008 */
/* $Id$ */
#include <stdlib.h>
#include <string.h>
}
}
-void Scanner::check_token_length(uint len) const
+void Scanner::check_token_length(char *pos, uint len) const
{
- if (len >= BSIZE)
+ if (pos < bot || pos + len >= top)
{
fatal("Token exceeds limit");
}
std::istream& in;
std::ostream& out;
char *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof, *ctx;
- uint tchar, tline, cline, iscfg;
+ uint tchar, tline, cline, iscfg, buf_size;
private:
char *fill(char*);
void config(const Str&, int);
void config(const Str&, const Str&);
- void check_token_length(uint len) const;
+ void check_token_length(char *pos, uint len) const;
SubStr token() const;
SubStr token(uint start, uint len) const;
SubStr raw_token(std::string enclosure) const;
inline SubStr Scanner::token() const
{
- check_token_length(cur - tok);
+ check_token_length(tok, cur - tok);
return SubStr(tok, cur - tok);
}
inline SubStr Scanner::token(uint start, uint len) const
{
- check_token_length(len);
+ check_token_length(tok + start, len);
return SubStr(tok + start, len);
}
}
}
-void Scanner::check_token_length(uint len) const
+void Scanner::check_token_length(char *pos, uint len) const
{
- if (len >= BSIZE)
+ if (pos < bot || pos + len >= top)
{
fatal("Token exceeds limit");
}