/* $Id: main.cc,v 1.5 1997/07/30 17:46:16 isis Exp $ */ // $Log: main.cc,v $ // Revision 1.5 1997/07/30 17:46:16 isis // Some minor new features and bug fixes // This seems to work fine // // Revision 1.4 1997/06/22 14:48:46 isis // This is the initial version for // the generating functions module // // Revision 1.3 1997/06/01 13:23:12 isis // Parsing of const: // e.g const char const * const a; // Changed the internal represantation of '*' to support const qualifiers // // Revision 1.2 1997/05/25 15:12:27 isis // Bug fixes // mostly with sizeof operator // // Revision 1.1 1997/05/18 17:03:05 isis // Added main.cc to improve // the usage of the symbol table // #include #include #include #include #include #include #include #include "Cname.h" #include "symbol.h" #include "gc_stl.h" #include "h-fun.h" #include "gen.h" void segviol(int) { printf("Segmentation Violation at line %d\n",lineno); exit(-1); }; void flexc(int) { printf("Floating Exception at line %d\n",lineno); exit(-1); }; main() { // signal(SIGSEGV,segviol); // signal(SIGFPE,flexc); SymbolTable.SetErrorHandler(&ErrorHandler); SymbolTable.OpenScope("main"); //Insert built-in symbols (not required) SymbolTable.Insert(IntType); SymbolTable.Insert(CharType); SymbolTable.Insert(FloatType); SymbolTable.Insert(DoubleType); SymbolTable.Insert(VoidType); SymbolTable.Insert(EllipsisType); yyparse(); // cout << SymbolTable; // print_headers(cout,SymbolTable.GetCurrentScope()); generate_functions(cout,SymbolTable.GetCurrentScope()); SymbolTable.CloseScope(); }