C compiler with embedded metalanguage.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
589 B

@{
nTimes = `constant 10;
forLoop = `statement for (int i = 0; i < 10; ++i) printf("%d\n", i); ;
whileLoop = `statement while (i < 10) { printf("%d\n", i); ++il; };
useForLoop = 1;
x = null;
}
@{forLoop = `statement for (int i = 0; i < 10; ++i) printf("%d\n", i);;}
@{if (useForLoop) { x = forLoop;} else { x = whileLoop; } }
int main()
{
@(x);
@(`statement for (int i = 0; i < @(nTimes); ++i) printf("%d\n", i););
@{if (useForLoop) {forLoop;} else {whileLoop;}}; // Impossible to modify useForLoop in a function
return 0;
}