forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjsil_parser.h
52 lines (37 loc) · 989 Bytes
/
jsil_parser.h
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
/*******************************************************************\
Module: Jsil Language
Author: Michael Tautschnig, [email protected]
\*******************************************************************/
/// \file
/// Jsil Language
#ifndef CPROVER_JSIL_JSIL_PARSER_H
#define CPROVER_JSIL_JSIL_PARSER_H
#include <util/parser.h>
#include "jsil_parse_tree.h"
class jsil_parsert;
int yyjsilparse(jsil_parsert &);
void jsil_scanner_init(jsil_parsert &);
class jsil_parsert:public parsert
{
public:
explicit jsil_parsert(message_handlert &message_handler)
: parsert(message_handler)
{
}
jsil_parse_treet parse_tree;
virtual bool parse() override
{
jsil_scanner_init(*this);
return yyjsilparse(*this) != 0;
}
virtual void clear() override
{
parsert::clear();
parse_tree.clear();
// scanner state
string_literal.clear();
}
// internal state of the scanner
std::string string_literal;
};
#endif // CPROVER_JSIL_JSIL_PARSER_H