summaryrefslogtreecommitdiff
path: root/src/util/language.h
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2011-04-20 07:57:28 +0000
committerMorgan Deters <mdeters@gmail.com>2011-04-20 07:57:28 +0000
commitce04216289985021ce53588e3040e2ac9d6a2a0d (patch)
treea2106cad04287c5b739df99e209e3a600ebf50c5 /src/util/language.h
parent12c1e41862e4b12c3953272416a1edc103d299ee (diff)
Minor mixed-bag commit. Expected performance impact negligible.
* Fixed hole in arrays typechecking. * Fixed "make dist". * Better ouroborous test, and some printer fixes. * Continued cleanup in CVC parser, removed some warnings. * Better output.
Diffstat (limited to 'src/util/language.h')
-rw-r--r--src/util/language.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/util/language.h b/src/util/language.h
index fdd2a382d..814f8dcd1 100644
--- a/src/util/language.h
+++ b/src/util/language.h
@@ -5,7 +5,7 @@
** Major contributors: none
** Minor contributors (to current version): none
** This file is part of the CVC4 prototype.
- ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys)
+ ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys)
** Courant Institute of Mathematical Sciences
** New York University
** See the file COPYING in the top-level source directory for licensing
@@ -138,12 +138,29 @@ typedef language::output::Language OutputLanguage;
namespace language {
+inline InputLanguage toInputLanguage(OutputLanguage language) {
+ switch(language) {
+ case output::LANG_SMTLIB:
+ case output::LANG_SMTLIB_V2:
+ case output::LANG_CVC4:
+ // these entries directly correspond (by design)
+ return InputLanguage(int(language));
+
+ default: {
+ std::stringstream ss;
+ ss << "Cannot map output language `" << language
+ << "' to an input language.";
+ throw CVC4::Exception(ss.str());
+ }
+ }/* switch(language) */
+}/* toInputLanguage() */
+
inline OutputLanguage toOutputLanguage(InputLanguage language) {
switch(language) {
case input::LANG_SMTLIB:
case input::LANG_SMTLIB_V2:
case input::LANG_CVC4:
- // these entries correspond
+ // these entries directly correspond (by design)
return OutputLanguage(int(language));
default: {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback