source: CIVL/examples/languageFeatures/enum2.cvl@ a8ca3d3

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

implemented enumeration type; checked in tests languageFeatures/enum1.cvl and enum2.cvl, which currently fail because some problem from ABC.

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

  • Property mode set to 100644
File size: 509 bytes
Line 
1#include <stdio.h>
2int main(){
3 int const x = 9;
4 enum hue { A, B = 4, C, D=B};
5 enum huf {H, I, J, K};
6 enum hue a = A, b = B, c = C, d = D;
7 enum hue h = (enum hue) J;
8 int y = x + C;
9
10 if(1 > 0){
11 enum hf { A=10 };
12 int k = A;
13
14 printf("k = %d\n", k);
15 }
16
17 printf("a = %d\n", a);
18 printf("b = %d\n", b);
19 printf("c = %d\n", c);
20 printf("d = %d\n", d);
21// printf("e = %d\n", e);
22// printf("f = %d\n", f);
23// printf("g = %d\n", g);
24 printf("h = %d\n", h);
25 printf("y = %d\n", y);
26}
Note: See TracBrowser for help on using the repository browser.