00001 /*****************************************************************************/ 00002 /*! 00003 * \file lang.h 00004 * \brief Definition of input and output languages to CVCL 00005 * 00006 * Author: Mehul Trivedi 00007 * 00008 * Created: Thu Jul 29 11:56:34 2004 00009 * 00010 * <hr> 00011 * Copyright (C) 2004 by the Board of Trustees of Leland Stanford 00012 * Junior University and by New York University. 00013 * 00014 * License to use, copy, modify, sell and/or distribute this software 00015 * and its documentation for any purpose is hereby granted without 00016 * royalty, subject to the terms and conditions defined in the \ref 00017 * LICENSE file provided with this distribution. In particular: 00018 * 00019 * - The above copyright notice and this permission notice must appear 00020 * in all copies of the software and related documentation. 00021 * 00022 * - THE SOFTWARE IS PROVIDED "AS-IS", WITHOUT ANY WARRANTIES, 00023 * EXPRESSED OR IMPLIED. USE IT AT YOUR OWN RISK. 00024 * 00025 * <hr> 00026 * 00027 */ 00028 /*****************************************************************************/ 00029 00030 #ifndef _CVC_lite__lang_h_ 00031 #define _CVC_lite__lang_h_ 00032 00033 #include "debug.h" 00034 00035 namespace CVCL { 00036 00037 //! Different input languages 00038 typedef enum { 00039 //! Nice SAL-like language for manually written specs 00040 PRESENTATION_LANG, 00041 //! SMT-LIB format 00042 SMTLIB_LANG, 00043 //! Lisp-like format for automatically generated specs 00044 LISP_LANG, 00045 AST_LANG, 00046 /* @brief AST is only for printing the Expr abstract syntax tree in lisp 00047 format; there is no such input language <em>per se</em> */ 00048 } InputLanguage; 00049 00050 inline InputLanguage getLanguage(std::string& lang) { 00051 if(lang == "p") return PRESENTATION_LANG; 00052 if(lang == "s") return SMTLIB_LANG; 00053 if(lang == "l") return LISP_LANG; 00054 if(lang == "a") return AST_LANG; 00055 throw Exception("Bad input language specified"); 00056 return AST_LANG; 00057 } 00058 00059 } // end of namespace CVCL 00060 00061 #endif