Go to the documentation of this file.
27 for(scopest::const_reverse_iterator it=
scopes.rbegin();
31 scopet::name_mapt::const_iterator n_it=
32 it->name_map.find(scope_name);
34 if(n_it!=it->name_map.end())
36 identifier=n_it->second.prefixed_name;
37 return n_it->second.id_class;
60 const std::string scope_name=
65 if(prefixed_name!=tag.
get(ID_identifier))
72 tag.
set(ID_identifier, prefixed_name);
93 new_declarator.
build(declarator);
104 ansi_c_declaration.
declarators().push_back(new_declarator);
113 if(!base_name.
empty())
119 bool force_root_scope=
false;
123 if(new_declarator.
type().
id()==ID_code &&
126 force_root_scope=
true;
130 force_root_scope=
true;
140 irep_idt prefixed_name=force_root_scope?
143 new_declarator.
set_name(prefixed_name);
154 ansi_c_declaration.
declarators().push_back(new_declarator);
159 if(type.
id()==ID_typedef)
161 else if(type.
id()==ID_struct ||
162 type.
id()==ID_union ||
163 type.
id()==ID_c_enum)
165 else if(type.
id()==ID_merged_type)
207 auto found = top.find(name);
208 return found != top.end() && found->second != enabled;
215 std::map<irep_idt, bool> flattened;
218 for(
const auto &pragma : pragma_set)
219 flattened[pragma.first] = pragma.second;
223 for(
const auto &pragma : flattened)
225 std::string check_name =
id2string(pragma.first);
226 std::string full_name =
227 (pragma.second ?
"enable:" :
"disable:") + check_name;
ansi_c_parsert ansi_c_parser
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void pragma_cprover_add_check(const irep_idt &name, bool enabled)
Adds a check to the CPROVER pragma stack.
source_locationt source_location
const declaratorst & declarators() const
void add_declarator(exprt &declaration, irept &declarator)
The type of an expression, extends irept.
void add_pragma(const irep_idt &pragma)
const type_with_subtypet & to_type_with_subtype(const typet &type)
const type_with_subtypest & to_type_with_subtypes(const typet &type)
Base class for all expressions.
void set_is_global(bool is_global)
bool pragma_cprover_clash(const irep_idt &name, bool enabled)
Returns true iff the same check with polarity is already present at top of the stack.
ansi_c_id_classt lookup(const irep_idt &base_name, irep_idt &identifier, bool tag, bool label)
const irep_idt & get(const irep_idt &name) const
typet & type()
Return the type of the expression.
void pragma_cprover_pop()
Pops a level in the CPROVER pragma stack.
bool get_is_parameter() const
void set_pragma_cprover()
Tags source_location with the current CPROVER pragma stack.
static ansi_c_id_classt get_class(const typet &type)
irep_idt get_base_name() const
const std::string & id2string(const irep_idt &d)
void set(const irep_idt &name, const irep_idt &value)
const std::string & get_string(const irep_idt &name) const
const irep_idt & id() const
ansi_c_declarationt & to_ansi_c_declaration(exprt &expr)
bool get_is_member() const
void parse_error(const std::string &message, const std::string &before)
std::list< std::map< const irep_idt, bool > > pragma_cprover_stack
void add_tag_with_body(irept &tag)
void set_name(const irep_idt &name)
bool pragma_cprover_empty()
True iff the CPROVER pragma stack is empty.
int yyansi_cerror(const std::string &error)
void pragma_cprover_push()
Pushes an empty level in the CPROVER pragma stack.
ansi_c_id_classt id_class
There are a large number of kinds of tree structured or tree-like data in CPROVER.
void remove(const irep_idt &name)