Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

uesqlc.cc

00001 /*
00002 *  Name:         uesqlc.cc
00003 *  Author:       Rafael Jesus Alcantara Perez
00004 *  Summary:      UESQLC main
00005 *  Date:         $Date: 2003/10/06 13:21:36 $
00006 *  Revision:     $Revision: 1.17 $
00007 *  Description:  Compiler for UESQL language.
00008 *                UESQL is a subset of:
00009 *
00010 *                ISO/IEC 9075:1992, "Information Technology -- Database Languages -- SQL"
00011 *                ANSI X3.135-1992,  "Database Language SQL"
00012 *
00013 *  Copyright (C) 1996-2002  Rafael Jesus Alcantara Perez <rafa@dedalo-ing.com>
00014 *
00015 *  This program is free software; you can redistribute it and/or modify
00016 *  it under the terms of the GNU General Public License as published by
00017 *  the Free Software Foundation; either version 2 of the License, or
00018 *  (at your option) any later version.
00019 *
00020 *  This program is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  You should have received a copy of the GNU General Public License
00026 *  along with this program; if not, write to the Free Software
00027 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00028 *  MA 02111-1307, USA.
00029 */
00030 
00031 #include <clocale>
00032 #include "application.hh"
00033 
00034 
00035 //
00036 //  E X P O R T E D   V A R I A B L E S
00037 //
00038 
00040 TApplication*   ptApplication;
00041 
00042 
00044 int main (int argc, const char* argv[])
00045 {
00046 
00047   using std::cerr;
00048   using std::endl;
00049 
00050   int   iExitCode;
00051   
00052   std::setlocale (LC_ALL, "");
00053   try
00054   {
00055     ptApplication = new TApplication (PACKAGE, VERSION, argc, argv);
00056     ptApplication->initialize();
00057     iExitCode = ptApplication->start();
00058     delete ptApplication;
00059   }
00060   catch (const mpcl::util::prefs::TNotParameterAbleException& rktEXCEPTION)
00061   {
00062     //
00063     //  Exception:  Not parameter-able option.
00064     //
00065     iExitCode = 4;
00066     cerr << rktEXCEPTION.generalDescription();
00067     if ( !rktEXCEPTION.specificDescription().empty() )
00068     {
00069       cerr << " (--" << rktEXCEPTION.specificDescription() << ")";
00070     }
00071     cerr << endl;
00072     delete ptApplication;
00073   }
00074   catch (const mpcl::TException& rktEXCEPTION)
00075   {
00076     iExitCode = 3;
00077     cerr << rktEXCEPTION;
00078     delete ptApplication;
00079   }
00080   catch (const std::bad_alloc& rktEXCEPTION)
00081   {
00082     iExitCode = 2;
00083     cerr << rktEXCEPTION.what() << endl;
00084   }
00085   catch (const std::exception& rktEXCEPTION)
00086   {
00087     iExitCode = 2;
00088     cerr << rktEXCEPTION.what() << endl;
00089     delete ptApplication;
00090   }
00091   catch (...)
00092   {
00093     iExitCode = 1;
00094     cerr << mpcl::TException ("unhandled exception", NULL, __FILE__, __LINE__);
00095     delete ptApplication;
00096   }
00097   return iExitCode;
00098   
00099 }  // main()

Generated on Mon Oct 13 02:40:11 2003 for UESQLC by doxygen1.2.18