summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/Makefile.am5
-rw-r--r--src/main/Makefile.in14
-rw-r--r--src/main/main.cpp18
3 files changed, 32 insertions, 5 deletions
diff --git a/src/main/Makefile.am b/src/main/Makefile.am
index 0992a434a..6b8ea928c 100644
--- a/src/main/Makefile.am
+++ b/src/main/Makefile.am
@@ -7,7 +7,10 @@ bin_PROGRAMS = cvc4
cvc4_SOURCES = \
main.cpp \
getopt.cpp \
- util.cpp
+ util.cpp \
+ main.h \
+ usage.h \
+ about.h
cvc4_LDADD = \
../parser/libcvc4parser.la \
diff --git a/src/main/Makefile.in b/src/main/Makefile.in
index 2df8a3368..6498610be 100644
--- a/src/main/Makefile.in
+++ b/src/main/Makefile.in
@@ -69,6 +69,15 @@ CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
SOURCES = $(cvc4_SOURCES)
DIST_SOURCES = $(cvc4_SOURCES)
ETAGS = etags
@@ -214,7 +223,10 @@ AM_CPPFLAGS =
cvc4_SOURCES = \
main.cpp \
getopt.cpp \
- util.cpp
+ util.cpp \
+ main.h \
+ usage.h \
+ about.h
cvc4_LDADD = \
../parser/libcvc4parser.la \
diff --git a/src/main/main.cpp b/src/main/main.cpp
index 8b59e6013..d9d3988f1 100644
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -84,16 +84,26 @@ int main(int argc, char *argv[]) {
Warning.setStream(CVC4::null_os);
}
- const char* fname = inputFromStdin ? argv[firstArgIndex] : "stdin";
+ const char* fname;
+ istream* in;
+ ifstream* file;
+ if(inputFromStdin) {
+ fname = "stdin";
+ in = &cin;
+ } else {
+ fname = argv[firstArgIndex];
+ file = new ifstream(fname);
+ in = file;
+ }
// Create the parser
Parser* parser;
switch(options.lang) {
case Options::LANG_SMTLIB:
- parser = new SmtParser(&exprMgr, cin, fname);
+ parser = new SmtParser(&exprMgr, *in, fname);
break;
case Options::LANG_CVC4:
- parser = new CvcParser(&exprMgr, cin, fname);
+ parser = new CvcParser(&exprMgr, *in, fname);
break;
case Options::LANG_AUTO:
cerr << "Auto language detection not supported yet." << endl;
@@ -117,6 +127,8 @@ int main(int argc, char *argv[]) {
// Remove the parser
delete parser;
+
+ delete file;
} catch(OptionException& e) {
if(options.smtcomp_mode)
cout << "unknown" << endl;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback