Changed regex to reference count internal structure instead of cloning because it too way too long. Added terminal decorators to grammer and lexer

This commit is contained in:
Nathan Braswell
2015-07-08 13:43:06 -04:00
parent f3cdea068e
commit 07e54f67fb
6 changed files with 56 additions and 19 deletions

View File

@@ -1099,6 +1099,7 @@ NodeTree<ASTData>* ASTTransformation::templateClassLookup(NodeTree<ASTData>* sco
}
if (!mostFittingTemplates.size()) {
std::cout << "No template classes fit for " << lookup << "!" << std::endl;
std::cerr << "in file " << getUpperTranslationUnit(scope)->getDataRef()->symbol.getName() << std::endl;
throw "No matching template classes";
} else if (mostFittingTemplates.size() > 1) {
std::cout << "Multiple template classes fit with equal number of traits satisfied for " << lookup << "!" << std::endl;
@@ -1304,6 +1305,7 @@ NodeTree<ASTData>* ASTTransformation::templateFunctionLookup(NodeTree<ASTData>*
for (auto t : types)
std::cerr << t.toString() + ", ";
std::cerr << ")!" << std::endl;
std::cerr << "in file " << getUpperTranslationUnit(scope)->getDataRef()->symbol.getName() << std::endl;
throw "No matching template functions";
} else if (mostFittingTemplates.size() > 1) {
std::cerr << "Multiple template functions fit with equal number of traits satisfied for " << lookup << "!" << std::endl;

View File

@@ -652,7 +652,7 @@ CCodeTriple CGenerator::generate(NodeTree<ASTData>* from, NodeTree<ASTData>* enc
if (unaliasedTypeDef) { //Test to see if the function's a member of this type_def, or if this is an alias, of the original type. Get this original type if it exists.
std::string nameDecoration;
std::vector<NodeTree<ASTData>*> functionDefChildren = children[2]->getChildren(); //The function def is the rhs of the access operation
std::cout << "Decorating (in access-should be object) " << name << " " << functionDefChildren.size() << std::endl;
//std::cout << "Decorating (in access-should be object) " << name << " " << functionDefChildren.size() << std::endl;
for (int i = 0; i < (functionDefChildren.size() > 0 ? functionDefChildren.size()-1 : 0); i++)
nameDecoration += "_" + ValueTypeToCTypeDecoration(functionDefChildren[i]->getData().valueType);
// Note that we only add scoping to the object, as this specifies our member function too
@@ -680,7 +680,7 @@ CCodeTriple CGenerator::generate(NodeTree<ASTData>* from, NodeTree<ASTData>* enc
} else {
//It's a normal function call, not a special one or a method or anything. Name decorate.
std::vector<NodeTree<ASTData>*> functionDefChildren = children[0]->getChildren();
std::cout << "Decorating (none-special)" << name << " " << functionDefChildren.size() << std::endl;
//std::cout << "Decorating (none-special)" << name << " " << functionDefChildren.size() << std::endl;
std::string nameDecoration;
for (int i = 0; i < (functionDefChildren.size() > 0 ? functionDefChildren.size()-1 : 0); i++)
nameDecoration += "_" + ValueTypeToCTypeDecoration(functionDefChildren[i]->getData().valueType);