#include "Pooling.hpp"
#include "Options.hpp"
-class CYContext;
+struct CYContext;
struct CYThing {
virtual ~CYThing() {
CYNewLine
};
+class CYStream :
+ public std::istream
+{
+ private:
+ class CYBuffer :
+ public std::streambuf
+ {
+ public:
+ CYBuffer(const char *start, const char *end) {
+ setg(const_cast<char *>(start), const_cast<char *>(start), const_cast<char *>(end));
+ }
+ } buffer_;
+
+ public:
+ CYStream(const char *start, const char *end) :
+ std::istream(&buffer_),
+ buffer_(start, end)
+ {
+ }
+};
+
class CYDriver {
public:
void *scanner_;
bool OpenBrace;
} no_;
- const char *data_;
- size_t size_;
- FILE *file_;
+ std::istream &data_;
bool strict_;
+ bool commented_;
enum Condition {
RegExpCondition,
void ScannerDestroy();
public:
- CYDriver(const std::string &filename = "");
+ CYDriver(std::istream &data, const std::string &filename = "");
~CYDriver();
Condition GetCondition();