CBMC
taint_parser.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Taint Parser
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_ANALYZER_TAINT_PARSER_H
13 #define CPROVER_GOTO_ANALYZER_TAINT_PARSER_H
14 
15 #include <string>
16 #include <list>
17 #include <iosfwd>
18 
19 #include <util/irep.h>
20 
21 class message_handlert;
22 
24 {
25 public:
26  class rulet
27  {
28  public:
29  enum { SOURCE, SINK, SANITIZER } kind;
31 
32  bool is_source() const
33  {
34  return kind==SOURCE;
35  }
36 
37  bool is_sink() const
38  {
39  return kind==SINK;
40  }
41 
42  bool is_sanitizer() const
43  {
44  return kind==SANITIZER;
45  }
46 
50  unsigned parameter_number; // the first one is '1'
51  std::string message;
52 
53  void output(std::ostream &) const;
54 
55  rulet():
57  // The other class members are initialized by taint_parser().
58  {
59  }
60  };
61 
62  typedef std::list<rulet> rulest;
64 
65  void output(std::ostream &) const;
66 };
67 
68 bool taint_parser(
69  const std::string &taint_file_name,
72 
73 #endif // CPROVER_GOTO_ANALYZER_TAINT_PARSER_H
taint_parse_treet::rulet::taint
irep_idt taint
Definition: taint_parser.h:49
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
taint_parse_treet::rules
rulest rules
Definition: taint_parser.h:63
taint_parse_treet::rulet::is_sanitizer
bool is_sanitizer() const
Definition: taint_parser.h:42
taint_parse_treet::rulet::parameter_number
unsigned parameter_number
Definition: taint_parser.h:50
taint_parse_treet
Definition: taint_parser.h:23
taint_parse_treet::rulet::RETURN_VALUE
@ RETURN_VALUE
Definition: taint_parser.h:30
taint_parse_treet::rulet::id
irep_idt id
Definition: taint_parser.h:47
taint_parse_treet::rulet::rulet
rulet()
Definition: taint_parser.h:55
taint_parse_treet::rulet::function_identifier
irep_idt function_identifier
Definition: taint_parser.h:48
taint_parse_treet::rulet::where
enum taint_parse_treet::rulet::@2 where
taint_parse_treet::rulet::THIS
@ THIS
Definition: taint_parser.h:30
taint_parse_treet::rulest
std::list< rulet > rulest
Definition: taint_parser.h:62
taint_parse_treet::rulet::SANITIZER
@ SANITIZER
Definition: taint_parser.h:29
message_handlert
Definition: message.h:27
taint_parse_treet::rulet::is_sink
bool is_sink() const
Definition: taint_parser.h:37
taint_parse_treet::rulet::output
void output(std::ostream &) const
Definition: taint_parser.cpp:121
taint_parse_treet::rulet::PARAMETER
@ PARAMETER
Definition: taint_parser.h:30
taint_parse_treet::rulet
Definition: taint_parser.h:26
taint_parse_treet::output
void output(std::ostream &) const
Definition: taint_parser.cpp:146
taint_parser
bool taint_parser(const std::string &taint_file_name, taint_parse_treet &, message_handlert &)
Definition: taint_parser.cpp:20
taint_parse_treet::rulet::message
std::string message
Definition: taint_parser.h:51
taint_parse_treet::rulet::is_source
bool is_source() const
Definition: taint_parser.h:32
taint_parse_treet::rulet::SOURCE
@ SOURCE
Definition: taint_parser.h:29
taint_parse_treet::rulet::kind
enum taint_parse_treet::rulet::@1 kind
taint_parse_treet::rulet::SINK
@ SINK
Definition: taint_parser.h:29
irep.h