diff options
author | dos-reis <gdr@axiomatics.org> | 2008-01-28 21:13:46 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-01-28 21:13:46 +0000 |
commit | 1eac6c122d6a62d8ce3eeced8c3b1b6b97108498 (patch) | |
tree | 82aa9a05557e7fc955c32c164eee167045de9917 /src/boot/translator.boot | |
parent | a27cc2ac7bf6a0ad60cc6c9f949a988d0444bb4e (diff) | |
download | open-axiom-1eac6c122d6a62d8ce3eeced8c3b1b6b97108498.tar.gz |
Support signature declaration in Boot.
* boot/ast.boot (bfUntuple): New.
(bfTagged): Toplevel tags are signatures.
* boot/parser.boot (bpTyping): New.
(bpTagged): Use it.
* boot/translator.boot (genDeclaration): New.
(bpOutItem): Use it.
* interp/compiler.boot: Add type annotations for compiler routines.
* lisp/Makefile.in ($(OUT)/lisp$(EXEEXT)): Don't turn on emit-fn.
Diffstat (limited to 'src/boot/translator.boot')
-rw-r--r-- | src/boot/translator.boot | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/boot/translator.boot b/src/boot/translator.boot index 0fc79fa0..8d866052 100644 --- a/src/boot/translator.boot +++ b/src/boot/translator.boot @@ -351,7 +351,17 @@ shoeOutParse stream == nil else CAR $stack +++ Generate a global signature declaration for symbol `n'. +genDeclaration(n,t) == + t is ["Mapping",valType,argTypes] => + if bfTupleP argTypes then argTypes := cdr argTypes + if not null argTypes and SYMBOLP argTypes + then argTypes := [argTypes] + ["DECLAIM",["FTYPE",["FUNCTION",argTypes,valType],n]] + ["DECLAIM",["TYPE",t,n]] + bpOutItem()== + $op := nil bpComma() or bpTrap() b:=bpPop1() EQCAR(b,"TUPLE")=> bpPush cdr b @@ -359,6 +369,9 @@ bpOutItem()== b is ["L%T",l,r] and IDENTP l => bpPush [["DEFPARAMETER",l,r]] case b of + Signature(op,t) => + bpPush [genDeclaration(op,t)] + Module(m) => bpPush [shoeCompileTimeEvaluation ["PROVIDE", m]] |