X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/5b4dabb2071e2e09cd70a156beed03b12bec477a..refs/heads/master:/Syntax.hpp diff --git a/Syntax.hpp b/Syntax.hpp index 5f9d705..4b25b30 100644 --- a/Syntax.hpp +++ b/Syntax.hpp @@ -40,7 +40,14 @@ double CYCastDouble(const char *value); double CYCastDouble(CYUTF8String value); void CYNumerify(std::ostringstream &str, double value); -void CYStringify(std::ostringstream &str, const char *data, size_t size, bool c = false); + +enum CYStringifyMode { + CYStringifyModeLegacy, + CYStringifyModeCycript, + CYStringifyModeNative, +}; + +void CYStringify(std::ostringstream &str, const char *data, size_t size, CYStringifyMode mode); // XXX: this really should not be here ... :/ void *CYPoolFile(CYPool &pool, const char *path, size_t *psize); @@ -121,6 +128,7 @@ struct CYOutput { struct CYExpression; struct CYAssignment; struct CYIdentifier; +struct CYNumber; struct CYPropertyName { virtual bool Computed() const { @@ -135,6 +143,10 @@ struct CYPropertyName { return NULL; } + virtual CYNumber *Number(CYContext &context) { + return NULL; + } + virtual CYExpression *PropertyName(CYContext &context) = 0; virtual void PropertyName(CYOutput &out) const = 0; }; @@ -834,6 +846,8 @@ struct CYTemplate : CYPrecedence(0) + virtual CYString *String(CYContext &context); + virtual CYTarget *Replace(CYContext &context); virtual void Output(CYOutput &out, CYFlags flags) const; }; @@ -1467,6 +1481,20 @@ struct CYDirectMember : virtual void Output(CYOutput &out, CYFlags flags) const; }; +struct CYAttemptMember : + CYMember +{ + CYAttemptMember(CYExpression *object, CYExpression *property) : + CYMember(object, property) + { + } + + CYPrecedence(1) + + virtual CYTarget *Replace(CYContext &context); + virtual void Output(CYOutput &out, CYFlags flags) const; +}; + struct CYIndirectMember : CYMember { @@ -2140,6 +2168,20 @@ struct CYTypeIntegral : virtual void Output(CYOutput &out) const; }; +struct CYTypeFloating : + CYTypeSpecifier +{ + int length_; + + CYTypeFloating(int length) : + length_(length) + { + } + + virtual CYTarget *Replace(CYContext &context); + virtual void Output(CYOutput &out) const; +}; + struct CYTypeVoid : CYTypeSpecifier {