From 80f5cef01abdaee3b8c818ea07f534570e94c6d4 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 14 Oct 2007 03:36:45 +0000 Subject: * 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. --- src/boot/ast.boot.pamphlet | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'src/boot/ast.boot.pamphlet') 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) -- cgit v1.2.3