CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
parser.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module:
4
5Author: Daniel Kroening, kroening@kroening.com
6
7\*******************************************************************/
8
9
10#include "parser.h"
11
12#ifdef _WIN32
13int isatty(int)
14{
15 return 0;
16}
17#endif
18
20{
21 x=(unsigned)parser.stack.size();
22
23 if(x>=parser.stack.capacity())
24 parser.stack.reserve(x*2);
25
26 parser.stack.push_back(static_cast<const exprt &>(get_nil_irep()));
27 return parser.stack.back();
28}
29
31 const std::string &message,
32 const std::string &before)
33{
34 std::string tmp=message;
35 if(!before.empty())
36 tmp += " before '" + before + "'";
37
38#if 0
40 tmp_source_location.set_column(column-before.size());
41 print(1, tmp, -1, tmp_source_location);
42#else
44 log.error() << tmp << messaget::eom;
45#endif
46}
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
Base class for all expressions.
Definition expr.h:56
source_locationt source_location
Definition message.h:239
mstreamt & error() const
Definition message.h:391
static eomt eom
Definition message.h:289
const source_locationt & source_location()
Definition parser.h:111
unsigned column
Definition parser.h:147
messaget log
Definition parser.h:144
void parse_error(const std::string &message, const std::string &before)
Definition parser.cpp:30
const irept & get_nil_irep()
Definition irep.cpp:19
exprt & _newstack(parsert &parser, unsigned &x)
Definition parser.cpp:19
Parser utilities.