C compiler with embedded metalanguage.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
388 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;
}
int main()
{
@{
if (useForLoop) {
@@.append(forLoop);
} else {
@@.append(whileLoop);
}
@@;
};
return 0;
}