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
yyassemblerlex
int yyassemblerlex()
The main scanner function which does all the work.
Definition: assembler_lex.yy.cpp:931
assembler_parsert
Definition: assembler_parser.h:20
assembler_parsert::new_instruction
void new_instruction()
Definition: assembler_parser.h:34
assembler_parsert::instructiont
std::vector< irept > instructiont
Definition: assembler_parser.h:23
assembler_parsert::parse
virtual bool parse()
Definition: assembler_parser.h:43
assembler_scanner_init
void assembler_scanner_init()
parsert::clear
virtual void clear()
Definition: parser.h:32
expr.h
assembler_parsert::clear
virtual void clear()
Definition: assembler_parser.h:49
assembler_parser
assembler_parsert assembler_parser
Definition: assembler_parser.cpp:13
parsert
Definition: parser.h:23
assembler_parsert::instructions
std::list< instructiont > instructions
Definition: assembler_parser.h:24
assembler_parsert::assembler_parsert
assembler_parsert()
Definition: assembler_parser.h:39
parser.h
yyassemblererror
int yyassemblererror(const std::string &error)
Definition: assembler_parser.cpp:17
assembler_parsert::add_token
void add_token(const irept &irep)
Definition: assembler_parser.h:26
irept
Base class for tree-like data structures with sharing.
Definition: irep.h:156