cprover
xml_goto_program.cpp File Reference

Convert goto programs to xml structures and back. More...

#include "xml_goto_program.h"
#include <sstream>
#include <iostream>
#include <util/xml_irep.h>
Include dependency graph for xml_goto_program.cpp:

Go to the source code of this file.

Functions

void convert (const goto_programt &goto_program, xmlt &xml)
 constructs the xml structure according to the goto program and the namespace into the given xml object. More...
 
void convert (const xmlt &xml, goto_programt &goto_program)
 constructs the goto program according to the xml structure and the namespace into the given goto program object. More...
 
goto_programt::targett find_instruction (const xmlt &xml, goto_programt::instructionst &instructions, const irep_idt &label)
 finds the index of the instruction labelled with the given target label in the given xml-program More...
 

Detailed Description

Convert goto programs to xml structures and back.

Definition in file xml_goto_program.cpp.

Function Documentation

◆ convert() [1/2]

void convert ( const goto_programt goto_program,
xmlt xml 
)

constructs the xml structure according to the goto program and the namespace into the given xml object.

parameters: goto program, namespace and an xml structure to fill
Returns
none

Definition at line 25 of file xml_goto_program.cpp.

References ASSERT, ASSIGN, ASSUME, ATOMIC_BEGIN, ATOMIC_END, comment(), convert(), xmlt::data, DEAD, END_FUNCTION, END_THREAD, FUNCTION_CALL, GOTO, id2string(), goto_program_templatet< codeT, guardT >::instructions, LOCATION, xmlt::name, xmlt::new_element(), OTHER, RETURN, xmlt::set_attribute(), SKIP, START_THREAD, and xml().

Referenced by convert().

◆ convert() [2/2]

void convert ( const xmlt xml,
goto_programt goto_program 
)

◆ find_instruction()

goto_programt::targett find_instruction ( const xmlt xml,
goto_programt::instructionst instructions,
const irep_idt label 
)

finds the index of the instruction labelled with the given target label in the given xml-program

parameters: a target label string, the instructions list and an xml
program
Returns
iterator to the found instruction or .end()

Definition at line 388 of file xml_goto_program.cpp.

References xmlt::elements, and xml().

Referenced by convert().