mescc: Mini-mes (gcc-compiled) runs read-0.mes.
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 22 Mar 2017 05:39:24 +0000 (06:39 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 22 Mar 2017 05:39:24 +0000 (06:39 +0100)
commit98f64ae516a89002ea51a277a7f39dc697ae465e
treed6c91f493183910ca97e47c1d02fb310a9e890ce
parent240f2814f42c0b0ac13420764247b2f7f0821ac5
mescc: Mini-mes (gcc-compiled) runs read-0.mes.

* module/language/c99/compiler.mes (expr->accu): Add mul.
  (test->jump->info): Add le, ge.
  (ast->info): Support int and char* initialization at top level.
* module/mes/as-i386.mes (i386:accu*base, i386:Xjump-cz,
  i386:Xjump-ncz): New function.
* module/mes/as-i386.scm: Export them.
* doc/examples/t.c (test): Test them.
* module/mes/libc.mes (ungetc): New function.
  (getchar): Support it.
  (assert_fail, isdigit): New functions.
  (libc): Export them.
* module/mes/mini-0.mes: Load full reader.
* mlibc.c (ungetc): New function.
  (getchar): Support it.
  (assert_fail, isdigit): New functions.
* mes.c (list length error lookup_ getchar ungetchar peekchar
  peek_byte read_byte unread_byte greater_p less_p): Move functions
  needed to run read-0.mes into core.
* doc/examples/mini-mes.c: Likewise.
* lib.c (length, error): Comment-out.
* math.c (greater_p, less_p): Comment-out.
* posix.c: (getchar, ungetchar, peekchar, peek_byte, read_byte,
  unread_byte): Comment-out.
* reader.c (lookup_): Comment-out.
13 files changed:
lib.c
math.c
mes.c
mlibc.c
module/language/c99/compiler.mes
module/mes/as-i386.mes
module/mes/as-i386.scm
module/mes/libc.mes
module/mes/mini-0.mes
posix.c
reader.c
scaffold/mini-mes.c
scaffold/t.c