diff options
Diffstat (limited to 'src/boot')
-rw-r--r-- | src/boot/ast.boot | 6 | ||||
-rw-r--r-- | src/boot/includer.boot | 4 | ||||
-rw-r--r-- | src/boot/parser.boot | 30 | ||||
-rw-r--r-- | src/boot/pile.boot | 12 | ||||
-rw-r--r-- | src/boot/scanner.boot | 10 | ||||
-rw-r--r-- | src/boot/strap/ast.clisp | 4 | ||||
-rw-r--r-- | src/boot/strap/includer.clisp | 2 | ||||
-rw-r--r-- | src/boot/strap/parser.clisp | 21 | ||||
-rw-r--r-- | src/boot/strap/pile.clisp | 2 | ||||
-rw-r--r-- | src/boot/strap/scanner.clisp | 2 | ||||
-rw-r--r-- | src/boot/strap/tokens.clisp | 2 | ||||
-rw-r--r-- | src/boot/strap/translator.clisp | 9 | ||||
-rw-r--r-- | src/boot/tokens.boot | 4 | ||||
-rw-r--r-- | src/boot/translator.boot | 18 |
14 files changed, 61 insertions, 65 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot index cf186896..9026ea7a 100644 --- a/src/boot/ast.boot +++ b/src/boot/ast.boot @@ -38,8 +38,8 @@ -- for representing Boot programs. -- -module '"boot-ast" -import '"includer" +module ast +import includer )package "BOOTTRAN" @@ -77,7 +77,7 @@ structure %Name == structure %Ast == Command(%String) -- includer command - Module(%String) -- module declaration + %Module(%String) -- module declaration Import(%String) -- import module ImportSignature(Name, Signature) -- import function declaration TypeAlias(%Head, %List) -- type alias definition diff --git a/src/boot/includer.boot b/src/boot/includer.boot index 2f81c55a..bb8da9a9 100644 --- a/src/boot/includer.boot +++ b/src/boot/includer.boot @@ -37,8 +37,8 @@ -- This file defines the includer (or preprocessor) of Boot programs. -- -module '"boot-includer" -import '"tokens" +module includer +import tokens )package "BOOTTRAN" -- BOOT INCLUDER diff --git a/src/boot/parser.boot b/src/boot/parser.boot index af8098b2..224121e7 100644 --- a/src/boot/parser.boot +++ b/src/boot/parser.boot @@ -39,10 +39,10 @@ -- -module '"boot-parser" -import '"includer" -import '"scanner" -import '"ast" +module parser +import includer +import scanner +import ast )package "BOOTTRAN" @@ -415,13 +415,8 @@ bpConstTok() == ++ Module: ++ MODULE QUOTE String bpModule() == - bpEqKey "MODULE" => - -- we really want to check that the next token is indeed - -- a string. For the moment, we delay the type checking - -- to the Lisp compiler/interpreter. That is likely to - -- cause cryptic diagnostics. To be fixed. - bpConstTok() and bpPush Module bpPop1() - false + bpEqKey "MODULE" and (bpName() or bpTrap()) and + bpPush %Module bpPop1() ++ Parse a module import, or a import declaration for a foreign entity. ++ Import: @@ -429,14 +424,11 @@ bpModule() == ++ IMPORT QUOTE String bpImport() == bpEqKey "IMPORT" => - (bpName() and (bpEqKey "FOR" or bpTrap()) and bpSignature() - and bpPush ImportSignature(bpPop2(), bpPop1())) - or - -- we really want to check that the next token is indeed - -- a string. For the moment, we delay the type checking - -- to the Lisp compiler/interpreter. That is likely to - -- cause cryptic diagnostics. To be fixed. - (bpConstTok() and bpPush Import bpPop1()) + bpName() or bpTrap() + bpEqKey "FOR" => + (bpSignature() or bpTrap()) and + bpPush ImportSignature(bpPop2(), bpPop1()) + bpPush Import bpPop1() false -- Parse a type alias defnition: diff --git a/src/boot/pile.boot b/src/boot/pile.boot index 0b8b1651..c5f16064 100644 --- a/src/boot/pile.boot +++ b/src/boot/pile.boot @@ -1,4 +1,6 @@ --- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. +-- All rights reserved. +-- Copyright (C) 2007-2008, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -13,7 +15,7 @@ -- the documentation and/or other materials provided with the -- distribution. -- --- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- - Neither the name of The Numerical Algorithms Group Ltd. nor the -- names of its contributors may be used to endorse or promote products -- derived from this software without specific prior written permission. -- @@ -30,9 +32,9 @@ -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -module '"boot-pile" -import '"includer" -import '"scanner" +module pile +import includer +import scanner )package "BOOTTRAN" shoeFirstTokPosn t== shoeTokPosn CAAR t diff --git a/src/boot/scanner.boot b/src/boot/scanner.boot index cd127781..108fc58a 100644 --- a/src/boot/scanner.boot +++ b/src/boot/scanner.boot @@ -1,4 +1,4 @@ --- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. -- Copyright (C) 2007-2008, Gabriel Dos Reis. -- All rights reserved. @@ -15,7 +15,7 @@ -- the documentation and/or other materials provided with the -- distribution. -- --- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- - Neither the name of The Numerical Algorithms Group Ltd. nor the -- names of its contributors may be used to endorse or promote products -- derived from this software without specific prior written permission. -- @@ -33,9 +33,9 @@ -- -module '"boot-lexer" -import '"tokens" -import '"includer" +module scanner +import tokens +import includer )package "BOOTTRAN" diff --git a/src/boot/strap/ast.clisp b/src/boot/strap/ast.clisp index 5bbd792c..c02bb4a7 100644 --- a/src/boot/strap/ast.clisp +++ b/src/boot/strap/ast.clisp @@ -1,4 +1,4 @@ -(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "boot-ast")) +(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "ast")) (IMPORT-MODULE "includer") @@ -26,7 +26,7 @@ (DEFUN |Command| #0=(|bfVar#2|) (CONS '|Command| (LIST . #0#))) -(DEFUN |Module| #0=(|bfVar#3|) (CONS '|Module| (LIST . #0#))) +(DEFUN |%Module| #0=(|bfVar#3|) (CONS '|%Module| (LIST . #0#))) (DEFUN |Import| #0=(|bfVar#4|) (CONS '|Import| (LIST . #0#))) diff --git a/src/boot/strap/includer.clisp b/src/boot/strap/includer.clisp index d8b645cc..167e7f2a 100644 --- a/src/boot/strap/includer.clisp +++ b/src/boot/strap/includer.clisp @@ -1,4 +1,4 @@ -(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "boot-includer")) +(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "includer")) (IMPORT-MODULE "tokens") diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp index 9a9c2cf7..f7139d25 100644 --- a/src/boot/strap/parser.clisp +++ b/src/boot/strap/parser.clisp @@ -1,4 +1,4 @@ -(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "boot-parser")) +(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "parser")) (IMPORT-MODULE "includer") @@ -443,19 +443,20 @@ ('T (|bpString|)))) (DEFUN |bpModule| () - (COND - ((|bpEqKey| 'MODULE) - (AND (|bpConstTok|) (|bpPush| (|Module| (|bpPop1|))))) - ('T NIL))) + (AND (|bpEqKey| 'MODULE) (OR (|bpName|) (|bpTrap|)) + (|bpPush| (|%Module| (|bpPop1|))))) (DEFUN |bpImport| () (COND ((|bpEqKey| 'IMPORT) - (OR (AND (|bpName|) (OR (|bpEqKey| 'FOR) (|bpTrap|)) - (|bpSignature|) - (|bpPush| (|ImportSignature| (|bpPop2|) (|bpPop1|)))) - (AND (|bpConstTok|) (|bpPush| (|Import| (|bpPop1|)))))) - ('T NIL))) + (PROGN + (OR (|bpName|) (|bpTrap|)) + (COND + ((|bpEqKey| 'FOR) + (AND (OR (|bpSignature|) (|bpTrap|)) + (|bpPush| (|ImportSignature| (|bpPop2|) (|bpPop1|))))) + (#0='T (|bpPush| (|Import| (|bpPop1|))))))) + (#0# NIL))) (DEFUN |bpTypeAliasDefition| () (AND (OR (|bpTerm|) (|bpTrap|)) (|bpEqKey| 'TDEF) (|bpLogical|) diff --git a/src/boot/strap/pile.clisp b/src/boot/strap/pile.clisp index a0f6d6db..2bd3ebb2 100644 --- a/src/boot/strap/pile.clisp +++ b/src/boot/strap/pile.clisp @@ -1,4 +1,4 @@ -(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "boot-pile")) +(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "pile")) (IMPORT-MODULE "includer") diff --git a/src/boot/strap/scanner.clisp b/src/boot/strap/scanner.clisp index 4d3406f4..b5595ebf 100644 --- a/src/boot/strap/scanner.clisp +++ b/src/boot/strap/scanner.clisp @@ -1,4 +1,4 @@ -(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "boot-lexer")) +(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "scanner")) (IMPORT-MODULE "tokens") diff --git a/src/boot/strap/tokens.clisp b/src/boot/strap/tokens.clisp index 97b0f8ff..fdacce47 100644 --- a/src/boot/strap/tokens.clisp +++ b/src/boot/strap/tokens.clisp @@ -1,4 +1,4 @@ -(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "boot-tokens")) +(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "tokens")) (IMPORT-MODULE "initial-env") diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp index d2675cea..ba0b894b 100644 --- a/src/boot/strap/translator.clisp +++ b/src/boot/strap/translator.clisp @@ -1,4 +1,4 @@ -(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "boot-translator")) +(EVAL-WHEN (:COMPILE-TOPLEVEL) (PROVIDE "translator")) (IMPORT-MODULE "includer") @@ -644,14 +644,15 @@ (LET ((|op| (CAR |bfVar#16|)) (|t| (CADR |bfVar#16|))) (|bpPush| (LIST (|genDeclaration| |op| |t|))))) - (|Module| + (|%Module| (LET ((|m| (CAR |bfVar#16|))) (|bpPush| (LIST (|shoeCompileTimeEvaluation| - (LIST 'PROVIDE |m|)))))) + (LIST 'PROVIDE (STRING |m|))))))) (|Import| (LET ((|m| (CAR |bfVar#16|))) - (|bpPush| (LIST (LIST 'IMPORT-MODULE |m|))))) + (|bpPush| + (LIST (LIST 'IMPORT-MODULE (STRING |m|)))))) (|ImportSignature| (LET ((|x| (CAR |bfVar#16|)) (|sig| (CADR |bfVar#16|))) diff --git a/src/boot/tokens.boot b/src/boot/tokens.boot index 8dda774f..8895fe53 100644 --- a/src/boot/tokens.boot +++ b/src/boot/tokens.boot @@ -32,8 +32,8 @@ -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -module '"boot-tokens" -import '"initial-env" +module tokens +import initial_-env )package "BOOTTRAN" diff --git a/src/boot/translator.boot b/src/boot/translator.boot index bfaab592..a4c868f2 100644 --- a/src/boot/translator.boot +++ b/src/boot/translator.boot @@ -33,12 +33,12 @@ -- -module '"boot-translator" -import '"includer" -import '"scanner" -import '"pile" -import '"parser" -import '"ast" +module translator +import includer +import scanner +import pile +import parser +import ast )package "BOOTTRAN" @@ -401,11 +401,11 @@ bpOutItem()== Signature(op,t) => bpPush [genDeclaration(op,t)] - Module(m) => - bpPush [shoeCompileTimeEvaluation ["PROVIDE", m]] + %Module(m) => + bpPush [shoeCompileTimeEvaluation ["PROVIDE", STRING m]] Import(m) => - bpPush [["IMPORT-MODULE", m]] + bpPush [["IMPORT-MODULE", STRING m]] ImportSignature(x, sig) => bpPush genImportDeclaration(x, sig) |