cprover
|
#include <parser.h>
Public Member Functions | |
virtual void | clear () |
parsert () | |
virtual | ~parsert () |
bool | read (char &ch) |
virtual bool | parse ()=0 |
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 Attributes | |
std::istream * | in |
std::string | this_line |
std::string | last_line |
std::vector< exprt > | stack |
Protected Attributes | |
source_locationt | source_location |
unsigned | line_no |
unsigned | previous_line_no |
unsigned | column |
Additional Inherited Members |
|
inline |
|
inlinevirtual |
Reimplemented in assembler_parsert, json_parsert, ansi_c_parsert, xml_parsert, cpp_parsert, jsil_parsert, and mm_parsert.
Definition at line 32 of file parser.h.
References irept::clear(), column, last_line, line_no, previous_line_no, source_location, and stack.
Referenced by jsil_parsert::clear(), cpp_parsert::clear(), ansi_c_parsert::clear(), assembler_parsert::clear(), and parsert().
|
inline |
|
inline |
Definition at line 92 of file parser.h.
References source_locationt::get_file(), and source_location.
Referenced by cpp_parsert::parse(), and cpp_token_buffert::read_token().
|
inline |
Definition at line 97 of file parser.h.
References line_no.
Referenced by cpp_parsert::add_location(), and cpp_token_buffert::read_token().
|
inline |
|
pure virtual |
Implemented in assembler_parsert, java_bytecode_parsert, ansi_c_parsert, cpp_parsert, xml_parsert, json_parsert, jsil_parsert, and mm_parsert.
void parsert::parse_error | ( | const std::string & | message, |
const std::string & | before | ||
) |
Definition at line 30 of file parser.cpp.
References column, messaget::eom(), messaget::error(), source_locationt::set_column(), source_location, and messaget::mstreamt::source_location.
Referenced by yyansi_cerror(), yyassemblererror(), yyjsilerror(), yyjsonerror(), and yyxmlerror().
|
inline |
|
inline |
|
inline |
Definition at line 85 of file parser.h.
References get_current_working_directory(), source_locationt::set_file(), source_locationt::set_working_directory(), and source_location.
Referenced by mmcc_parse_optionst::convert(), ansi_c_languaget::parse(), cpp_languaget::parse(), jsil_languaget::parse(), cpp_parsert::parse(), parse_json(), parse_xml(), preprocessor_line(), jsil_languaget::to_expr(), ansi_c_languaget::to_expr(), and cpp_languaget::to_expr().
|
inline |
Definition at line 124 of file parser.h.
References source_locationt::set_function(), and source_location.
|
inline |
Definition at line 80 of file parser.h.
References line_no.
Referenced by ansi_c_languaget::parse(), and preprocessor_line().
|
inline |
Definition at line 112 of file parser.h.
References exprt::add_source_location(), line_no, previous_line_no, source_locationt::set_line(), and source_location.
|
protected |
Definition at line 137 of file parser.h.
Referenced by advance_column(), clear(), get_column(), inc_line_no(), parse_error(), and set_column().
std::istream* parsert::in |
Definition at line 26 of file parser.h.
Referenced by mmcc_parse_optionst::convert(), eof(), java_bytecode_parse(), ansi_c_languaget::parse(), jsil_languaget::parse(), cpp_languaget::parse(), cpp_parsert::parse(), parse_json(), parse_xml(), remove_asmt::process_instruction(), read(), java_bytecode_parsert::read_bytes(), read_goto_object(), java_bytecode_parsert::skip_bytes(), jsil_languaget::to_expr(), ansi_c_languaget::to_expr(), and cpp_languaget::to_expr().
std::string parsert::last_line |
|
protected |
Definition at line 136 of file parser.h.
Referenced by clear(), get_line_no(), inc_line_no(), set_line_no(), and set_source_location().
|
protected |
Definition at line 136 of file parser.h.
Referenced by clear(), and set_source_location().
|
protected |
Definition at line 135 of file parser.h.
Referenced by cpp_parsert::add_location(), clear(), get_file(), parse_error(), set_file(), set_function(), and set_source_location().
std::vector<exprt> parsert::stack |
Definition at line 30 of file parser.h.
Referenced by _newstack(), clear(), and cpp_token_buffert::read_token().