cprover
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 #include <util/expr.h>
15 
16 int yyassemblerlex();
17 int yyassemblererror(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 
40  {
41  }
42 
43  virtual bool parse()
44  {
46  return false;
47  }
48 
49  virtual void clear()
50  {
52  instructions.clear();
53  // assembler_scanner_init();
54  }
55 };
56 
58 
59 #endif // CPROVER_ASSEMBLER_ASSEMBLER_PARSER_H
int yyassemblerlex()
The main scanner function which does all the work.
Definition: parser.h:23
virtual void clear()
Parser utilities.
std::vector< irept > instructiont
Base class for tree-like data structures with sharing.
Definition: irep.h:86
void assembler_scanner_init()
virtual bool parse()
virtual void clear()
Definition: parser.h:32
std::list< instructiont > instructions
assembler_parsert assembler_parser
int yyassemblererror(const std::string &error)
void add_token(const irept &irep)