main.cc
changeset 181 38d6eb056260
parent 179 a4eb4fd6b0d6
child 186 f0a41f731cea
--- a/main.cc	Sat May 30 16:42:41 2009 +0200
+++ b/main.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -78,7 +78,7 @@
 
 
 #include "stage1_2/stage1_2.hh"
-#include "search_utils/search_utils.hh"
+#include "absyntax_utils/absyntax_utils.hh"
 
 //int stage3(symbol_c *tree_root);
 int stage4(symbol_c *tree_root, const char *builddir);
@@ -110,6 +110,9 @@
   extern int optind, optopt;
 */
 
+  /******************************************/
+  /*   Parse command line options...        */
+  /******************************************/
   while ((optres = getopt(argc, argv, ":hfsI:T:")) != -1) {
     switch(optres) {
     case 'h':
@@ -133,8 +136,11 @@
       errflg++;
       break;
     case '?':
+      fprintf(stderr, "Unrecognized option: -%c\n", optopt);
+      errflg++;
+      break;
     default:
-      fprintf(stderr, "Unrecognized option: -%c\n", optopt);
+      fprintf(stderr, "Unknown error while parsing command line options.");
       errflg++;
       break;
     }
@@ -156,14 +162,15 @@
   }
 
 
+  /***************************/
+  /*   Run the compiler...   */
+  /***************************/
   /* 1st Pass */
   if (stage1_2(argv[optind], &tree_root, stage1_2_options) < 0)
     return EXIT_FAILURE;
 
   /* 2nd Pass */
-printf("loading symbol tables...\n");
-  search_utils_init(tree_root);
-printf("loading symbol tables... DONE!\n");
+  absyntax_utils_init(tree_root);
   /* not yet implemented... */
   /*
   if (stage3(tree_root) < 0)