CBMC
Loading...
Searching...
No Matches
format_strings.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Format String Parser
4
5Author: CM Wintersteiger
6
7\*******************************************************************/
8
11
12#ifndef CPROVER_GOTO_PROGRAMS_FORMAT_STRINGS_H
13#define CPROVER_GOTO_PROGRAMS_FORMAT_STRINGS_H
14
15#include <util/irep.h>
16#include <util/mp_arith.h>
17
18#include <list>
19#include <optional>
20#include <string>
21
22class typet;
23
25{
26public:
27 enum class token_typet
28 {
29 UNKNOWN,
30 TEXT,
31 INT, // d, i, o, u, x
32 FLOAT, // a, e, f, g
33 CHAR, // c
34 STRING, // s
35 POINTER // p
36 };
37
38 enum class flag_typet
39 {
44 SIGN,
46 };
47
49 {
51 LEN_h,
52 LEN_hh,
53 LEN_l,
54 LEN_ll,
55 LEN_L,
56 LEN_j,
57 LEN_t
58 };
59
68
81
83 std::list<flag_typet> flags;
88 irep_idt value; // for text and pattern matching
89};
90
91typedef std::list<format_tokent> format_token_listt;
92
93format_token_listt parse_format_string(const std::string &);
94
95std::optional<typet> get_type(const format_tokent &);
96
97#endif // CPROVER_GOTO_PROGRAMS_FORMAT_STRINGS_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:38
mp_integer precision
token_typet type
mp_integer field_width
representationt representation
length_modifierst length_modifier
format_tokent(token_typet _type)
std::list< flag_typet > flags
The type of an expression, extends irept.
Definition type.h:29
std::optional< typet > get_type(const format_tokent &)
format_token_listt parse_format_string(const std::string &)
std::list< format_tokent > format_token_listt