CBMC
java_string_literals.cpp File Reference
+ Include dependency graph for java_string_literals.cpp:

Go to the source code of this file.

Functions

static array_exprt utf16_to_array (const std::wstring &in)
 Convert UCS-2 or UTF-16 to an array expression. More...
 
symbol_exprt get_or_create_string_literal_symbol (const java_string_literal_exprt &string_expr, symbol_table_baset &symbol_table, bool string_refinement_enabled)
 Creates or gets an existing constant global symbol for a given string literal. More...
 
symbol_exprt get_or_create_string_literal_symbol (const irep_idt &string_value, symbol_table_baset &symbol_table, bool string_refinement_enabled)
 Same as get_or_create_string_literal_symbol(const exprt&, symbol_table_baset&, bool) except it takes an id/string parameter rather than a string literal exprt. More...
 

Function Documentation

◆ get_or_create_string_literal_symbol() [1/2]

symbol_exprt get_or_create_string_literal_symbol ( const irep_idt string_value,
symbol_table_baset symbol_table,
bool  string_refinement_enabled 
)

Same as get_or_create_string_literal_symbol(const exprt&, symbol_table_baset&, bool) except it takes an id/string parameter rather than a string literal exprt.

Definition at line 186 of file java_string_literals.cpp.

◆ get_or_create_string_literal_symbol() [2/2]

symbol_exprt get_or_create_string_literal_symbol ( const java_string_literal_exprt string_expr,
symbol_table_baset symbol_table,
bool  string_refinement_enabled 
)

Creates or gets an existing constant global symbol for a given string literal.

Parameters
string_exprstring literal expression to convert
symbol_tableglobal symbol table. If not already present, constant global symbols will be added.
string_refinement_enabledif true, string refinement's string data structure will also be initialised and added to the symbol table.
Returns
a symbol_expr corresponding to the new or existing literal symbol.

Definition at line 36 of file java_string_literals.cpp.

◆ utf16_to_array()

static array_exprt utf16_to_array ( const std::wstring &  in)
static

Convert UCS-2 or UTF-16 to an array expression.

Parameters
inwide string to convert
Returns
Returns a Java char array containing the same wchars.

Definition at line 26 of file java_string_literals.cpp.