#include "../Syntax.hpp"
struct CYInstanceLiteral :
- CYExpression
+ CYTarget
{
CYNumber *number_;
CYPrecedence(1)
- virtual CYExpression *Replace(CYContext &context);
+ virtual CYTarget *Replace(CYContext &context);
virtual void Output(CYOutput &out, CYFlags flags) const;
};
struct CYObjCBlock :
- CYExpression
+ CYTarget
{
CYTypedIdentifier *typed_;
CYTypedParameter *parameters_;
CYPrecedence(1)
- virtual CYExpression *Replace(CYContext &context);
+ virtual CYTarget *Replace(CYContext &context);
virtual void Output(CYOutput &out, CYFlags flags) const;
};
struct CYBox :
- CYExpression
+ CYTarget
{
CYExpression *value_;
CYPrecedence(1)
- virtual CYExpression *Replace(CYContext &context);
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
+struct CYObjCArray :
+ CYTarget
+{
+ CYElement *elements_;
+
+ CYObjCArray(CYElement *elements = NULL) :
+ elements_(elements)
+ {
+ }
+
+ CYPrecedence(0)
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
+struct CYObjCKeyValue :
+ CYNext<CYObjCKeyValue>
+{
+ CYExpression *key_;
+ CYExpression *value_;
+
+ CYObjCKeyValue(CYExpression *key, CYExpression *value, CYObjCKeyValue *next) :
+ CYNext<CYObjCKeyValue>(next),
+ key_(key),
+ value_(value)
+ {
+ }
+};
+
+struct CYObjCDictionary :
+ CYTarget
+{
+ CYObjCKeyValue *pairs_;
+
+ CYObjCDictionary(CYObjCKeyValue *pairs) :
+ pairs_(pairs)
+ {
+ }
+
+ CYPrecedence(0)
+
+ virtual CYTarget *Replace(CYContext &context);
virtual void Output(CYOutput &out, CYFlags flags) const;
};
struct CYSelector :
CYLiteral
{
- CYSelectorPart *name_;
+ CYSelectorPart *parts_;
- CYSelector(CYSelectorPart *name) :
- name_(name)
+ CYSelector(CYSelectorPart *parts) :
+ parts_(parts)
{
}
CYPrecedence(1)
- virtual CYExpression *Replace(CYContext &context);
+ virtual CYTarget *Replace(CYContext &context);
virtual void Output(CYOutput &out, CYFlags flags) const;
};
-struct CYClassField :
- CYNext<CYClassField>
+struct CYImplementationField :
+ CYNext<CYImplementationField>
{
CYTypedIdentifier *typed_;
- CYClassField(CYTypedIdentifier *typed, CYClassField *next = NULL) :
- CYNext<CYClassField>(next),
+ CYImplementationField(CYTypedIdentifier *typed, CYImplementationField *next = NULL) :
+ CYNext<CYImplementationField>(next),
typed_(typed)
{
}
struct CYMessageParameter :
CYNext<CYMessageParameter>
{
- CYWord *tag_;
+ CYWord *name_;
CYTypedIdentifier *type_;
- CYMessageParameter(CYWord *tag, CYTypedIdentifier *type) :
- tag_(tag),
+ CYMessageParameter(CYWord *name, CYTypedIdentifier *type, CYMessageParameter *next = NULL) :
+ CYNext<CYMessageParameter>(next),
+ name_(name),
type_(type)
{
}
CYMessageParameter *parameters_;
CYBlock code_;
- CYMessage(bool instance, CYTypedIdentifier *type, CYMessageParameter *parameter, CYStatement *code) :
+ CYMessage(bool instance, CYTypedIdentifier *type, CYMessageParameter *parameters, CYStatement *code) :
instance_(instance),
type_(type),
- parameters_(parameter),
+ parameters_(parameters),
code_(code)
{
}
CYStatement *Replace(CYContext &context, bool replace) const;
- void Output(CYOutput &out, bool replace) const;
+ void Output(CYOutput &out) const;
CYExpression *TypeSignature(CYContext &context) const;
};
void Output(CYOutput &out) const;
};
-struct CYClassStatement :
+struct CYImplementation :
CYStatement
{
- CYClassName *name_;
- CYExpression *super_;
+ CYIdentifier *name_;
+ CYExpression *extends_;
CYProtocol *protocols_;
- CYClassField *fields_;
+ CYImplementationField *fields_;
CYMessage *messages_;
- CYClassStatement(CYClassName *name, CYExpression *super, CYProtocol *protocols, CYClassField *fields, CYMessage *messages) :
+ CYImplementation(CYIdentifier *name, CYExpression *extends, CYProtocol *protocols, CYImplementationField *fields, CYMessage *messages) :
name_(name),
- super_(super),
+ extends_(extends),
protocols_(protocols),
fields_(fields),
messages_(messages)
struct CYCategory :
CYStatement
{
- CYClassName *name_;
+ CYIdentifier *name_;
CYMessage *messages_;
- CYCategory(CYClassName *name, CYMessage *messages) :
+ CYCategory(CYIdentifier *name, CYMessage *messages) :
name_(name),
messages_(messages)
{
};
struct CYSend :
- CYExpression
+ CYTarget
{
CYArgument *arguments_;
{
}
- virtual CYExpression *Replace(CYContext &context);
+ virtual CYTarget *Replace(CYContext &context);
virtual void Output(CYOutput &out, CYFlags flags) const;
};
{
}
- virtual CYExpression *Replace(CYContext &context);
+ virtual CYTarget *Replace(CYContext &context);
virtual void Output(CYOutput &out, CYFlags flags) const;
};