cprover
show_goto_functions_xmlt Class Reference

#include <show_goto_functions_xml.h>

Collaboration diagram for show_goto_functions_xmlt:
[legend]

Public Member Functions

 show_goto_functions_xmlt (const namespacet &_ns, bool _list_only=false)
 For outputting the GOTO program in a readable xml format. More...
 
xmlt convert (const goto_functionst &goto_functions)
 Walks through all of the functions in the program and returns an xml object representing all their functions. More...
 
void operator() (const goto_functionst &goto_functions, std::ostream &out, bool append=true)
 Print the xml object generated by show_goto_functions_xmlt::show_goto_functions to the provided stream (e.g. More...
 

Private Attributes

const namespacetns
 
bool list_only
 

Detailed Description

Definition at line 20 of file show_goto_functions_xml.h.

Constructor & Destructor Documentation

◆ show_goto_functions_xmlt()

show_goto_functions_xmlt::show_goto_functions_xmlt ( const namespacet _ns,
bool  _list_only = false 
)
explicit

For outputting the GOTO program in a readable xml format.

Parameters
nsthe namespace to use to resolve names with
list_onlyoutput only list of functions, but not their bodies

Definition at line 29 of file show_goto_functions_xml.cpp.

Member Function Documentation

◆ convert()

xmlt show_goto_functions_xmlt::convert ( const goto_functionst goto_functions)

Walks through all of the functions in the program and returns an xml object representing all their functions.

Produces output like this: <functions> <function name="main," is_body_available="true," is_internal="false"> <instructions> <instruction_id=ASSIGN> <location file="main.c" line="14"> <instruction_value> // 34 file main.c line 1 s = { 'a', 'b', 'c', 0 }; </instruction_value> </instruction> </instructions> </function> </functions>

Parameters
goto_functionsthe goto functions that make up the program

Definition at line 42 of file show_goto_functions_xml.cpp.

References goto_programt::instructiont::code, CPROVER_PREFIX, xmlt::data, xmlt::elements, goto_functionst::function_map, has_prefix(), id2string(), irept::is_not_nil(), list_only, xmlt::new_element(), ns, xmlt::set_attribute(), xmlt::set_attribute_bool(), exprt::source_location(), goto_programt::instructiont::to_string(), and xml().

Referenced by operator()(), and show_goto_functions().

◆ operator()()

void show_goto_functions_xmlt::operator() ( const goto_functionst goto_functions,
std::ostream &  out,
bool  append = true 
)

Print the xml object generated by show_goto_functions_xmlt::show_goto_functions to the provided stream (e.g.

std::cout)

Parameters
goto_functionsthe goto functions that make up the program
outthe stream to write the object to
appendshould a command and newline be appended to the stream before writing the xml object. Defaults to true

Definition at line 103 of file show_goto_functions_xml.cpp.

References convert().

Member Data Documentation

◆ list_only

bool show_goto_functions_xmlt::list_only
private

Definition at line 33 of file show_goto_functions_xml.h.

Referenced by convert().

◆ ns

const namespacet& show_goto_functions_xmlt::ns
private

Definition at line 32 of file show_goto_functions_xml.h.

Referenced by convert().


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