diff options
Diffstat (limited to 'mktpl')
-rw-r--r-- | mktpl/README | 2 | ||||
-rw-r--r-- | mktpl/mktpl.lex | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/mktpl/README b/mktpl/README index 85a2fe3..cb50a6e 100644 --- a/mktpl/README +++ b/mktpl/README @@ -20,7 +20,7 @@ is compiled to the following C code: /* This C code will be executed. */ for(i = 0; i<10; i++) printf("Hello World!\n"); strcpy(s, "This"); - + printf("\n"); printf("%s", s ); printf(" will be evaluated and printed as a string."); diff --git a/mktpl/mktpl.lex b/mktpl/mktpl.lex index e184c0e..296cc0b 100644 --- a/mktpl/mktpl.lex +++ b/mktpl/mktpl.lex @@ -5,12 +5,12 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> - + void apnd(); void eval(); void text(); void prnt(); - + char *buf; int len; int sz; @@ -38,7 +38,7 @@ main(int argc, char *argv[]) sz = 512; if(!(buf = malloc(sz))) err(1, "malloc"); - + yylex(); return 0; } @@ -51,7 +51,7 @@ apnd() if(!(buf = realloc(buf, sz))) err(1, "realloc"); } - + buf[len++] = *yytext; } @@ -66,9 +66,9 @@ void text() { int i, ofs; - + if(!len) return; - + printf("printf(\""); for(i = ofs = 0; i < len; i++){ /* |