77 "Expression ID should be statement_list_function");
114 std::vector<symbol_exprt> symbols;
116 for(
const exprt &
part : entry.operands())
121 symbols.push_back(*symbol);
123 default_value =
part;
146 for(
const exprt &
part : entry.operands())
256 const exprt &instructions)
270 else if(
op_it->is_not_nil())
274 if(label.get_value() ==
ID_nil)
279 network.add_instruction(instruction);
297 module.add_network(network);
305 "Root expression ID should be ID_statement_list_function_block");
322 "Expression ID should be statement_list_function");
static abstract_object_pointert transform(const exprt &expr, const std::vector< abstract_object_pointert > &operands, const abstract_environmentt &environment, const namespacet &ns)
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
codet representation of a label for branch targets.
Data structure for representing an arbitrary statement in a program.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
std::vector< exprt > operandst
const irep_idt & id() const
void parse_error(const std::string &message, const std::string &before)
Intermediate representation of a parsed Statement List file before converting it into a goto program.
std::list< var_declarationt > var_declarationst
void clear()
Removes all functions and function blocks from the parse tree.
void add_function_block(function_blockt &block)
Adds a function block to the parse tree.
std::vector< symbol_exprt > tags
List of tags that were included in the source.
void add_function(functiont &function)
Adds a function to the parse tree.
void swap(statement_list_parse_treet &other)
Swaps the contents of the parse tree with the parameter.
Responsible for starting the parse process and to translate the result into a statement_list_parse_tr...
statement_list_parse_treet parse_tree
Tree that is being filled by the parsing process.
void clear() override
Removes all functions and function blocks from the parse tree and clears the internal state of the pa...
void add_tag_list(const exprt &tag_list)
Adds a tag list to the parse tree by converting the tag_list expression tree.
void add_function_block(const exprt &block)
Adds a function block to the parse tree by converting the block expression tree.
void print_tree(std::ostream &out) const
Prints the parse tree of this instance to the given output stream.
void add_function(const exprt &function)
Adds a function to the parse tree by converting the function expression tree.
void swap_tree(statement_list_parse_treet &other)
Swaps the contents of the parse tree of this instance with other.
bool parse() override
Starts the parsing process and saves the result inside of this instance's parse tree.
Expression to hold a symbol (variable)
The type of an expression, extends irept.
const std::string & id2string(const irep_idt &d)
#define UNREACHABLE
This should be used to mark dead code.
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
Statement List Language Parse Tree.
void output_parse_tree(std::ostream &out, const statement_list_parse_treet &parse_tree)
Prints the given Statement List parse tree in a human-readable form to the given output stream.
Statement List Language Parse Tree Output.
static void find_variables(statement_list_parse_treet::functiont &function, const exprt &var_decls)
Adds all valid variable declarations to the given function.
static std::string find_version(const exprt &root)
Searches for the version of the TIA module inside of its root expression.
static exprt find_network_instructions(const exprt &network)
Searches for the instruction list of a network inside of its root expression.
static void find_instructions(statement_list_parse_treet::networkt &network, const exprt &instructions)
Adds all valid instructions to the given network.
static void find_networks(statement_list_parse_treet::tia_modulet &module, const exprt &network_list)
Adds all valid networks and their instructions to the given function element.
static exprt find_network_list(const exprt &root)
Searches for the network list of the TIA element inside of its root expression.
statement_list_parsert statement_list_parser
Instance of the parser, used by other modules.
static std::string find_network_title(const exprt &network)
Searches for the title of a network inside of its root expression.
int yystatement_listerror(const std::string &error)
Forwards any errors that are encountered during the parse process.
static exprt find_variable_list(const exprt &root)
Searches for the variable list of the TIA module inside of its root expression.
static irep_idt find_name(const exprt &root)
Searches for the name of the TIA module inside of its root expression.
static void fill_temp_vars(statement_list_parse_treet::var_declarationst &parse_tree_list, const exprt &temp_vars)
Adds all temp variable declarations (variable declarations which can't have a default value) to the g...
static typet find_return_value(const exprt &root)
Searches for the return type of a function inside of its root expression.
char * yystatement_listtext
static void fill_vars_with_default_values(statement_list_parse_treet::var_declarationst &parse_tree_list, const exprt &var_list)
Adds all variable declarations (which can have a default value) to the given list.
Statement List Language Parser.
int yystatement_listparse()
Defined in statement_list_y.tab.cpp.
const multi_ary_exprt & to_multi_ary_expr(const exprt &expr)
Cast an exprt to a multi_ary_exprt.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const string_constantt & to_string_constant(const exprt &expr)
Structure for a simple function block in Statement List.
var_declarationst var_static
FB-exclusive static variable declarations.
Structure for a simple function in Statement List.
Represents a regular Statement List instruction which consists out of one or more codet tokens.
void add_token(const codet &token)
Adds a codet element to the list of all tokens.
Representation of a network in Siemens TIA.
Base element of all modules in the Totally Integrated Automation (TIA) portal by Siemens.
var_declarationst var_constant
Constant variable declarations.
var_declarationst var_input
Input variable declarations.
var_declarationst var_inout
Inout variable declarations.
var_declarationst var_temp
Temp variable declarations.
var_declarationst var_output
Output variable declarations.
Struct for a single variable declaration in Statement List.