Subset of C language with tree interpreter and bytecode compiler + VM.
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.
 
 

36 lines
692 B

#!./main
#include <stdio.h>
int x = 21;
int baz(int xx, ...) { return 42; }
int foo(void) { return x + x; }
char *bar(void) { return "bye bye"; }
int main(int argc, char **argv)
{
printf("hello, world %d %s\n", foo(), bar());
printf("baz is %d %d %d\n", baz(1), baz(1, 2), baz(1, "two", 3));
int x = 42;
int *p = &x;
printf("x is %d p is %p\n", *p, p);
*p = 666;
printf("x is %d %d\n", x, *p);
x = 123;
printf("x is %d %d\n", x, *p);
for (x = 0; x < 10; ++x) {
if (x == 5) printf("%%");
printf("%d ", x);
}
printf("\n");
while (x > 0) printf("%d ", --x);
printf("\n");
return 0;
}
// Local Variables:
// mode: c
// End: