summaryrefslogtreecommitdiff
path: root/src/printer
diff options
context:
space:
mode:
authorTim King <taking@google.com>2015-12-30 11:45:37 -0800
committerTim King <taking@google.com>2015-12-30 11:45:37 -0800
commitfa7f30a4ba08afe066604daee87006b4fb5f21f7 (patch)
tree6eecac7cce64fa00f4ac5c18f023f1bc234435a3 /src/printer
parent1ce397129214a427a10ff3e33069e315fe13eec1 (diff)
Shuffling around public vs. private headers
- Adding a script contrib/test_install_headers.h that tests whether one can include all cvc4_public headers. CVC4 can pass this test after this commit. - Making lib/{clock_gettime.h,ffs.h,strtok_r.h} cvc4_private. - Making prop/sat_solver_factory.h cvc4_private. - Moving the expr iostream manipulators into their own files: expr_iomanip.{h,cpp}. - Setting the generated *_options.h files back to being cvc4_private. -- Removing the usage of options/expr_options.h from expr.h. -- Removing the include of base_options.h from options.h. - Cleaning up CPP macros in cvc4_public headers. -- Changing the ROLL macro in floatingpoint.h into an inline function. -- Removing the now unused flag -D__BUILDING_STATISTICS_FOR_EXPORT.
Diffstat (limited to 'src/printer')
-rw-r--r--src/printer/printer.cpp26
-rw-r--r--src/printer/printer.h24
2 files changed, 27 insertions, 23 deletions
diff --git a/src/printer/printer.cpp b/src/printer/printer.cpp
index 75d625edc..d4b99536e 100644
--- a/src/printer/printer.cpp
+++ b/src/printer/printer.cpp
@@ -17,6 +17,7 @@
#include <string>
+#include "options/base_options.h"
#include "options/language.h"
#include "printer/ast/ast_printer.h"
#include "printer/cvc/cvc_printer.h"
@@ -87,4 +88,29 @@ void Printer::toStream(std::ostream& out, const UnsatCore& core, const std::map<
}
}/* Printer::toStream(UnsatCore, std::map<Expr, std::string>) */
+Printer* Printer::getPrinter(OutputLanguage lang) throw() {
+ if(lang == language::output::LANG_AUTO) {
+ // Infer the language to use for output.
+ //
+ // Options can be null in certain circumstances (e.g., when printing
+ // the singleton "null" expr. So we guard against segfault
+ if(not Options::isCurrentNull()) {
+ if(options::outputLanguage.wasSetByUser()) {
+ lang = options::outputLanguage();
+ }
+ if(lang == language::output::LANG_AUTO && options::inputLanguage.wasSetByUser()) {
+ lang = language::toOutputLanguage(options::inputLanguage());
+ }
+ }
+ if(lang == language::output::LANG_AUTO) {
+ lang = language::output::LANG_CVC4; // default
+ }
+ }
+ if(d_printers[lang] == NULL) {
+ d_printers[lang] = makePrinter(lang);
+ }
+ return d_printers[lang];
+}
+
+
}/* CVC4 namespace */
diff --git a/src/printer/printer.h b/src/printer/printer.h
index 30d33d46b..48787f70a 100644
--- a/src/printer/printer.h
+++ b/src/printer/printer.h
@@ -56,29 +56,7 @@ protected:
public:
/** Get the Printer for a given OutputLanguage */
- static Printer* getPrinter(OutputLanguage lang) throw() {
- if(lang == language::output::LANG_AUTO) {
- // Infer the language to use for output.
- //
- // Options can be null in certain circumstances (e.g., when printing
- // the singleton "null" expr. So we guard against segfault
- if(not Options::isCurrentNull()) {
- if(options::outputLanguage.wasSetByUser()) {
- lang = options::outputLanguage();
- }
- if(lang == language::output::LANG_AUTO && options::inputLanguage.wasSetByUser()) {
- lang = language::toOutputLanguage(options::inputLanguage());
- }
- }
- if(lang == language::output::LANG_AUTO) {
- lang = language::output::LANG_CVC4; // default
- }
- }
- if(d_printers[lang] == NULL) {
- d_printers[lang] = makePrinter(lang);
- }
- return d_printers[lang];
- }
+ static Printer* getPrinter(OutputLanguage lang) throw();
/** Write a Node out to a stream with this Printer. */
virtual void toStream(std::ostream& out, TNode n,
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback