mescc: Beginning of expression and test template.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 2 Apr 2017 10:23:00 +0000 (12:23 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 2 Apr 2017 10:23:00 +0000 (12:23 +0200)
commitc83ef66265700a6fe84972ff303ba499ca99fb91
treedb0ce9529e1fdb2ffe1fd96c9c9de4004fc0357b
parent8d1e001ab22dbc6006f08487e44d9e62dd1844d6
mescc: Beginning of expression and test template.

* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
  (make): Add <function> slot.
  (.function): New accessor.
  (clone): Handle it.
  (function->info): Set it.
  (ast->info): Make tests generic in if, for, while.  Add goto, label,
  !, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
  (text->list): Use it.
  (functions->text, function-prefix): New function.
  (function-offset): Use it.
  (label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
  (i386:byte-base-sub): Rename from sub-byte-base.
  (i386:byte-jump-z): Rename from i386:Xjump-byte-z.
  (i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
  (i386:byte-mem->base): Rename from i386:Xmem-byte->base.
  (i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
  i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
  i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
  i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
  i386:xor-zf): New functions.
12 files changed:
GNUmakefile
doc/examples/main.c
module/language/c99/compiler.mes
module/mes/elf-util.mes
module/mes/elf-util.scm
module/mes/elf.mes
module/mes/libc-i386.mes
module/mes/libc-i386.scm
scaffold/micro-mes.c
scaffold/mini-mes.c
scaffold/t.c [new file with mode: 0644]
tests/optargs.test