mescc: Formals, local variables.
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 2 Jan 2017 22:21:33 +0000 (23:21 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 2 Jan 2017 22:21:33 +0000 (23:21 +0100)
commit109cbdd1e7a3789c7b7b465444b9d6bd1126c494
tree2780e1007c50c92f12da756da3aec0a65678c92b
parent57e11b314795b3f86fd943560679390713fa5ded
mescc: Formals, local variables.

* module/language/c99/compiler.mes (statement->text+symbols+locals):
  Rename from statement->text+symbols.  Handle locals.
  (formals->text): Add proper function preamble.
  (formals->locals): Add formals as locals.
  (expr->accu, ident->accu, ident->base, ident-ref, global-ref): New
  functions.
  (strlen, eputs, fputs, puts): New functions.
  (libc): New variable.
  (i386:libc): Rename from libc.  Remove eputs and puts.
* module/mes/libc-i386.mes (i386:eputs, i386:puts: Remove.
  (i386:call, i386:ret): Handle locals as argument.
  (i386:function-locals, i386:function-preamble, i386:jump,
  i386:local->accu, i386:local-add, i386:local-assign,
  i386:local->base, i386:ref-global, i386:ref-local, i386:ret-local,
  i386:mem-byte->accu, i386:test-jump, i386:write): New functions.
* module/mes/libc-i386.scm: Export them.
module/language/c99/compiler.mes
module/mes/libc-i386.mes
module/mes/libc-i386.scm
scaffold/micro-mes.c