]> gitweb.ps.run Git - toc/blobdiff - src/main.cpp
type modifiers, parenthesized expressions, chained access expressions
[toc] / src / main.cpp
index 7d8d5c7f8467db121a9d55f20d2e9eb9122cc6ec..199f04d926ac5ece5115a7556c3a074ebed96e92 100644 (file)
@@ -7,6 +7,7 @@
 #include "toc.h"\r
 #include "repr.h"\r
 #include "repr_get.h"\r
 #include "toc.h"\r
 #include "repr.h"\r
 #include "repr_get.h"\r
+#include "check.h"\r
 \r
 using namespace antlr4;\r
 \r
 \r
 using namespace antlr4;\r
 \r
@@ -33,15 +34,12 @@ int main(int argc, const char * argv[]) {
   //std::cout << "Parse Tree: " << s << std::endl;\r
 \r
   Program prg = getProgram(prog);\r
   //std::cout << "Parse Tree: " << s << std::endl;\r
 \r
   Program prg = getProgram(prog);\r
-  std::cout << "Variables:\n";\r
-  for (auto v : prg.variables)\r
-    std::cout << " " << v.name << endl;\r
-  std::cout << "Functions:\n";\r
-  for (auto f : prg.functions)\r
-    std::cout << " " << f.name << endl;\r
 \r
   tocProgram(std::cout, prg);\r
 \r
 \r
   tocProgram(std::cout, prg);\r
 \r
+  if (!checkProgram(prg))\r
+    std::cerr << "Error" << std::endl;\r
+\r
   //std::ofstream ofs("output.c");\r
   //tocProg(ofs, prg);\r
   //ofs.close();\r
   //std::ofstream ofs("output.c");\r
   //tocProg(ofs, prg);\r
   //ofs.close();\r