Got the new scoping working! Still some odd stuff happening to certian templates, and I think vector is having problems with new/traits. Really need to get canonnical filenames and what not worked out

This commit is contained in:
Nathan Braswell
2014-12-30 01:22:09 -05:00
parent 417e5ed898
commit aaca71a211
35 changed files with 282 additions and 232 deletions

View File

@@ -4,6 +4,8 @@
#include <string>
#include <iostream>
#include <fstream>
#include <utility>
#include <sys/stat.h>
#include "NodeTree.h"
#include "ASTData.h"
@@ -12,6 +14,7 @@
#include "util.h"
#include "Poset.h"
// Note the use of std::pair to hold two strings - the running string for the header file and the running string for the c file.
class CGenerator {
public:
@@ -19,12 +22,16 @@ class CGenerator {
~CGenerator();
void generateCompSet(std::map<std::string, NodeTree<ASTData>*> ASTs, std::string outputName);
std::string generateClassStruct(NodeTree<ASTData>* from);
bool isUnderTranslationUnit(NodeTree<ASTData>* from, NodeTree<ASTData>* typeDefinition);
NodeTree<ASTData>* highestScope(NodeTree<ASTData>* node);
std::pair<std::string, std::string> generateTranslationUnit(NodeTree<ASTData>* from);
std::string generate(NodeTree<ASTData>* from, NodeTree<ASTData>* enclosingObject = NULL);
std::string generateAliasChains(NodeTree<ASTData>* scopeNode, NodeTree<ASTData>* definition);
static std::string ValueTypeToCType(Type *type);
static std::string ValueTypeToCTypeDecoration(Type *type);
static std::string ValueTypeToCTypeThingHelper(Type *type, std::string ptrStr);
static std::string CifyName(std::string name);
std::string generateObjectMethod(NodeTree<ASTData>* enclosingObject, NodeTree<ASTData>* from, std::string *functionPrototype);
std::string generateObjectMethod(NodeTree<ASTData>* enclosingObject, NodeTree<ASTData>* from, std::string *functionPrototype);
NodeTree<ASTData>* getMethodsObjectType(NodeTree<ASTData>* scope, std::string functionName);
std::string generatorString;
private: