}
}
-SubStr Scanner::raw_token(std::string enclosure) const
+Str Scanner::raw_token(std::string enclosure) const
{
- return SubStr(std::string(enclosure + token().to_string() + enclosure).c_str());
+ return Str(std::string(enclosure + token().to_string() + enclosure).c_str());
}
void Scanner::reuse()
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;
+ Str raw_token(std::string enclosure) const;
virtual uint get_line() const;
uint xlat(uint c) const;
s.len = 0;
}
+Str::Str(const char *s)
+ : SubStr(strdup(s), strlen(s))
+{
+ ;
+}
+
Str::Str()
: SubStr((char*) NULL, 0)
{
if (str) {
free((void*)str);
}
- str = (char*) - 1;
- len = (uint) - 1;
+ str = NULL;
+ len = 0;
}
} // end namespace re2c
public:
Str(const SubStr&);
Str(Str&);
+ Str(const char*);
Str();
~Str();
};