diff options
author | dos-reis <gdr@axiomatics.org> | 2007-10-14 03:36:45 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2007-10-14 03:36:45 +0000 |
commit | 80f5cef01abdaee3b8c818ea07f534570e94c6d4 (patch) | |
tree | a8e9a1ed8f745178fada289d18cf5c3c1a472e1e /src/boot/ast.boot.pamphlet | |
parent | c4d8dec2eec9c0eb7ae6639ecc0dd607a97b37b7 (diff) | |
download | open-axiom-80f5cef01abdaee3b8c818ea07f534570e94c6d4.tar.gz |
* ast.boot.pamphlet (bfGetOldBootName): New.
(bfSameMeaning): Likewise.
(bfReName): Use them.
* parser.boot.pamphlet (bpCompare): Tidy.
* tokens.boot.pamphlet: Rename NE to SHOENE. Record Old Boot
renaming tokens. Likewise for tokens with same meaning.
* translator.boot.pamphlet (AxiomCore::%sysInit): New.
($translatingOldBoot): Likewise.
Diffstat (limited to 'src/boot/ast.boot.pamphlet')
-rw-r--r-- | src/boot/ast.boot.pamphlet | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/src/boot/ast.boot.pamphlet b/src/boot/ast.boot.pamphlet index 25d982f5..761175bc 100644 --- a/src/boot/ast.boot.pamphlet +++ b/src/boot/ast.boot.pamphlet @@ -664,12 +664,42 @@ bfApplication(bfop, bfarg) == then cons(bfop,CDR bfarg) else cons(bfop,[bfarg]) - + +++ Token renaming. New Boot and Old Boot differs in the set of +++ tokens they rename. When converting code written in Old Boot +++ to New Boot, it is helpful to have some noise about potential +++ divergence in semantics. So, when compiling with --boot=old, +++ we compute the renaming in both Old Boot and New Boot and compare +++ the results. If they differ, we prefer the old meaning, with some +++ warnings. Notice that the task is compounded by the fact the +++ tokens in both language do not always agreee. +++ However, to minimize the flood of false positive, we +++ keep a list of symbols which apparently differ in meanings, but +++ which have been verified to agree. +++ This is a valuable automated tool during the transition period. + +-- return the meaning of the x in Old Boot. +bfGetOldBootName x == + a := GET(x, "OLD-BOOT") => car a + x + +-- returns true if x has same meaning in both Old Boot and New Boot. +bfSameMeaning x == + GET(x, 'RENAME_-OK) + +-- returns the meaning of x in the appropriate Boot dialect. bfReName x== - a:=GET(x,"SHOERENAME") - if a - then car a - else x + newName := + a := GET(x,"SHOERENAME") => car a + x + $translatingOldBoot and not bfSameMeaning x => + oldName := bfGetOldBootName x + if newName ^= oldName then + warn [PNAME x, '" as `", PNAME newName, _ + '"_' differs from Old Boot `", PNAME oldName, '"_'"] + oldName + newName + bfInfApplication(op,left,right)== EQ(op,"EQUAL") => bfQ(left,right) |