104 |
}; |
}; |
105 |
typedef Ref<Args,Node> ArgsRef; |
typedef Ref<Args,Node> ArgsRef; |
106 |
|
|
107 |
class Variable : virtual public Expression { |
class Variable : virtual public VMVariable, virtual public Expression { |
108 |
public: |
public: |
109 |
virtual bool isConstExpr() const { return bConst; } |
bool isConstExpr() const OVERRIDE { return bConst; } |
110 |
virtual bool isAssignable() const { return !bConst; } |
bool isAssignable() const OVERRIDE { return !bConst; } |
111 |
virtual void assign(Expression* expr) = 0; |
virtual void assign(Expression* expr) = 0; |
112 |
|
void assignExpr(VMExpr* expr) OVERRIDE { Expression* e = dynamic_cast<Expression*>(expr); if (e) assign(e); } |
113 |
protected: |
protected: |
114 |
Variable(ParserContext* ctx, int _memPos, bool _bConst) |
Variable(ParserContext* ctx, int _memPos, bool _bConst) |
115 |
: context(ctx), memPos(_memPos), bConst(_bConst) {} |
: context(ctx), memPos(_memPos), bConst(_bConst) {} |
331 |
bool isConstExpr() const OVERRIDE { return dynVar->isConstExpr(); } |
bool isConstExpr() const OVERRIDE { return dynVar->isConstExpr(); } |
332 |
bool isAssignable() const OVERRIDE { return dynVar->isAssignable(); } |
bool isAssignable() const OVERRIDE { return dynVar->isAssignable(); } |
333 |
bool isPolyphonic() const OVERRIDE { return false; } |
bool isPolyphonic() const OVERRIDE { return false; } |
334 |
void assign(Expression* expr) OVERRIDE { dynVar->assign(expr); } |
void assign(Expression* expr) OVERRIDE { dynVar->assignExpr(expr); } |
335 |
int evalInt() OVERRIDE; |
int evalInt() OVERRIDE; |
336 |
String evalStr() OVERRIDE; |
String evalStr() OVERRIDE; |
337 |
String evalCastToStr() OVERRIDE; |
String evalCastToStr() OVERRIDE; |