-/* Generated by re2c 0.13.3.dev on Sun Mar 2 21:34:25 2008 */
+/* Generated by re2c 0.13.3.dev on Tue Mar 4 00:16:12 2008 */
/* $Id$ */
#include <stdlib.h>
#include <string.h>
}
}
+void Scanner::check_token_length(uint len) const
+{
+ if (len >= BSIZE)
+ {
+ fatal("Token exceeds limit");
+ }
+}
+
SubStr Scanner::raw_token(std::string enclosure) const
{
return SubStr(std::string(enclosure + token().to_string() + enclosure).c_str());
void config(const Str&, int);
void config(const Str&, const Str&);
+ void check_token_length(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);
return SubStr(tok, cur - tok);
}
inline SubStr Scanner::token(uint start, uint len) const
{
+ check_token_length(len);
return SubStr(tok + start, len);
}
}
}
+void Scanner::check_token_length(uint len) const
+{
+ if (len >= BSIZE)
+ {
+ fatal("Token exceeds limit");
+ }
+}
+
SubStr Scanner::raw_token(std::string enclosure) const
{
return SubStr(std::string(enclosure + token().to_string() + enclosure).c_str());