Implements "foreach()" command. More...
#include <c_fn_cmd_foreach.h>
Public Member Functions | |
c_fn_cmd_foreach (c_expression *what, const string &key, const string &as, bool as_ref, const string &debug, long id) | |
Constructor. | |
c_fn_cmd_foreach (const c_fn_cmd_foreach &orig) | |
Copy constructor. | |
virtual | ~c_fn_cmd_foreach () |
Destructor. | |
void | add_inputs (vector< var_sym_index_t > &inputs) |
Adds all inputs to vector. | |
void | clean_up () |
Deallocates microcode (if applicable). | |
c_fn_cmd * | copy () |
Creates copy of itself. | |
const string & | get_as () |
Gets "as" variable. | |
bool | get_as_ref () |
Gets "as" variable is referenced flag. | |
const string & | get_debug_string () |
Gets debug string. | |
long | get_end_id () |
Gets ID of commnad after loop. | |
long | get_first_cmd_id () |
Gets ID of first commnad in a loop. | |
long | get_id () |
Gets ID of command. | |
const string & | get_key () |
Gets "key" variable. | |
long | get_next_iteration_id () |
Gets ID of commnad for next iteration. | |
e_cmd_type | get_type () |
Returns type of command. | |
c_expression * | get_what () |
Gets expression. | |
c_fn_cmd_foreach & | operator= (const c_fn_cmd_foreach &orig) |
Assign operator. | |
void | optimize_output (const vector< var_sym_index_t > &inputs) |
Optimizes output by removing result variables taht are not referenced as input. | |
virtual bool | sanity_check (string &msg)=0 |
Performs sanity check. | |
bool | sanity_check (string &msg) |
void | set_end_id (long id) |
Sets ID of commnad after loop. | |
void | set_first_cmd_id (long id) |
Sets ID of first commnad in a loop. | |
void | set_next_iteration_id (long id) |
Sets ID of commnad for next iteration. | |
Protected Attributes | |
string | _debug |
Debug string. | |
long | _id |
Unique ID of command. | |
Private Attributes | |
string | _as |
"as" variable (can be empty) | |
bool | _as_ref |
If "as" is referenced. | |
string | _key |
"key" variable (can be empty) | |
c_expression * | _what |
Expression. | |
long | end_jump_id |
ID of command after loop. | |
long | first_cmd_id |
ID of first command in a loop. | |
long | next_iteration_id |
ID of next iteration command. |
Implements "foreach()" command.
Definition at line 63 of file c_fn_cmd_foreach.h.