Added trivial standard library and search paths.

This commit is contained in:
Nathan Braswell
2014-05-01 01:18:01 -04:00
parent 1997ba49d2
commit 6a75832b59
6 changed files with 60 additions and 5 deletions

View File

@@ -1,8 +1,9 @@
#include "Importer.h"
Importer::Importer(Parser* parserIn) {
Importer::Importer(Parser* parserIn, std::vector<std::string> includePaths) {
//constructor
parser = parserIn;
this->includePaths = includePaths;
removeSymbols.push_back(Symbol("WS", false));
removeSymbols.push_back(Symbol("\\(", true));
@@ -47,7 +48,11 @@ NodeTree<ASTData>* Importer::import(std::string fileName) {
std::string outputName = fileName + "out";
programInFile.open(fileName);
for (auto i : includePaths) {
programInFile.open(i+fileName);
if (programInFile.is_open())
break;
}
if (!programInFile.is_open()) {
std::cout << "Problem opening programInFile " << fileName << "\n";
return NULL;