2013-11-01 02:52:18 -04:00
|
|
|
#ifndef CGENERATOR_H
|
|
|
|
|
#define CGENERATOR_H
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <iostream>
|
2014-01-01 17:29:19 -06:00
|
|
|
#include <fstream>
|
2013-11-01 02:52:18 -04:00
|
|
|
|
|
|
|
|
#include "NodeTree.h"
|
|
|
|
|
#include "ASTData.h"
|
2013-12-23 01:26:24 -06:00
|
|
|
#include "Type.h"
|
2013-11-01 02:52:18 -04:00
|
|
|
|
2013-12-19 10:39:36 -06:00
|
|
|
#include "util.h"
|
2014-05-21 13:14:16 -04:00
|
|
|
#include "Poset.h"
|
2013-12-19 10:39:36 -06:00
|
|
|
|
2013-11-01 02:52:18 -04:00
|
|
|
|
|
|
|
|
class CGenerator {
|
|
|
|
|
public:
|
|
|
|
|
CGenerator();
|
|
|
|
|
~CGenerator();
|
2014-01-01 17:29:19 -06:00
|
|
|
void generateCompSet(std::map<std::string, NodeTree<ASTData>*> ASTs, std::string outputName);
|
2014-02-03 11:41:25 -05:00
|
|
|
std::string generate(NodeTree<ASTData>* from, NodeTree<ASTData>* enclosingObject = NULL);
|
2014-01-07 13:14:58 -05:00
|
|
|
static std::string ValueTypeToCType(Type *type);
|
2014-03-06 13:13:40 -05:00
|
|
|
static std::string ValueTypeToCTypeDecoration(Type *type);
|
2014-05-10 19:28:36 -04:00
|
|
|
static std::string CifyName(std::string name);
|
2014-02-03 11:41:25 -05:00
|
|
|
std::string generateObjectMethod(NodeTree<ASTData>* enclosingObject, NodeTree<ASTData>* from);
|
2014-06-10 23:59:39 -07:00
|
|
|
NodeTree<ASTData>* getMethodsObjectType(NodeTree<ASTData>* scope, std::string functionName);
|
2013-12-22 01:34:59 -06:00
|
|
|
std::string generatorString;
|
2013-11-01 02:52:18 -04:00
|
|
|
private:
|
|
|
|
|
std::string tabs();
|
|
|
|
|
int tabLevel;
|
|
|
|
|
};
|
2014-06-10 23:59:39 -07:00
|
|
|
#endif
|