summaryrefslogtreecommitdiff
path: root/src/parser/parser.cpp
blob: 89276872c37ed90ae9d50239dae2af84b8707ef2 (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
/*********************                                           -*- C++ -*-  */
/** parser.cpp
 ** 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.
 **
 ** Parser implementation.
 **/

#include <iostream>

#include "parser/parser.h"
#include "util/command.h"
#include "util/assert.h"
#include "parser/parser_state.h"
#include "parser/parser_exception.h"

int CVC4_PUBLIC smtlibparse();
int CVC4_PUBLIC PLparse();
extern "C" int smtlibdebug, PLdebug;

using namespace std;
using namespace CVC4;

namespace CVC4 {
namespace parser {

ParserState CVC4_PUBLIC *_global_parser_state = 0;

bool Parser::done() const {
  return _global_parser_state->done();
}

Command* Parser::parseNextCommand(bool verbose) {
  switch(d_lang) {
  case PL:
    PLdebug = verbose;
    PLparse();
    cout << "getting command" << endl;
    return _global_parser_state->getCommand();
  case SMTLIB:
    smtlibdebug = verbose;
    smtlibparse();
    return _global_parser_state->getCommand();
  default:
    Unhandled();
  }
  return new EmptyCommand;
}

Parser::~Parser() {
  //delete d_data;
}

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

generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback