source: CIVL/examples/specialStatements/choose1.cvl@ e2877ba

1.23 2.0 main test-branch
Last change on this file since e2877ba was f654c25, checked in by Manchun Zheng <zmanchun@…>, 11 years ago

cleaned up the translation of $choose and $when; added examples and tests accordinly.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@2626 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 340 bytes
Line 
1#include<civlc.cvh>
2
3int main(){
4 int *ptr, x=1, y=2;
5
6 $choose{
7 if(x<=1){
8 int a1=0;
9 y=a1;
10 }else{
11 y=x+1;
12 }
13 $when(x<5){
14 $when(y>1){
15 y=10;
16 int z=19;
17 x=z;
18 }
19 }
20 {ptr=(int*)$malloc($root, sizeof(int)); $free(ptr);}
21 {int q=sizeof(int); ptr=(int*)$malloc($here, q); $free(ptr);}
22 }
23}
Note: See TracBrowser for help on using the repository browser.