summaryrefslogtreecommitdiff
path: root/src/parser/smt/smt_input.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/smt/smt_input.h')
-rw-r--r--src/parser/smt/smt_input.h46
1 files changed, 41 insertions, 5 deletions
diff --git a/src/parser/smt/smt_input.h b/src/parser/smt/smt_input.h
index b3613d67b..4795edc91 100644
--- a/src/parser/smt/smt_input.h
+++ b/src/parser/smt/smt_input.h
@@ -23,23 +23,59 @@ class ExprManager;
namespace parser {
class SmtInput : public AntlrInput {
+
+ /** The ANTLR3 SMT lexer for the input. */
+ pSmtLexer d_pSmtLexer;
+
+ /** The ANTLR3 CVC parser for the input. */
+ pSmtParser d_pSmtParser;
+
public:
+
+ /** Create a file input.
+ *
+ * @param exprManager the manager to use when building expressions from the input
+ * @param filename the path of the file to read
+ * @param useMmap <code>true</code> if the input should use memory-mapped
+ * I/O; otherwise, the input will use the standard ANTLR3 I/O implementation.
+ */
SmtInput(ExprManager* exprManager, const std::string& filename, bool useMmap);
+
+ /** Create a string input.
+ *
+ * @param exprManager the manager to use when building expressions from the input
+ * @param input the string to read
+ * @param name the "filename" to use when reporting errors
+ */
SmtInput(ExprManager* exprManager, const std::string& input, const std::string& name);
+
+ /* Destructor. Frees the lexer and the parser. */
~SmtInput();
protected:
+
+ /** Parse a command from the input. Returns <code>NULL</code> if there is
+ * no command there to parse.
+ *
+ * @throws ParserException if an error is encountered during parsing.
+ */
Command* doParseCommand() throw(ParserException);
+
+ /** Parse an expression from the input. Returns a null <code>Expr</code>
+ * if there is no expression there to parse.
+ *
+ * @throws ParserException if an error is encountered during parsing.
+ */
Expr doParseExpr() throw(ParserException);
- pANTLR3_LEXER getLexer();
- pANTLR3_LEXER createLexer(pANTLR3_INPUT_STREAM input);
- pANTLR3_PARSER createParser(pANTLR3_COMMON_TOKEN_STREAM tokenStream);
private:
+
+ /** Initialize the class. Called from the constructors once the input stream
+ * is initialized. */
void init();
- pSmtLexer d_pSmtLexer;
- pSmtParser d_pSmtParser;
+
}; // class SmtInput
+
} // namespace parser
} // namespace CVC4
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback