File tree 4 files changed +119
-117
lines changed
4 files changed +119
-117
lines changed Original file line number Diff line number Diff line change 11
11
12
12
#include " jsil_parser.h"
13
13
14
+ int jsil_parsert::instance_count = 0 ;
15
+
14
16
int yyjsillex_init_extra (jsil_parsert *, void **);
15
17
int yyjsillex_destroy (void *);
16
18
int yyjsilparse (jsil_parsert &, void *);
Original file line number Diff line number Diff line change @@ -22,6 +22,15 @@ class jsil_parsert:public parsert
22
22
explicit jsil_parsert (message_handlert &message_handler)
23
23
: parsert(message_handler)
24
24
{
25
+ // simplistic check that we don't attempt to do reentrant parsing
26
+ PRECONDITION (++instance_count == 1 );
27
+ }
28
+
29
+ jsil_parsert (const jsil_parsert &) = delete ;
30
+
31
+ ~jsil_parsert () override
32
+ {
33
+ --instance_count;
25
34
}
26
35
27
36
jsil_parse_treet parse_tree;
@@ -39,6 +48,9 @@ class jsil_parsert:public parsert
39
48
40
49
// internal state of the scanner
41
50
std::string string_literal;
51
+
52
+ protected:
53
+ static int instance_count;
42
54
};
43
55
44
56
#endif // CPROVER_JSIL_JSIL_PARSER_H
Original file line number Diff line number Diff line change 5
5
6
6
#include " jsil_parser.h"
7
7
8
- int yyjsillex (unsigned *, void *);
8
+ int yyjsillex (void *);
9
9
char *yyjsilget_text (void *);
10
10
11
11
int yyjsilerror (
@@ -38,18 +38,8 @@ int yyjsilerror(
38
38
// unreachable code
39
39
#pragma warning(disable:4702)
40
40
#endif
41
-
42
- // yynerrs may never be used. Will be fixed when bison > 3.8.2 is released (see
43
- // http://git.savannah.gnu.org/cgit/bison.git/commit/?id=a166d5450e3f47587b98f6005f9f5627dbe21a5b)
44
- #ifdef __clang__
45
- # pragma clang diagnostic ignored "-Wunused-but-set-variable"
46
- #endif
47
41
%}
48
42
49
- // Should be "%define api.pure full" instead of "%pure-parser", but macOS ships
50
- // bison 2.3, which doesn't yet support this. We have to invoke bison with
51
- // -Wno-deprecated on all platforms other than macOS.
52
- %pure-parser
53
43
%parse-param {jsil_parsert &jsil_parser}
54
44
%parse-param {void *scanner}
55
45
%lex-param {void *scanner}
You can’t perform that action at this time.
0 commit comments