summaryrefslogtreecommitdiff
path: root/src/parser/smt/smt_parser.h
blob: 21c278a376b45aa855c31e16a6a65af8c7ec8d35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*********************                                           -*- C++ -*-  */
/** smt_parser.h
 ** Original author: mdeters
 ** Major contributors: none
 ** Minor contributors (to current version): cconway, dejan
 ** This file is part of the CVC4 prototype.
 ** Copyright (c) 2009 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
 ** information.
 **
 ** SMT-LIB language parser abstraction.
 **/

#ifndef __CVC4__PARSER__SMT_PARSER_H
#define __CVC4__PARSER__SMT_PARSER_H

#include <string>
#include <iostream>
#include <fstream>
#include "cvc4_config.h"
#include "parser/parser_exception.h"
#include "parser/parser.h"

namespace CVC4 {
namespace parser {

/**
 * The SMT parser.
 */
class CVC4_PUBLIC SmtParser : public Parser {

public:

  /**
   * Construct the parser that uses the given expression manager and input stream.
   * @param em the expression manager to use
   * @param input the input stream to parse
   * @param file_name the name of the file (for diagnostic output)
   */
  SmtParser(ExprManager* em, std::istream& input, const char* file_name = "");

  /**
   * Destructor.
   */
  ~SmtParser();

  /**
   * Parses the next command. By default, the SMT-LIB parser produces
   * one CommandSequence command. If parsing is successful, we should
   * be done after the first call to this command.
   * @return the CommandSequence command that includes the whole
   * benchmark
   */
  Command* parseNextCommand() throw(ParserException);

  /**
   * Parses the next complete expression of the stream.
   * @return the expression parsed
   */
  Expr parseNextExpression() throw(ParserException);

protected:

  /** The ANTLR smt lexer */
  AntlrSmtLexer* d_antlr_lexer;

  /** The ANTLR smt parser */
  AntlrSmtParser* d_antlr_parser;

  /** The file stream we might be using */
  std::istream& d_input;
};

}/* CVC4::parser namespace */
}/* CVC4 namespace */

#endif /* __CVC4__PARSER__SMT_PARSER_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback