diff options
author | dos-reis <gdr@axiomatics.org> | 2010-07-27 21:50:57 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-07-27 21:50:57 +0000 |
commit | b096b33583bf6357cdb6baaaa9232c179b6b2d24 (patch) | |
tree | 97906841a404480a7b5af9c6112ac6a76ee24510 /src/boot/strap | |
parent | 1fa9b881cc958d00fefed9ddc8eb4ebae7a04c54 (diff) | |
download | open-axiom-b096b33583bf6357cdb6baaaa9232c179b6b2d24.tar.gz |
* boot/tokens.boot: quo and rem are now keywords and infix operators.
* boot/parser.boot (bpEuclid): New. Parse integer quotient and
remainder expressions.
(bpMinus): Now build on bpEuclid instead of bpTimes.
Diffstat (limited to 'src/boot/strap')
-rw-r--r-- | src/boot/strap/parser.clisp | 6 | ||||
-rw-r--r-- | src/boot/strap/tokens.clisp | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp index 802fc8bc..078f48a7 100644 --- a/src/boot/strap/parser.clisp +++ b/src/boot/strap/parser.clisp @@ -697,10 +697,12 @@ (DEFUN |bpTimes| () (OR (|bpReduce|) (|bpLeftAssoc| '(TIMES SLASH) #'|bpExpt|))) +(DEFUN |bpEuclid| () (|bpLeftAssoc| '(QUO REM) #'|bpTimes|)) + (DEFUN |bpMinus| () - (OR (AND (|bpInfGeneric| '(MINUS)) (OR (|bpTimes|) (|bpTrap|)) + (OR (AND (|bpInfGeneric| '(MINUS)) (OR (|bpEuclid|) (|bpTrap|)) (|bpPush| (|bfApplication| (|bpPop2|) (|bpPop1|)))) - (|bpTimes|))) + (|bpEuclid|))) (DEFUN |bpArith| () (|bpLeftAssoc| '(PLUS MINUS) #'|bpMinus|)) diff --git a/src/boot/strap/tokens.clisp b/src/boot/strap/tokens.clisp index 94923a97..81c97675 100644 --- a/src/boot/strap/tokens.clisp +++ b/src/boot/strap/tokens.clisp @@ -12,8 +12,9 @@ (LIST "if" 'IF) (LIST "import" 'IMPORT) (LIST "in" 'IN) (LIST "is" 'IS) (LIST "isnt" 'ISNT) (LIST "leave" 'LEAVE) (LIST "module" 'MODULE) (LIST "namespace" 'NAMESPACE) - (LIST "of" 'OF) (LIST "or" 'OR) (LIST "repeat" 'REPEAT) - (LIST "return" 'RETURN) (LIST "structure" 'STRUCTURE) + (LIST "of" 'OF) (LIST "or" 'OR) (LIST "rem" 'REM) + (LIST "repeat" 'REPEAT) (LIST "return" 'RETURN) + (LIST "quo" 'QUO) (LIST "structure" 'STRUCTURE) (LIST "then" 'THEN) (LIST "throw" 'THROW) (LIST "try" 'TRY) (LIST "until" 'UNTIL) (LIST "where" 'WHERE) (LIST "while" 'WHILE) (LIST "." 'DOT) (LIST ":" 'COLON) @@ -165,6 +166,7 @@ (EVAL-WHEN (:EXECUTE :LOAD-TOPLEVEL) (LET ((|bfVar#7| (LIST (LIST 'SHOEEQ '=) (LIST 'TIMES '*) + (LIST 'REM '|rem|) (LIST 'QUO '|quo|) (LIST 'PLUS '+) (LIST 'IS '|is|) (LIST 'ISNT '|isnt|) (LIST 'AND '|and|) (LIST 'OR '|or|) (LIST 'SLASH '/) @@ -237,6 +239,7 @@ (LIST '|writeByte| 'WRITE-BYTE) (LIST '|writeLine| 'WRITE-LINE) (LIST 'PLUS '+) (LIST 'MINUS '-) (LIST 'TIMES '*) (LIST 'POWER 'EXPT) + (LIST 'REM 'REM) (LIST 'QUO 'TRUNCATE) (LIST 'SLASH '/) (LIST 'LT '<) (LIST 'GT '>) (LIST 'LE '<=) (LIST 'GE '>=) (LIST 'SHOEEQ 'EQUAL) (LIST 'SHOENE '/=) (LIST 'T 'T$))) |