User Tools

Site Tools


access_information_in_a_complex_expression

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
access_information_in_a_complex_expression [2013/07/15 14:39]
lliang
access_information_in_a_complex_expression [2013/07/15 20:37] (current)
lliang
Line 29: Line 29:
 </​code>​ </​code>​
  
-If you would like to, for example, retrieve the value of the last function field appeared in the example above which is p0, observe that the value is located in the first argument of the second operand in the code object. So we first locate the the second operand ​of code which is of type symbol by the following statement:+If you'​d ​like to, for example, retrieve the value of the last function field appeared in the example above (i.e. p0), observe that the value is located in the first argument of the second operand in the code object. So we first locate the the second operand which is of type symbol by the following statement:
  
 <​code>​exprt args_expr=*(++(code.operands().begin()));</​code>​ <​code>​exprt args_expr=*(++(code.operands().begin()));</​code>​
  
-Then p0, the value of the last function field appeared ​in our example, can be retrieved as follows:+Then p0, the value that we are interested ​in, can be retrieved as follows:
  
 <​code>​ <​code>​
Line 39: Line 39:
 </​code>​ </​code>​
  
-Note that in some cases helper functions, such as to_code_type() in our example, should be used to convert expression to its appropriate type before retrieving its values. ​+Note that in some cases helper functions, such as to_code_type() in our example, should be used to convert ​an expression to its appropriate type before retrieving its values. ​
access_information_in_a_complex_expression.txt ยท Last modified: 2013/07/15 20:37 by lliang