abouttreesummaryrefslogcommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPatrick Schönberger2021-08-02 14:43:11 +0200
committerPatrick Schönberger2021-08-02 14:43:11 +0200
commit8aeae09e74b46ca52866f22b48f55fecdf27b849 (patch)
treec129a883278585a2fdfbab6bea7d47d9df1bcee2 /src/main.cpp
parent9f5457a18f551d261e4bd380ea16a52dc5b04cf9 (diff)
downloadtoc-8aeae09e74b46ca52866f22b48f55fecdf27b849.tar.gz
toc-8aeae09e74b46ca52866f22b48f55fecdf27b849.zip
type modifiers, parenthesized expressions, chained access expressions
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7d8d5c7..199f04d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -7,6 +7,7 @@
#include "toc.h"
#include "repr.h"
#include "repr_get.h"
+#include "check.h"
using namespace antlr4;
@@ -33,15 +34,12 @@ int main(int argc, const char * argv[]) {
//std::cout << "Parse Tree: " << s << std::endl;
Program prg = getProgram(prog);
- std::cout << "Variables:\n";
- for (auto v : prg.variables)
- std::cout << " " << v.name << endl;
- std::cout << "Functions:\n";
- for (auto f : prg.functions)
- std::cout << " " << f.name << endl;
tocProgram(std::cout, prg);
+ if (!checkProgram(prg))
+ std::cerr << "Error" << std::endl;
+
//std::ofstream ofs("output.c");
//tocProg(ofs, prg);
//ofs.close();