2013-12-23 01:26:24 -06:00
|
|
|
#ifndef TYPE_H
|
|
|
|
|
#define TYPE_H
|
|
|
|
|
|
|
|
|
|
#ifndef NULL
|
2014-03-06 13:13:40 -05:00
|
|
|
#define NULL ((void*)0)
|
2013-12-23 01:26:24 -06:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
2014-01-07 13:14:58 -05:00
|
|
|
//Circular dependency
|
|
|
|
|
class ASTData;
|
|
|
|
|
#include "ASTData.h"
|
2013-12-23 01:26:24 -06:00
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
|
|
enum ValueType {none, void_type, boolean, integer, floating, double_percision, character };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Type {
|
|
|
|
|
public:
|
|
|
|
|
Type();
|
|
|
|
|
Type(ValueType typeIn, int indirectionIn);
|
|
|
|
|
Type(ValueType typeIn);
|
2014-01-07 13:14:58 -05:00
|
|
|
Type(NodeTree<ASTData>* typeDefinitionIn);
|
|
|
|
|
Type(NodeTree<ASTData>* typeDefinitionIn, int indirectionIn);
|
|
|
|
|
Type(ValueType typeIn, NodeTree<ASTData>* typeDefinitionIn, int indirectionIn);
|
2013-12-23 01:26:24 -06:00
|
|
|
~Type();
|
2014-03-06 13:13:40 -05:00
|
|
|
bool const operator==(const Type &other)const;
|
|
|
|
|
bool const operator!=(const Type &other)const;
|
2014-05-05 13:52:12 -04:00
|
|
|
Type* clone();
|
2013-12-23 01:26:24 -06:00
|
|
|
std::string toString();
|
|
|
|
|
ValueType baseType;
|
2014-01-07 13:14:58 -05:00
|
|
|
NodeTree<ASTData>* typeDefinition;
|
2013-12-23 01:26:24 -06:00
|
|
|
int indirection;
|
|
|
|
|
private:
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|