aboutsummaryrefslogtreecommitdiff
path: root/src/interp/scan.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-07-25 02:06:33 +0000
committerdos-reis <gdr@axiomatics.org>2008-07-25 02:06:33 +0000
commitf04d1f935b8e4b87ca156932b723a323ef8808d9 (patch)
treec299553e11656af53c87085f302cbc4a2cd4b444 /src/interp/scan.boot
parent6f81cf3841d7ab68ab859fd5fc14cd847fab1fa2 (diff)
downloadopen-axiom-f04d1f935b8e4b87ca156932b723a323ef8808d9.tar.gz
2008-07-24 Gabriel Dos Reis <gdr@cs.tamu.edu>
* interp/scan.boot: Tidy. * interp/ptrees.boot: Define AST for type schemes. * interp/cparse.boot (npType): Parse type schemes. (npQuantifierVariable): New. (npADD): Accept only monotypes. * interp/pf2sex.boot (pf2Sex1): Handle type schemes. (pfQuantified2Sex): New. 2008-07-23 Gabriel Dos Reis <gdr@cs.tamu.edu> * interp/cparse.boot (npMonoType): Rename from npType.
Diffstat (limited to 'src/interp/scan.boot')
-rw-r--r--src/interp/scan.boot35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/interp/scan.boot b/src/interp/scan.boot
index 34dc2bb6..188184c8 100644
--- a/src/interp/scan.boot
+++ b/src/interp/scan.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007, Gabriel Dos Reis.
+-- Copyright (C) 2007-2008, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -36,26 +36,27 @@ import bits
import dq
import incl
namespace BOOT
+module scan
--% Separators
-$SPACE := QENUM('" ", 0)
-ESCAPE := QENUM('"__ ", 0)
-STRING_CHAR := QENUM('"_" ", 0)
-PLUSCOMMENT := QENUM('"+ ", 0)
-MINUSCOMMENT:= QENUM('"- ", 0)
-RADIX_CHAR := QENUM('"r ", 0)
-DOT := QENUM('". ", 0)
-EXPONENT1 := QENUM('"E ", 0)
-EXPONENT2 := QENUM('"e ", 0)
-CLOSEPAREN := QENUM('") ", 0)
-CLOSEANGLE := QENUM('"> ", 0)
-QUESTION := QENUM('"? ",0)
+$SPACE == QENUM('" ", 0)
+ESCAPE == QENUM('"__ ", 0)
+STRING_CHAR == QENUM('"_" ", 0)
+PLUSCOMMENT == QENUM('"+ ", 0)
+MINUSCOMMENT == QENUM('"- ", 0)
+RADIX_CHAR == QENUM('"r ", 0)
+DOT == QENUM('". ", 0)
+EXPONENT1 == QENUM('"E ", 0)
+EXPONENT2 == QENUM('"e ", 0)
+CLOSEPAREN == QENUM('") ", 0)
+CLOSEANGLE == QENUM('"> ", 0)
+QUESTION == QENUM('"? ",0)
--% Keywords
-scanKeyWords := [ _
+scanKeyWords == [ _
['"add", "ADD" ],_
['"and", "AND" ],_
['"break", "BREAK" ],_
@@ -65,8 +66,10 @@ scanKeyWords := [ _
['"define", "DEFN" ],_
['"do", "DO"],_
['"else", "ELSE" ],_
+ ['"exist", "EXIST"],_
['"exit", "EXIT" ],_
['"export","EXPORT" ],_
+ ['"forall", "FORALL"],_
['"for", "FOR" ],_
['"free", "FREE" ],_
['"from", "FROM" ],_
@@ -294,7 +297,7 @@ lineoftoks(s)==
else cons([[toks,s]],$r)
-scanToken () ==
+scanToken() ==
ln:=$ln
c:=QENUM($ln,$n)
linepos:=$linepos
@@ -451,7 +454,7 @@ scanPossFloat (w)==
w:=spleI(function digit?)
scanExponent('"0",w)
-scanCloser:=[")","}","]","|)","|}","|]"]
+scanCloser == [")","}","]","|)","|}","|]"]
scanCloser? w== MEMQ(keyword w,scanCloser)