cprover
string_instrumentation.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: String Abstraction
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_PROGRAMS_STRING_INSTRUMENTATION_H
13 #define CPROVER_GOTO_PROGRAMS_STRING_INSTRUMENTATION_H
14 
15 #include <util/exception_utils.h>
16 
17 class exprt;
18 class goto_functionst;
19 class goto_modelt;
20 class goto_programt;
21 class symbol_tablet;
22 
24 {
25 public:
27  std::string message,
29  : message(std::move(message)), source_location(std::move(source_location))
30  {
31  }
32  std::string what() const override
33  {
34  return message + " (at: " + source_location.as_string() + ")";
35  }
36 
37 private:
38  std::string message;
40 };
41 
43  symbol_tablet &,
44  goto_programt &);
45 
47  symbol_tablet &,
48  goto_functionst &);
49 
51 
52 exprt is_zero_string(const exprt &what, bool write = false);
53 exprt zero_string_length(const exprt &what, bool write=false);
54 exprt buffer_size(const exprt &what);
55 
56 #endif // CPROVER_GOTO_PROGRAMS_STRING_INSTRUMENTATION_H
exception_utils.h
symbol_tablet
The symbol table.
Definition: symbol_table.h:14
source_locationt::as_string
std::string as_string() const
Definition: source_location.h:25
exprt
Base class for all expressions.
Definition: expr.h:54
goto_modelt
Definition: goto_model.h:26
incorrect_source_program_exceptiont::incorrect_source_program_exceptiont
incorrect_source_program_exceptiont(std::string message, source_locationt source_location)
Definition: string_instrumentation.h:26
incorrect_source_program_exceptiont::what
std::string what() const override
A human readable description of what went wrong.
Definition: string_instrumentation.h:32
buffer_size
exprt buffer_size(const exprt &what)
Definition: string_instrumentation.cpp:46
is_zero_string
exprt is_zero_string(const exprt &what, bool write=false)
Definition: string_instrumentation.cpp:28
string_instrumentation
void string_instrumentation(symbol_tablet &, goto_programt &)
Definition: string_instrumentation.cpp:161
source_locationt
Definition: source_location.h:19
goto_functionst
A collection of goto functions.
Definition: goto_functions.h:25
zero_string_length
exprt zero_string_length(const exprt &what, bool write=false)
Definition: string_instrumentation.cpp:36
incorrect_source_program_exceptiont
Definition: string_instrumentation.h:24
goto_programt
A generic container class for the GOTO intermediate representation of one function.
Definition: goto_program.h:71
incorrect_source_program_exceptiont::source_location
source_locationt source_location
Definition: string_instrumentation.h:39
incorrect_source_program_exceptiont::message
std::string message
Definition: string_instrumentation.h:38
cprover_exception_baset
Base class for exceptions thrown in the cprover project.
Definition: exception_utils.h:25