Added flags to language specifiction. Added optional expect string to language specification. Added some exaple grammars for testing and demos

This commit is contained in:
Daniel Holden
2014-01-26 11:25:50 +00:00
parent 8931782986
commit d5e2bdf977
17 changed files with 942 additions and 269 deletions

21
examples/fib.smallc Normal file
View File

@@ -0,0 +1,21 @@
#include "stdio.h"
int fib(int n) {
if (n == 0) { return 0; }
if (n == 1) { return 1; }
return fib(n - 1) + fib(n - 2);
}
main() {
int n;
int i;
while (i < 10) {
n = fib(10);
print(n);
i = i + 1;
}
return 0;
}