diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/boot/parser.boot | 15 | ||||
-rw-r--r-- | src/boot/strap/parser.clisp | 31 | ||||
-rw-r--r-- | src/boot/strap/translator.clisp | 29 | ||||
-rw-r--r-- | src/boot/translator.boot | 11 |
5 files changed, 50 insertions, 42 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index fc878a1c..cc8d61ed 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2009-08-29 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * boot/translator.boot (bpOutItem): Move to parser.boot. + * boot/parser.boot (bpExceptionTail): Fix typo. + (bpOutItem): Move from translator.boot. + 2009-08-28 Gabriel Dos Reis <gdr@cs.tamu.edu> * boot/ast.boot (bfCase): Don't introduce temporary for scrutinee diff --git a/src/boot/parser.boot b/src/boot/parser.boot index bd774842..255c065b 100644 --- a/src/boot/parser.boot +++ b/src/boot/parser.boot @@ -741,7 +741,7 @@ bpExceptionHead() == bpExceptionTail() == bpEqKey "EXIT" and (bpAssign() or bpTrap()) and - bpPush Exit(bpPop2(),bpPop1()) + bpPush %Exit(bpPop2(),bpPop1()) ++ Exception: ++ ExpcetionHead @@ -1173,3 +1173,16 @@ bpCaseItem()== (bpWhere() or bpTrap()) and bpPush bfCaseItem (bpPop2(),bpPop1()) + +++ Main entry point into the parser module. +bpOutItem()== + $op := nil + bpComma() or bpTrap() + b:=bpPop1() + bpPush + EQCAR(b,"+LINE")=> [ b ] + b is ["L%T",l,r] and IDENTP l => + $InteractiveMode => [["SETQ",l,r]] + [["DEFPARAMETER",l,r]] + translateToplevel(b,false) + diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp index 38e0da5d..c4e3cd30 100644 --- a/src/boot/strap/parser.clisp +++ b/src/boot/strap/parser.clisp @@ -781,7 +781,7 @@ (DEFUN |bpExceptionTail| () (AND (|bpEqKey| 'EXIT) (OR (|bpAssign|) (|bpTrap|)) - (|bpPush| (|Exit| (|bpPop2|) (|bpPop1|))))) + (|bpPush| (|%Exit| (|bpPop2|) (|bpPop1|))))) (DEFUN |bpException| () (AND (|bpExceptionHead|) (OR (|bpExceptionTail|) T))) @@ -1196,3 +1196,32 @@ (OR (|bpEqKey| 'EXIT) (|bpTrap|)) (OR (|bpWhere|) (|bpTrap|)) (|bpPush| (|bfCaseItem| (|bpPop2|) (|bpPop1|))))) +(DEFUN |bpOutItem| () + (PROG (|r| |ISTMP#2| |l| |ISTMP#1| |b|) + (DECLARE (SPECIAL |$InteractiveMode| |$op|)) + (RETURN + (PROGN + (SETQ |$op| NIL) + (OR (|bpComma|) (|bpTrap|)) + (SETQ |b| (|bpPop1|)) + (|bpPush| + (COND + ((EQCAR |b| '+LINE) (LIST |b|)) + ((AND (CONSP |b|) (EQ (CAR |b|) 'L%T) + (PROGN + (SETQ |ISTMP#1| (CDR |b|)) + (AND (CONSP |ISTMP#1|) + (PROGN + (SETQ |l| (CAR |ISTMP#1|)) + (SETQ |ISTMP#2| (CDR |ISTMP#1|)) + (AND (CONSP |ISTMP#2|) + (EQ (CDR |ISTMP#2|) NIL) + (PROGN + (SETQ |r| (CAR |ISTMP#2|)) + 'T))))) + (IDENTP |l|)) + (COND + (|$InteractiveMode| (LIST (LIST 'SETQ |l| |r|))) + (#0='T (LIST (LIST 'DEFPARAMETER |l| |r|))))) + (#0# (|translateToplevel| |b| NIL)))))))) + diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp index 056fe0ec..2a886455 100644 --- a/src/boot/strap/translator.clisp +++ b/src/boot/strap/translator.clisp @@ -723,35 +723,6 @@ (LIST (LIST 'IN-PACKAGE (STRING |n|)))))) (T (LIST (|translateToplevelExpression| |b|)))))))))) -(DEFUN |bpOutItem| () - (PROG (|r| |ISTMP#2| |l| |ISTMP#1| |b|) - (DECLARE (SPECIAL |$InteractiveMode| |$op|)) - (RETURN - (PROGN - (SETQ |$op| NIL) - (OR (|bpComma|) (|bpTrap|)) - (SETQ |b| (|bpPop1|)) - (|bpPush| - (COND - ((EQCAR |b| '+LINE) (LIST |b|)) - ((AND (CONSP |b|) (EQ (CAR |b|) 'L%T) - (PROGN - (SETQ |ISTMP#1| (CDR |b|)) - (AND (CONSP |ISTMP#1|) - (PROGN - (SETQ |l| (CAR |ISTMP#1|)) - (SETQ |ISTMP#2| (CDR |ISTMP#1|)) - (AND (CONSP |ISTMP#2|) - (EQ (CDR |ISTMP#2|) NIL) - (PROGN - (SETQ |r| (CAR |ISTMP#2|)) - 'T))))) - (IDENTP |l|)) - (COND - (|$InteractiveMode| (LIST (LIST 'SETQ |l| |r|))) - (#0='T (LIST (LIST 'DEFPARAMETER |l| |r|))))) - (#0# (|translateToplevel| |b| NIL)))))))) - (DEFUN |shoeAddbootIfNec| (|s|) (|shoeAddStringIfNec| ".boot" |s|)) (DEFUN |shoeRemovebootIfNec| (|s|) diff --git a/src/boot/translator.boot b/src/boot/translator.boot index 15a0bcf2..42e9624f 100644 --- a/src/boot/translator.boot +++ b/src/boot/translator.boot @@ -455,17 +455,6 @@ translateToplevel(b,export?) == [translateToplevelExpression b] -bpOutItem()== - $op := nil - bpComma() or bpTrap() - b:=bpPop1() - bpPush - EQCAR(b,"+LINE")=> [ b ] - b is ["L%T",l,r] and IDENTP l => - $InteractiveMode => [["SETQ",l,r]] - [["DEFPARAMETER",l,r]] - translateToplevel(b,false) - shoeAddbootIfNec s == shoeAddStringIfNec('".boot",s) |