CBMC
assembler_parser.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_ASSEMBLER_ASSEMBLER_PARSER_H
11 #define CPROVER_ASSEMBLER_ASSEMBLER_PARSER_H
12 
13 #include <util/parser.h>
14 
15 #include <list>
16 
17 class assembler_parsert;
18 int yyassemblererror(assembler_parsert &, void *, const std::string &error);
19 
21 {
22 public:
23  typedef std::vector<irept> instructiont;
24  std::list<instructiont> instructions;
25 
26  void add_token(const irept &irep)
27  {
28  if(instructions.empty())
30 
31  instructions.back().push_back(irep);
32  }
33 
35  {
36  instructions.push_back(instructiont());
37  }
38 
39  explicit assembler_parsert(message_handlert &message_handler)
40  : parsert(message_handler)
41  {
42  }
43 
44  bool parse() override;
45 };
46 
47 #endif // CPROVER_ASSEMBLER_ASSEMBLER_PARSER_H
int yyassemblererror(assembler_parsert &, void *, const std::string &error)
std::list< instructiont > instructions
std::vector< irept > instructiont
bool parse() override
assembler_parsert(message_handlert &message_handler)
void add_token(const irept &irep)
There are a large number of kinds of tree structured or tree-like data in CPROVER.
Definition: irep.h:364
Definition: parser.h:24
Parser utilities.