X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/7c6c5b0ab3404f7de369679744f76f78913876c3..64b8d29fad73d4dee83b8f0a9f35f30d9cc72846:/ObjectiveC/Syntax.hpp diff --git a/ObjectiveC/Syntax.hpp b/ObjectiveC/Syntax.hpp index 39695d0..d8f57ec 100644 --- a/ObjectiveC/Syntax.hpp +++ b/ObjectiveC/Syntax.hpp @@ -49,7 +49,7 @@ struct CYSelectorPart : CYWord *name_; bool value_; - CYSelectorPart(CYWord *name, bool value, CYSelectorPart *next) : + CYSelectorPart(CYWord *name, bool value, CYSelectorPart *next = NULL) : CYNext(next), name_(name), value_(value) @@ -122,15 +122,33 @@ struct CYMessage : void Output(CYOutput &out, bool replace) const; }; +struct CYProtocol : + CYNext, + CYThing +{ + CYExpression *name_; + + CYProtocol(CYExpression *name, CYProtocol *next = NULL) : + CYNext(next), + name_(name) + { + } + + CYStatement *Replace(CYContext &context) const; + void Output(CYOutput &out) const; +}; + struct CYClass { CYClassName *name_; CYExpression *super_; + CYProtocol *protocols_; CYField *fields_; CYMessage *messages_; - CYClass(CYClassName *name, CYExpression *super, CYField *fields, CYMessage *messages) : + CYClass(CYClassName *name, CYExpression *super, CYProtocol *protocols, CYField *fields, CYMessage *messages) : name_(name), super_(super), + protocols_(protocols), fields_(fields), messages_(messages) { @@ -147,8 +165,8 @@ struct CYClassExpression : CYClass, CYExpression { - CYClassExpression(CYClassName *name, CYExpression *super, CYField *fields, CYMessage *messages) : - CYClass(name, super, fields, messages) + CYClassExpression(CYClassName *name, CYExpression *super, CYProtocol *protocols, CYField *fields, CYMessage *messages) : + CYClass(name, super, protocols, fields, messages) { } @@ -162,8 +180,8 @@ struct CYClassStatement : CYClass, CYStatement { - CYClassStatement(CYClassName *name, CYExpression *super, CYField *fields, CYMessage *messages) : - CYClass(name, super, fields, messages) + CYClassStatement(CYClassName *name, CYExpression *super, CYProtocol *protocols, CYField *fields, CYMessage *messages) : + CYClass(name, super, protocols, fields, messages) { }