summaryrefslogtreecommitdiff
path: root/src/parser/parser.cpp
blob: 42ff506fa9870f486ae0e2bad11d5833d9a01893 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*********************                                           -*- 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 "parser/parser.h"
#include "parser/parser_state.h"
#include "parser/parser_exception.h"
#include "parser/pl.hpp"
//#include "parser/smtlib.hpp"

// The communication entry points of the actual parsers

// for presentation language (PL.y and PL.lex)
extern int PLparse(); 
extern void *PL_createBuffer(int);
extern void PL_deleteBuffer(void *);
extern void PL_switchToBuffer(void *);
extern int PL_bufSize();
extern void *PL_bufState();
void PL_setInteractive(bool);

// for smtlib language (smtlib.y and smtlib.lex)
extern int smtlibparse(); 
extern void *smtlib_createBuffer(int);
extern void smtlib_deleteBuffer(void *);
extern void smtlib_switchToBuffer(void *);
extern int smtlib_bufSize();
extern void *smtlibBufState();
void smtlib_setInteractive(bool);

namespace CVC4 {
namespace parser {

ParserState *parserState;

Parser::Parser(CVC4::SmtEngine* smt, Language lang, std::istream& is, CVC4::Options* opts, bool interactive) throw()
  : d_smt(smt),
    d_is(is),
    d_opts(opts),
    d_lang(lang),
    d_interactive(interactive),
    d_buffer(0) {

  parserState->lineNum = 1;
  switch(d_lang) {
  case PL:
    d_buffer = ::PL_createBuffer(::PL_bufSize());
    break;
  case SMTLIB:
    //d_buffer = ::smtlib_createBuffer(::smtlib_bufSize());
    break;
  default:
    Unhandled();
  }
}

Parser::~Parser() throw() {
  switch(d_lang) {
  case PL:
    ::PL_deleteBuffer(d_buffer);
    break;
  case SMTLIB:
    //::smtlib_deleteBuffer(d_buffer);
    break;
  default:
    Unhandled();
  }
}

CVC4::Command* Parser::next() throw() {
  return 0;
}

bool Parser::done() const throw() {
  return false;
}

void Parser::printLocation(std::ostream & out) const throw() {
}

void Parser::reset() throw() {
}


}/* CVC4::parser namespace */
}/* CVC4 namespace */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback