abouttreesummaryrefslogcommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Schönberger2021-08-11 17:18:26 +0200
committerPatrick Schönberger2021-08-11 17:18:26 +0200
commit3715a3f575b615f66e8ea7e57f83849e8bae4deb (patch)
tree58b7d31e766e937f51ee7f5b6c9211038e9e242f /src
parentb9322dfb8efe37f6f88a899269bdf21015f4db9a (diff)
downloadtoc-3715a3f575b615f66e8ea7e57f83849e8bae4deb.tar.gz
toc-3715a3f575b615f66e8ea7e57f83849e8bae4deb.zip
example and todo
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp6
-rw-r--r--src/repr.h6
2 files changed, 5 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e7c03e6..3523cdf 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,8 +31,7 @@ int main(int argc, const char * argv[])
return 1;
}
- std::string s = tree->toStringTree(&parser) + "\n";
-
+ //std::string s = tree->toStringTree(&parser) + "\n";
//std::cout << "Parse Tree: " << s << std::endl;
Program prg = getProgram(prog, nullptr);
@@ -41,9 +40,6 @@ int main(int argc, const char * argv[])
{
tocProgram(std::cout, prg);
- // if (!checkProgram(prg))
- // std::cerr << "Error" << std::endl;
-
std::ofstream ofs("output.c");
tocProgram(ofs, prg);
ofs.close();
diff --git a/src/repr.h b/src/repr.h
index b30aecd..ff54f97 100644
--- a/src/repr.h
+++ b/src/repr.h
@@ -79,11 +79,13 @@ struct Body
struct Function
{
std::string name;
- std::vector<std::string> genericTypeNames;
- std::vector<std::vector<Type>> genericInstantiations;
Type returnType;
std::vector<Variable> parameters;
bool defined;
+
+ std::vector<std::string> genericTypeNames;
+ std::vector<std::vector<Type>> genericInstantiations;
+
Body body;
};