virtual void Output(CYOutput &out, CYFlags flags) const;
};
-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)
- {
- }
-};
-
struct CYForInitialiser {
virtual ~CYForInitialiser() {
}
struct CYString;
struct CYExpression :
- CYNext<CYExpression>,
CYForInitialiser,
CYForInInitialiser,
CYClassName,
virtual CYAssignment *Assignment(CYContext &context);
virtual CYExpression *Primitive(CYContext &context) {
- return this;
+ return NULL;
}
virtual CYNumber *Number(CYContext &context) {
struct CYCompound :
CYExpression
{
- CYExpression *expressions_;
+ CYExpression *expression_;
+ CYExpression *next_;
- CYCompound(CYExpression *expressions = NULL) :
- expressions_(expressions)
+ CYCompound(CYExpression *expression, CYExpression *next = NULL) :
+ expression_(expression),
+ next_(next)
{
- }
-
- void AddPrev(CYExpression *expression) {
- CYSetLast(expression) = expressions_;
- expressions_ = expression;
+ if (expression_ == NULL)
+ throw;
+ _assert(expression_ != NULL);
}
CYPrecedence(17)
{
CYPrecedence(0)
CYRightHand(false)
+
+ virtual CYExpression *Primitive(CYContext &context) {
+ return this;
+ }
};
struct CYTrivial :
CYExpress(CYExpression *expression) :
expression_(expression)
{
- if (expression == NULL)
+ if (expression_ == NULL)
throw;
}