cprover
ansi_c_parsert Class Reference

#include <ansi_c_parser.h>

Inheritance diagram for ansi_c_parsert:
[legend]
Collaboration diagram for ansi_c_parsert:
[legend]

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< scopetscopest
 
- Public Types inherited from messaget
enum  message_levelt {
  M_ERROR =1, M_WARNING =2, M_RESULT =4, M_STATUS =6,
  M_STATISTICS =8, M_PROGRESS =9, M_DEBUG =10
}
 

Public Member Functions

 ansi_c_parsert ()
 
virtual bool parse () override
 
virtual void clear () override
 
scopetroot_scope ()
 
const scopetroot_scope () const
 
void pop_scope ()
 
scopetcurrent_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)
 
- Public Member Functions inherited from parsert
 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)
 
- Public Member Functions inherited from messaget
virtual void set_message_handler (message_handlert &_message_handler)
 
message_handlertget_message_handler ()
 
 messaget ()
 
 messaget (const messaget &other)
 
 messaget (message_handlert &_message_handler)
 
virtual ~messaget ()
 
mstreamtget_mstream (unsigned message_level)
 
mstreamterror ()
 
mstreamtwarning ()
 
mstreamtresult ()
 
mstreamtstatus ()
 
mstreamtstatistics ()
 
mstreamtprogress ()
 
mstreamtdebug ()
 

Static Public Member Functions

static ansi_c_id_classt get_class (const typet &type)
 
- Static Public Member Functions inherited from messaget
static mstreamteom (mstreamt &m)
 
static mstreamtendl (mstreamt &m)
 

Public Attributes

ansi_c_parse_treet parse_tree
 
bool tag_following
 
bool asm_block_following
 
unsigned parenthesis_counter
 
std::string string_literal
 
std::list< exprtpragma_pack
 
modet mode
 
bool cpp98
 
bool cpp11
 
bool for_has_scope
 
scopest scopes
 
- Public Attributes inherited from parsert
std::istream * in
 
std::string this_line
 
std::string last_line
 
std::vector< exprtstack
 

Additional Inherited Members

- Protected Attributes inherited from parsert
source_locationt source_location
 
unsigned line_no
 
unsigned previous_line_no
 
unsigned column
 
- Protected Attributes inherited from messaget
message_handlertmessage_handler
 
mstreamt mstream
 

Detailed Description

Definition at line 26 of file ansi_c_parser.h.

Member Typedef Documentation

◆ identifiert

◆ modet

◆ scopest

typedef std::list<scopet> ansi_c_parsert::scopest

Definition at line 78 of file ansi_c_parser.h.

◆ scopet

Definition at line 76 of file ansi_c_parser.h.

Member Enumeration Documentation

◆ decl_typet

Enumerator
TAG 
MEMBER 
PARAMETER 
OTHER 

Definition at line 102 of file ansi_c_parser.h.

Constructor & Destructor Documentation

◆ ansi_c_parsert()

ansi_c_parsert::ansi_c_parsert ( )
inline

Definition at line 31 of file ansi_c_parser.h.

Member Function Documentation

◆ add_declarator()

◆ add_tag_with_body()

◆ clear()

virtual void ansi_c_parsert::clear ( void  )
inlineoverridevirtual

◆ copy_item()

void ansi_c_parsert::copy_item ( const ansi_c_declarationt declaration)
inline

Definition at line 110 of file ansi_c_parser.h.

References irept::id(), ansi_c_parse_treet::items, and parse_tree.

◆ current_scope()

scopet& ansi_c_parsert::current_scope ( )
inline

Definition at line 96 of file ansi_c_parser.h.

References scopes.

Referenced by add_declarator(), add_tag_with_body(), lookup(), and new_scope().

◆ get_class()

ansi_c_id_classt ansi_c_parsert::get_class ( const typet type)
static

◆ lookup()

ansi_c_id_classt ansi_c_parsert::lookup ( const irep_idt base_name,
irep_idt identifier,
bool  tag,
bool  label 
)

◆ lookup_label()

irep_idt ansi_c_parsert::lookup_label ( const irep_idt  base_name)
inline

Definition at line 131 of file ansi_c_parser.h.

References lookup().

◆ new_scope()

void ansi_c_parsert::new_scope ( const std::string &  prefix)
inline

Definition at line 116 of file ansi_c_parser.h.

References current_scope(), ansi_c_scopet::prefix, and scopes.

◆ parse()

virtual bool ansi_c_parsert::parse ( )
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().

◆ pop_scope()

void ansi_c_parsert::pop_scope ( )
inline

Definition at line 91 of file ansi_c_parser.h.

References scopes.

◆ root_scope() [1/2]

scopet& ansi_c_parsert::root_scope ( )
inline

Definition at line 81 of file ansi_c_parser.h.

References scopes.

Referenced by add_declarator().

◆ root_scope() [2/2]

const scopet& ansi_c_parsert::root_scope ( ) const
inline

Definition at line 86 of file ansi_c_parser.h.

References scopes.

Member Data Documentation

◆ asm_block_following

bool ansi_c_parsert::asm_block_following

Definition at line 61 of file ansi_c_parser.h.

Referenced by clear().

◆ cpp11

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().

◆ cpp98

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().

◆ for_has_scope

bool ansi_c_parsert::for_has_scope

Definition at line 73 of file ansi_c_parser.h.

Referenced by ansi_c_languaget::parse().

◆ mode

modet ansi_c_parsert::mode

◆ parenthesis_counter

unsigned ansi_c_parsert::parenthesis_counter

Definition at line 62 of file ansi_c_parser.h.

Referenced by clear().

◆ parse_tree

ansi_c_parse_treet ansi_c_parsert::parse_tree

◆ pragma_pack

std::list<exprt> ansi_c_parsert::pragma_pack

Definition at line 64 of file ansi_c_parser.h.

Referenced by clear().

◆ scopes

scopest ansi_c_parsert::scopes

Definition at line 79 of file ansi_c_parser.h.

Referenced by clear(), current_scope(), lookup(), new_scope(), pop_scope(), and root_scope().

◆ string_literal

std::string ansi_c_parsert::string_literal

Definition at line 63 of file ansi_c_parser.h.

Referenced by clear().

◆ tag_following

bool ansi_c_parsert::tag_following

Definition at line 60 of file ansi_c_parser.h.

Referenced by clear().


The documentation for this class was generated from the following files: