cprover
jsil_parser.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Jsil Language
4 
5 Author: Michael Tautschnig, tautschn@amazon.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_JSIL_JSIL_PARSER_H
13 #define CPROVER_JSIL_JSIL_PARSER_H
14 
15 #include <util/parser.h>
16 
17 #include "jsil_parse_tree.h"
18 
19 int yyjsilparse();
20 
21 class jsil_parsert:public parsert
22 {
23 public:
25 
26  virtual bool parse() override
27  {
28  return yyjsilparse()!=0;
29  }
30 
31  virtual void clear() override
32  {
34  parse_tree.clear();
35 
36  // scanner state
37  string_literal.clear();
38  }
39 
40  // internal state of the scanner
41  std::string string_literal;
42 };
43 
45 
46 int yyjsilerror(const std::string &error);
47 void jsil_scanner_init();
48 
49 #endif // CPROVER_JSIL_JSIL_PARSER_H
Definition: parser.h:23
Parser utilities.
jsil_parsert jsil_parser
Definition: jsil_parser.cpp:14
std::string string_literal
Definition: jsil_parser.h:41
Jsil Language.
virtual void clear()
Definition: parser.h:32
void jsil_scanner_init()
mstreamt & error()
Definition: message.h:223
jsil_parse_treet parse_tree
Definition: jsil_parser.h:24
int yyjsilerror(const std::string &error)
Definition: jsil_parser.cpp:18
int yyjsilparse()
virtual void clear() override
Definition: jsil_parser.h:31
virtual bool parse() override
Definition: jsil_parser.h:26