-/* 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 {{{ */
virtual void Output(CYOutput &out) const;
};
+struct CYTypeInt128 :
+ CYTypeSpecifier
+{
+ CYTypeSigning signing_;
+
+ CYTypeInt128(CYTypeSigning signing) :
+ signing_(signing)
+ {
+ }
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out) const;
+};
+
struct CYTypeIntegral :
CYTypeSpecifier
{
virtual void Output(CYOutput &out) const;
};
+enum CYTypeReferenceKind {
+ CYTypeReferenceStruct,
+ CYTypeReferenceEnum,
+};
+
struct CYTypeReference :
CYTypeSpecifier
{
+ CYTypeReferenceKind kind_;
CYIdentifier *name_;
- CYTypeReference(CYIdentifier *name) :
+ CYTypeReference(CYTypeReferenceKind kind, CYIdentifier *name) :
+ kind_(kind),
name_(name)
{
}
CYTarget *Replace(CYContext &context, CYTarget *type);
virtual void Output(CYOutput &out, CYIdentifier *identifier) const = 0;
- void Output(CYOutput &out, int precedence, CYIdentifier *identifier) const;
+ void Output(CYOutput &out, int precedence, CYIdentifier *identifier, bool space) const;
virtual CYTypeFunctionWith *Function() { return NULL; }
};
{
CYTypedIdentifier *typed_;
- CYTypedParameter(CYTypedIdentifier *typed, CYTypedParameter *next) :
+ CYTypedParameter(CYTypedIdentifier *typed, CYTypedParameter *next = NULL) :
CYNext<CYTypedParameter>(next),
typed_(typed)
{
virtual void Output(CYOutput &out, CYFlags flags) const;
};
-struct CYExternal :
+struct CYExternalExpression :
+ CYTarget
+{
+ CYString *abi_;
+ CYTypedIdentifier *typed_;
+
+ CYExternalExpression(CYString *abi, CYTypedIdentifier *typed) :
+ abi_(abi),
+ typed_(typed)
+ {
+ }
+
+ CYPrecedence(0)
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
+struct CYExternalDefinition :
CYStatement
{
CYString *abi_;
CYTypedIdentifier *typed_;
- CYExternal(CYString *abi, CYTypedIdentifier *typed) :
+ CYExternalDefinition(CYString *abi, CYTypedIdentifier *typed) :
abi_(abi),
typed_(typed)
{
virtual void Output(CYOutput &out, CYFlags flags) const;
};
+struct CYEnumConstant :
+ CYNext<CYEnumConstant>
+{
+ CYIdentifier *name_;
+ CYNumber *value_;
+
+ CYEnumConstant(CYIdentifier *name, CYNumber *value, CYEnumConstant *next = NULL) :
+ CYNext<CYEnumConstant>(next),
+ name_(name),
+ value_(value)
+ {
+ }
+};
+
+struct CYTypeEnum :
+ CYTypeSpecifier
+{
+ CYIdentifier *name_;
+ CYTypeSpecifier *specifier_;
+ CYEnumConstant *constants_;
+
+ CYTypeEnum(CYIdentifier *name, CYTypeSpecifier *specifier, CYEnumConstant *constants) :
+ name_(name),
+ specifier_(specifier),
+ constants_(constants)
+ {
+ }
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out) const;
+};
+
namespace cy {
namespace Syntax {