CYNoRightHand = (1 << 5),
CYNoDangle = (1 << 6),
CYNoInteger = (1 << 7),
+ CYNoColon = (1 << 8),
CYNoBFC = (CYNoBrace | CYNoFunction | CYNoClass),
};
return false;
}
+ virtual bool IsNew() const {
+ return false;
+ }
+
virtual CYStatement *Initialize(CYContext &context, CYExpression *value);
virtual CYTarget *Replace(CYContext &context) = 0;
virtual CYFunctionParameter *Parameter() const;
};
+struct CYSymbol :
+ CYTarget
+{
+ const char *name_;
+
+ CYSymbol(const char *name) :
+ name_(name)
+ {
+ }
+
+ CYPrecedence(0)
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
struct CYPrefix :
CYExpression
{
{
}
+ CYTarget *Replace(CYContext &context, CYTarget *seed);
+
virtual CYTarget *Replace(CYContext &context);
void Output(CYOutput &out, CYFlags flags) const;
};
virtual void Output(CYOutput &out, CYFlags flags) const;
};
+struct CYResolveMember :
+ CYMember
+{
+ CYResolveMember(CYExpression *object, CYExpression *property) :
+ CYMember(object, property)
+ {
+ }
+
+ CYPrecedence(1)
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
+struct CYSubscriptMember :
+ CYMember
+{
+ CYSubscriptMember(CYExpression *object, CYExpression *property) :
+ CYMember(object, property)
+ {
+ }
+
+ CYPrecedence(1)
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
namespace cy {
namespace Syntax {
return arguments_ == NULL ? 2 : 1;
}
+ virtual bool IsNew() const {
+ return true;
+ }
virtual CYTarget *Replace(CYContext &context);
virtual void Output(CYOutput &out, CYFlags flags) const;
struct CYRubyProc;
-struct CYRubyBlock :
+struct CYBraced :
CYTarget
{
- CYExpression *call_;
- CYRubyProc *proc_;
+ CYTarget *lhs_;
- CYRubyBlock(CYExpression *call, CYRubyProc *proc) :
- call_(call),
- proc_(proc)
+ CYBraced(CYTarget *lhs = NULL) :
+ lhs_(lhs)
{
}
CYPrecedence(1)
+ void SetLeft(CYTarget *lhs) {
+ lhs_ = lhs;
+ }
+};
+
+struct CYRubyBlock :
+ CYBraced
+{
+ CYRubyProc *proc_;
+
+ CYRubyBlock(CYTarget *lhs, CYRubyProc *proc) :
+ CYBraced(lhs),
+ proc_(proc)
+ {
+ }
+
virtual CYTarget *Replace(CYContext &context);
virtual void Output(CYOutput &out, CYFlags flags) const;
virtual CYTarget *AddArgument(CYContext &context, CYExpression *value);
};
+struct CYExtend :
+ CYBraced
+{
+ CYObject object_;
+
+ CYExtend(CYTarget *lhs, CYProperty *properties = NULL) :
+ CYBraced(lhs),
+ object_(properties)
+ {
+ }
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
struct CYIf :
CYStatement
{