-
Notifications
You must be signed in to change notification settings - Fork 273
/
Copy pathparser.cpp
46 lines (35 loc) · 970 Bytes
/
parser.cpp
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
/*******************************************************************\
Module:
Author: Daniel Kroening, [email protected]
\*******************************************************************/
#include "parser.h"
#ifdef _WIN32
int isatty(int)
{
return 0;
}
#endif
exprt &_newstack(parsert &parser, unsigned &x)
{
x=(unsigned)parser.stack.size();
if(x>=parser.stack.capacity())
parser.stack.reserve(x*2);
parser.stack.push_back(static_cast<const exprt &>(get_nil_irep()));
return parser.stack.back();
}
void parsert::parse_error(
const std::string &message,
const std::string &before)
{
std::string tmp=message;
if(!before.empty())
tmp += " before '" + before + "'";
#if 0
source_locationt tmp_source_location=source_location;
tmp_source_location.set_column(column-before.size());
print(1, tmp, -1, tmp_source_location);
#else
log.error().source_location = source_location();
log.error() << tmp << messaget::eom;
#endif
}