cvsuser 03/10/11 22:13:20
Modified: languages/cola cola.h cola.y gen.c
Log:
Move support routines out to core.imc
Revision Changes Path
1.18 +0 -1 parrot/languages/cola/cola.h
Index: cola.h
===================================================================
RCS file: /cvs/public/parrot/languages/cola/cola.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -r1.17 -r1.18
--- cola.h 7 Oct 2003 03:07:34 -0000 1.17
+++ cola.h 12 Oct 2003 05:13:19 -0000 1.18
@@ -351,7 +351,6 @@
AST *cur_method;
/* Code generation phase */
-void gen_bootstrap();
void gen_ast(AST * ast);
void gen_namespace_decl(AST *);
void gen_class_decl(AST *);
1.20 +2 -1 parrot/languages/cola/cola.y
Index: cola.y
===================================================================
RCS file: /cvs/public/parrot/languages/cola/cola.y,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -r1.19 -r1.20
--- cola.y 7 Oct 2003 03:07:34 -0000 1.19
+++ cola.y 12 Oct 2003 05:13:19 -0000 1.20
@@ -1050,7 +1050,8 @@
gen_ast(ast_start);
}
- gen_bootstrap();
+ printf("# Include standard API stuff\n");
+ printf(".include \"core.imc\"\n\n");
fflush(stdout);
fprintf(stderr, "%ld lines compiled.\n", line);
fprintf(stderr, "Execing Parrot (IMCC)\n");
1.18 +0 -22 parrot/languages/cola/gen.c
Index: gen.c
===================================================================
RCS file: /cvs/public/parrot/languages/cola/gen.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -r1.17 -r1.18
--- gen.c 23 Sep 2003 18:06:04 -0000 1.17
+++ gen.c 12 Oct 2003 05:13:19 -0000 1.18
@@ -51,28 +51,6 @@
}
}
-void gen_bootstrap() {
- /*
- * Kludge, generate a limited support library until
- * I can import modules
- */
- const char * saveregs = "pushi\npushn\npushs\n";
- const char * restoreregs = "pops\npopn\npopi\n";
- printf("\n.emit\n");
- printf("\n__puts:\npushs\nrestore S31\nprint S31\npops\nret\n");
- printf("\n__puti:\npushi\nrestore I31\nprint I31\npopi\nret\n");
- printf("\n__putf:\npushn\nrestore N31\nprint N31\npopn\nret\n");
- printf("\n__substr:\n%srestore I31\nrestore I30\nrestore S31\nsubstr S30, S31,
I30, I31\nsave S30\n%sret\n",
- saveregs, restoreregs);
- printf("\n__strlen:\npushs\npushi\nrestore S0\nlength I0, S0\nsave
I0\npops\npopi\nret\n");
- printf("\n__strchop:\npushs\nrestore S0\nchopn S0, 1\nsave S0\npops\nret\n");
- printf("\n__strrep:\npushs\npushi\nrestore S30\nrestore I31\nrestore
I30\nrestore S31\nsubstr S31, I30, I31, S30\nsave S31\npops\npopi\nret\n");
- printf("\n__ord:\npushs\npushi\nrestore S0\nord I0, S0\nsave
I0\npops\npopi\nret\n");
- printf("\n__gets:\npushs\nread S0, 512\nsave S0\npops\nret\n");
- printf("\n__sleep:\npushi\nrestore I0\nsleep I0\npopi\nret\n");
- printf(".eom\n");
-}
-
void gen_namespace_decl(AST * p) {
printf("#.namespace %s\n", p->sym->name);
if(p->arg1)