X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/7085e1abd73d7405804870e2404d38c4d22ea73e..17e71f88011c8c04350d38e999ac9047152e7325:/ObjectiveC/Syntax.hpp?ds=sidebyside diff --git a/ObjectiveC/Syntax.hpp b/ObjectiveC/Syntax.hpp index aa55a42..f47d935 100644 --- a/ObjectiveC/Syntax.hpp +++ b/ObjectiveC/Syntax.hpp @@ -1,5 +1,5 @@ -/* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2015 Jay Freeman (saurik) +/* Cycript - The Truly Universal Scripting Language + * Copyright (C) 2009-2016 Jay Freeman (saurik) */ /* GNU Affero General Public License, Version 3 {{{ */ @@ -76,6 +76,52 @@ struct CYBox : 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 +{ + CYExpression *key_; + CYExpression *value_; + + CYObjCKeyValue(CYExpression *key, CYExpression *value, CYObjCKeyValue *next) : + CYNext(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 CYSelectorPart : CYNext, CYThing @@ -97,10 +143,10 @@ struct CYSelectorPart : struct CYSelector : CYLiteral { - CYSelectorPart *name_; + CYSelectorPart *parts_; - CYSelector(CYSelectorPart *name) : - name_(name) + CYSelector(CYSelectorPart *parts) : + parts_(parts) { } @@ -128,11 +174,12 @@ struct CYImplementationField : struct CYMessageParameter : CYNext { - CYWord *tag_; + CYWord *name_; CYTypedIdentifier *type_; - CYMessageParameter(CYWord *tag, CYTypedIdentifier *type) : - tag_(tag), + CYMessageParameter(CYWord *name, CYTypedIdentifier *type, CYMessageParameter *next = NULL) : + CYNext(next), + name_(name), type_(type) { } @@ -151,10 +198,10 @@ struct CYMessage : 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) { } @@ -185,14 +232,14 @@ struct CYImplementation : CYStatement { CYIdentifier *name_; - CYExpression *super_; + CYExpression *extends_; CYProtocol *protocols_; CYImplementationField *fields_; CYMessage *messages_; - CYImplementation(CYIdentifier *name, CYExpression *super, CYProtocol *protocols, CYImplementationField *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)