#include "Location.hpp"
#include "Options.hpp"
#include "Pooling.hpp"
+#include "String.hpp"
+
+double CYCastDouble(const char *value, size_t size);
+double CYCastDouble(const char *value);
+
+void CYNumerify(std::ostringstream &str, double value);
+void CYStringify(std::ostringstream &str, const char *data, size_t size, bool c = false);
struct CYContext;
{
CYExpression *value_;
- CYElementValue(CYExpression *value, CYElement *next) :
+ CYElementValue(CYExpression *value, CYElement *next = NULL) :
CYNext<CYElement>(next),
value_(value)
{
virtual void Output(CYOutput &out) const;
};
+struct CYTypeReference :
+ CYTypeSpecifier
+{
+ CYIdentifier *name_;
+
+ CYTypeReference(CYIdentifier *name) :
+ name_(name)
+ {
+ }
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out) const;
+};
+
struct CYTypeVariable :
CYTypeSpecifier
{
virtual void Output(CYOutput &out, CYFlags flags) const;
};
+struct CYImportSpecifier :
+ CYNext<CYImportSpecifier>
+{
+ CYWord *name_;
+ CYIdentifier *binding_;
+
+ CYImportSpecifier(CYWord *name, CYIdentifier *binding) :
+ name_(name),
+ binding_(binding)
+ {
+ }
+
+ CYStatement *Replace(CYContext &context, CYIdentifier *module);
+};
+
+struct CYImportDeclaration :
+ CYStatement
+{
+ CYImportSpecifier *specifiers_;
+ CYString *module_;
+
+ CYImportDeclaration(CYImportSpecifier *specifiers, CYString *module) :
+ specifiers_(specifiers),
+ module_(module)
+ {
+ }
+
+ CYCompact(None)
+
+ virtual CYStatement *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
struct CYExternal :
CYStatement
{
virtual void Output(CYOutput &out, CYFlags flags) const;
};
+struct CYTypeExpression :
+ CYTarget
+{
+ CYTypedIdentifier *typed_;
+
+ CYTypeExpression(CYTypedIdentifier *typed) :
+ typed_(typed)
+ {
+ }
+
+ CYPrecedence(0)
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
struct CYTypeDefinition :
CYStatement
{
virtual CYTypeFunctionWith *Function() { return this; }
};
+struct CYTypeStructField :
+ CYNext<CYTypeStructField>
+{
+ CYTypedIdentifier *typed_;
+
+ CYTypeStructField(CYTypedIdentifier *typed, CYTypeStructField *next = NULL) :
+ CYNext<CYTypeStructField>(next),
+ typed_(typed)
+ {
+ }
+};
+
+struct CYStructTail :
+ CYThing
+{
+ CYTypeStructField *fields_;
+
+ CYStructTail(CYTypeStructField *fields) :
+ fields_(fields)
+ {
+ }
+
+ CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out) const;
+};
+
+struct CYTypeStruct :
+ CYTypeSpecifier
+{
+ CYIdentifier *name_;
+ CYStructTail *tail_;
+
+ CYTypeStruct(CYIdentifier *name, CYStructTail *tail) :
+ name_(name),
+ tail_(tail)
+ {
+ }
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out) const;
+};
+
+struct CYStructDefinition :
+ CYStatement
+{
+ CYIdentifier *name_;
+ CYStructTail *tail_;
+
+ CYStructDefinition(CYIdentifier *name, CYStructTail *tail) :
+ name_(name),
+ tail_(tail)
+ {
+ }
+
+ CYCompact(None)
+
+ virtual CYStatement *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
namespace cy {
namespace Syntax {