27b20734248d71bd257b9e09d6ea8e5263764123
1 /********************* */
4 ** Original author: dejan
5 ** Major contributors: mdeters, cconway
6 ** Minor contributors (to current version): none
7 ** This file is part of the CVC4 prototype.
8 ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys)
9 ** Courant Institute of Mathematical Sciences
10 ** New York University
11 ** See the file COPYING in the top-level source directory for licensing
12 ** information.\endverbatim
14 ** \brief A super-class for input language parsers.
16 ** A super-class for input language parsers
20 #include "parser_exception.h"
23 #include "expr/command.h"
24 #include "expr/type.h"
25 #include "parser/antlr_input.h"
26 #include "util/output.h"
27 #include "util/Assert.h"
31 using namespace CVC4::parser
;
32 using namespace CVC4::kind
;
37 InputStreamException::InputStreamException(const std::string
& msg
) :
41 const std::string
InputStream::getName() const {
45 Input::Input(InputStream
& inputStream
) :
46 d_inputStream( &inputStream
) {
53 InputStream
*Input::getInputStream() {
57 Input
* Input::newFileInput(InputLanguage lang
,
58 const std::string
& filename
,
60 throw (InputStreamException
, AssertionException
) {
61 AntlrInputStream
*inputStream
=
62 AntlrInputStream::newFileInputStream(filename
,useMmap
);
63 return AntlrInput::newInput(lang
,*inputStream
);
66 Input
* Input::newStreamInput(InputLanguage lang
,
68 const std::string
& name
)
69 throw (InputStreamException
, AssertionException
) {
70 AntlrInputStream
*inputStream
=
71 AntlrInputStream::newStreamInputStream(input
,name
);
72 return AntlrInput::newInput(lang
,*inputStream
);
75 Input
* Input::newStringInput(InputLanguage lang
,
76 const std::string
& str
,
77 const std::string
& name
)
78 throw (InputStreamException
, AssertionException
) {
79 AntlrInputStream
*inputStream
= AntlrInputStream::newStringInputStream(str
,name
);
80 return AntlrInput::newInput(lang
,*inputStream
);
83 }/* CVC4::parser namespace */