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 int yyassemblerlex();
18 int yyassemblererror(const std::string &error);
20 
22 {
23 public:
24  typedef std::vector<irept> instructiont;
25  std::list<instructiont> instructions;
26 
27  void add_token(const irept &irep)
28  {
29  if(instructions.empty())
31 
32  instructions.back().push_back(irep);
33  }
34 
36  {
37  instructions.push_back(instructiont());
38  }
39 
41  {
42  }
43 
44  virtual bool parse()
45  {
47  return false;
48  }
49 
50  virtual void clear()
51  {
53  instructions.clear();
54  // assembler_scanner_init();
55  }
56 };
57 
59 
60 #endif // CPROVER_ASSEMBLER_ASSEMBLER_PARSER_H
yyassemblerlex
int yyassemblerlex()
assembler_parsert
Definition: assembler_parser.h:21
assembler_parsert::new_instruction
void new_instruction()
Definition: assembler_parser.h:35
assembler_parsert::instructiont
std::vector< irept > instructiont
Definition: assembler_parser.h:24
assembler_parsert::parse
virtual bool parse()
Definition: assembler_parser.h:44
assembler_scanner_init
void assembler_scanner_init()
parsert::clear
virtual void clear()
Definition: parser.h:32
assembler_parsert::clear
virtual void clear()
Definition: assembler_parser.h:50
assembler_parser
assembler_parsert assembler_parser
Definition: assembler_parser.cpp:11
parsert
Definition: parser.h:23
assembler_parsert::instructions
std::list< instructiont > instructions
Definition: assembler_parser.h:25
assembler_parsert::assembler_parsert
assembler_parsert()
Definition: assembler_parser.h:40
parser.h
yyassemblererror
int yyassemblererror(const std::string &error)
Definition: assembler_parser.cpp:15
assembler_parsert::add_token
void add_token(const irept &irep)
Definition: assembler_parser.h:27
irept
There are a large number of kinds of tree structured or tree-like data in CPROVER.
Definition: irep.h:359