cprover
|
#include <ansi_c_parser.h>
Public Types | |
enum | decl_typet { decl_typet::TAG, decl_typet::MEMBER, decl_typet::PARAMETER, decl_typet::OTHER } |
typedef configt::ansi_ct::flavourt | modet |
typedef ansi_c_identifiert | identifiert |
typedef ansi_c_scopet | scopet |
typedef std::list< scopet > | scopest |
Public Member Functions | |
ansi_c_parsert () | |
virtual bool | parse () override |
virtual void | clear () override |
scopet & | root_scope () |
const scopet & | root_scope () const |
void | pop_scope () |
scopet & | current_scope () |
void | add_declarator (exprt &declaration, irept &declarator) |
void | add_tag_with_body (irept &tag) |
void | copy_item (const ansi_c_declarationt &declaration) |
void | new_scope (const std::string &prefix) |
ansi_c_id_classt | lookup (const irep_idt &base_name, irep_idt &identifier, bool tag, bool label) |
irep_idt | lookup_label (const irep_idt base_name) |
![]() | |
parsert () | |
virtual | ~parsert () |
bool | read (char &ch) |
bool | eof () |
void | parse_error (const std::string &message, const std::string &before) |
void | inc_line_no () |
void | set_line_no (unsigned _line_no) |
void | set_file (const irep_idt &file) |
irep_idt | get_file () const |
unsigned | get_line_no () const |
unsigned | get_column () const |
void | set_column (unsigned _column) |
void | set_source_location (exprt &e) |
void | set_function (const irep_idt &function) |
void | advance_column (unsigned token_width) |
Static Public Member Functions | |
static ansi_c_id_classt | get_class (const typet &type) |
Public Attributes | |
ansi_c_parse_treet | parse_tree |
bool | tag_following |
bool | asm_block_following |
unsigned | parenthesis_counter |
std::string | string_literal |
std::list< exprt > | pragma_pack |
modet | mode |
bool | cpp98 |
bool | cpp11 |
bool | for_has_scope |
scopest | scopes |
![]() | |
std::istream * | in |
std::string | this_line |
std::string | last_line |
std::vector< exprt > | stack |
Additional Inherited Members | |
![]() | |
source_locationt | source_location |
unsigned | line_no |
unsigned | previous_line_no |
unsigned | column |
Definition at line 26 of file ansi_c_parser.h.
Definition at line 75 of file ansi_c_parser.h.
Definition at line 66 of file ansi_c_parser.h.
typedef std::list<scopet> ansi_c_parsert::scopest |
Definition at line 78 of file ansi_c_parser.h.
typedef ansi_c_scopet ansi_c_parsert::scopet |
Definition at line 76 of file ansi_c_parser.h.
|
strong |
Enumerator | |
---|---|
TAG | |
MEMBER | |
PARAMETER | |
OTHER |
Definition at line 102 of file ansi_c_parser.h.
|
inline |
Definition at line 31 of file ansi_c_parser.h.
Definition at line 88 of file ansi_c_parser.cpp.
References ANSI_C_SYMBOL, ANSI_C_TYPEDEF, ansi_c_declaratort::build(), current_scope(), dstringt::empty(), ansi_c_declaratort::get_base_name(), irept::id(), id2string(), ansi_c_identifiert::id_class, id_class, irept::is_not_nil(), c_storage_spect::is_typedef, ansi_c_scopet::name_map, ansi_c_scopet::prefix, ansi_c_identifiert::prefixed_name, root_scope(), ansi_c_declaratort::set_name(), to_ansi_c_declaration(), and exprt::type().
void ansi_c_parsert::add_tag_with_body | ( | irept & | tag | ) |
Definition at line 62 of file ansi_c_parser.cpp.
References ANSI_C_TAG, current_scope(), irept::get(), irept::get_string(), ansi_c_identifiert::id_class, ansi_c_scopet::name_map, ansi_c_scopet::prefix, ansi_c_identifiert::prefixed_name, irept::set(), and yyansi_ctext.
|
inlineoverridevirtual |
Reimplemented from parsert.
Definition at line 42 of file ansi_c_parser.h.
References asm_block_following, ansi_c_parse_treet::clear(), parsert::clear(), parenthesis_counter, pragma_pack, scopes, string_literal, and tag_following.
Referenced by ansi_c_languaget::parse(), and ansi_c_languaget::to_expr().
|
inline |
Definition at line 110 of file ansi_c_parser.h.
References irept::id(), and ansi_c_parse_treet::items.
|
inline |
Definition at line 96 of file ansi_c_parser.h.
Referenced by add_declarator(), add_tag_with_body(), lookup(), and new_scope().
|
static |
Definition at line 158 of file ansi_c_parser.cpp.
References ANSI_C_SYMBOL, ANSI_C_TAG, ANSI_C_TYPEDEF, forall_subtypes, typet::has_subtype(), irept::id(), and typet::subtype().
Referenced by new_scope().
ansi_c_id_classt ansi_c_parsert::lookup | ( | const irep_idt & | base_name, |
irep_idt & | identifier, | ||
bool | tag, | ||
bool | label | ||
) |
Definition at line 17 of file ansi_c_parser.cpp.
References ANSI_C_TAG, ANSI_C_UNKNOWN, ansi_c_identifiert::base_name, current_scope(), id2string(), ansi_c_identifiert::id_class, ansi_c_scopet::name_map, ansi_c_scopet::prefix, ansi_c_identifiert::prefixed_name, and scopes.
Referenced by lookup_label(), and new_scope().
Definition at line 131 of file ansi_c_parser.h.
References ansi_c_parser, ansi_c_scanner_init(), messaget::error(), lookup(), and yyansi_cerror().
|
inline |
Definition at line 116 of file ansi_c_parser.h.
References current_scope(), get_class(), lookup(), and ansi_c_scopet::prefix.
|
inlineoverridevirtual |
Implements parsert.
Definition at line 37 of file ansi_c_parser.h.
References yyansi_cparse().
Referenced by ansi_c_languaget::parse(), and ansi_c_languaget::to_expr().
|
inline |
Definition at line 91 of file ansi_c_parser.h.
|
inline |
Definition at line 81 of file ansi_c_parser.h.
Referenced by add_declarator().
|
inline |
Definition at line 86 of file ansi_c_parser.h.
bool ansi_c_parsert::asm_block_following |
Definition at line 61 of file ansi_c_parser.h.
Referenced by clear().
bool ansi_c_parsert::cpp11 |
Definition at line 70 of file ansi_c_parser.h.
Referenced by ansi_c_languaget::parse(), and cpp_parsert::parse().
bool ansi_c_parsert::cpp98 |
Definition at line 70 of file ansi_c_parser.h.
Referenced by ansi_c_languaget::parse(), and cpp_parsert::parse().
bool ansi_c_parsert::for_has_scope |
Definition at line 73 of file ansi_c_parser.h.
Referenced by ansi_c_languaget::parse().
modet ansi_c_parsert::mode |
Definition at line 67 of file ansi_c_parser.h.
Referenced by ansi_c_languaget::parse(), cpp_parsert::parse(), and ansi_c_languaget::to_expr().
unsigned ansi_c_parsert::parenthesis_counter |
Definition at line 62 of file ansi_c_parser.h.
Referenced by clear().
ansi_c_parse_treet ansi_c_parsert::parse_tree |
Definition at line 29 of file ansi_c_parser.h.
Referenced by ansi_c_languaget::parse(), and ansi_c_languaget::to_expr().
std::list<exprt> ansi_c_parsert::pragma_pack |
Definition at line 64 of file ansi_c_parser.h.
Referenced by clear().
scopest ansi_c_parsert::scopes |
Definition at line 79 of file ansi_c_parser.h.
std::string ansi_c_parsert::string_literal |
Definition at line 63 of file ansi_c_parser.h.
Referenced by clear().
bool ansi_c_parsert::tag_following |
Definition at line 60 of file ansi_c_parser.h.
Referenced by clear().