--- a/Make.proto Sun Feb 26 19:21:00 1995 +0100
+++ b/Make.proto Sun Feb 26 19:21:09 1995 +0100
@@ -1,4 +1,4 @@
-# $Header: /cvs/stx/stx/libcomp/Make.proto,v 1.19 1995-02-24 15:26:32 claus Exp $
+# $Header: /cvs/stx/stx/libcomp/Make.proto,v 1.20 1995-02-26 18:21:09 claus Exp $
#
# -------------- no need to change anything below ----------
@@ -10,7 +10,7 @@
STCOPT=$(LIBCOMP_STCOPT)
STCLOCALOPT=-Pcompiler-classes $(COMMONSYMBOLS)
-all:: abbrev.stc objs classList.stc $(OBJTARGET) $(LIBCOMP_MORE)
+all:: abbrev.stc $(UNCRITICALOBJS) objs classList.stc $(OBJTARGET) $(LIBCOMP_MORE)
#
# although all files are compiled in here,
@@ -21,11 +21,19 @@
| grep -v ObjFLoader.$(O) \
| grep -v libcompInit.$(O)`
-objs:: \
+#
+# these are uncritical - save some bytes by compiling with optspace
+#
+UNCRITICALOBJS= \
+ Explainer.$(O) \
+ UndefVar.$(O) \
+ SrcFLoader.$(O)
+
+OBJS= \
Scanner.$(O) \
Parser.$(O) \
BCompiler.$(O) \
- EXPLAINER \
+ Explainer.$(O) \
Variable.$(O) \
ParseNode.$(O) \
PrimaryNd.$(O) \
@@ -42,9 +50,9 @@
UnaryNd.$(O) \
BinaryNd.$(O) \
CascadeNd.$(O) \
- UNDEFVAR \
+ UndefVar.$(O) \
LazyMethod.$(O) \
- SRCFLOADER \
+ SrcFLoader.$(O) \
ImmArray.$(O) \
$(EXTRA_LIBCOMP)
@@ -54,16 +62,13 @@
$(STC) -CC="$(CC)" $(STCFLAGS) +shortNames $(CFLAGS) -c $*.st
#
-# these are uncritical - save some bytes by compiling with optspace
+# these are not time critical
#
-EXPLAINER:
- $(MAKE) Explainer.$(O) STCOPT="$(LIBCOMP_STCOPT) +optspace2"
+$(UNCRITICALOBJS):
+ @$(MAKE) UNCRITICAL NAME=$*.st
-SRCFLOADER:
- $(MAKE) SrcFLoader.$(O) STCOPT="$(LIBCOMP_STCOPT) +optspace2"
-
-UNDEFVAR:
- $(MAKE) UndefVar.$(O) STCOPT="$(LIBCOMP_STCOPT) +optspace2"
+UNCRITICAL:
+ $(STC) -CC="$(CC)" $(STCFLAGS) +optspace2 $(CFLAGS) -c $(NAME)
#
# install the extra objects
--- a/MessageNd.st Sun Feb 26 19:21:00 1995 +0100
+++ b/MessageNd.st Sun Feb 26 19:21:09 1995 +0100
@@ -21,7 +21,7 @@
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libcomp/Attic/MessageNd.st,v 1.19 1995-02-18 01:25:16 claus Exp $
+$Header: /cvs/stx/stx/libcomp/Attic/MessageNd.st,v 1.20 1995-02-26 18:20:45 claus Exp $
'!
!MessageNode class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
version
"
-$Header: /cvs/stx/stx/libcomp/Attic/MessageNd.st,v 1.19 1995-02-18 01:25:16 claus Exp $
+$Header: /cvs/stx/stx/libcomp/Attic/MessageNd.st,v 1.20 1995-02-26 18:20:45 claus Exp $
"
!
@@ -695,6 +695,7 @@
aStream nextPut:pos.
(aStream contents) at:pos2 put:(aStream position)
+ aStream nextPut:#drop.
!
codeIfElseOn:aStream inBlock:b valueNeeded:valueNeeded
--- a/MessageNode.st Sun Feb 26 19:21:00 1995 +0100
+++ b/MessageNode.st Sun Feb 26 19:21:09 1995 +0100
@@ -21,7 +21,7 @@
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.19 1995-02-18 01:25:16 claus Exp $
+$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.20 1995-02-26 18:20:45 claus Exp $
'!
!MessageNode class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
version
"
-$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.19 1995-02-18 01:25:16 claus Exp $
+$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.20 1995-02-26 18:20:45 claus Exp $
"
!
@@ -695,6 +695,7 @@
aStream nextPut:pos.
(aStream contents) at:pos2 put:(aStream position)
+ aStream nextPut:#drop.
!
codeIfElseOn:aStream inBlock:b valueNeeded:valueNeeded
--- a/Scanner.st Sun Feb 26 19:21:00 1995 +0100
+++ b/Scanner.st Sun Feb 26 19:21:09 1995 +0100
@@ -33,7 +33,7 @@
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.19 1995-02-24 15:22:21 claus Exp $
+$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.20 1995-02-26 18:20:55 claus Exp $
'!
!Scanner class methodsFor:'documentation'!
@@ -54,7 +54,7 @@
version
"
-$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.19 1995-02-24 15:22:21 claus Exp $
+$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.20 1995-02-26 18:20:55 claus Exp $
"
!
@@ -244,6 +244,60 @@
currentComments add:comment
]
].
+!
+
+parseDirective
+ |directive packageName|
+
+ source next.
+ source skipSeparatorsExceptCR.
+ hereChar := source peek.
+ hereChar isLetter ifTrue:[
+ directive := source nextWord.
+ source peek == $: ifTrue:[
+ source next.
+ source skipSeparatorsExceptCR.
+ hereChar := source peek.
+
+ "
+ Package: 'name-of-package'
+ "
+ directive = 'Package' ifTrue:[
+ hereChar == $' ifTrue:[
+ self nextString.
+ tokenType == #String ifTrue:[
+ packageName := tokenValue
+ ]
+ ].
+ (requestor respondsTo:#setPackage:) ifTrue:[
+ requestor setPackage:packageName
+ ].
+ ].
+
+ "
+ Prerequisites: 'name-of-package', ... , 'name-of-package'
+ "
+ directive = 'Prerequisites' ifTrue:[
+ [hereChar == $'] whileTrue:[
+ self nextString.
+ tokenType == #String ifTrue:[
+ packageName := tokenValue.
+ (requestor respondsTo:#requirePackage:) ifTrue:[
+ requestor requirePackage:packageName
+ ].
+ ].
+ source skipSeparatorsExceptCR.
+ hereChar := source peek.
+ (hereChar == $,) ifTrue:[
+ source next.
+ source skipSeparatorsExceptCR.
+ hereChar := source peek.
+ ].
+ ].
+ ].
+ ]
+ ].
+ hereChar := source peek.
! !
!Scanner methodsFor:'error handling'!
@@ -391,7 +445,8 @@
source next.
hereChar := source peek.
- "special ST/X addition:
+ "
+ special ST/X addition:
a $/ right after the initial double quote makes it an up-to-end-of-line comment,
which is very useful to comment out parts of filed-in source code.
Since this is non-standard, use it in very rare cases only.
@@ -425,6 +480,14 @@
outCol := 1
].
] ifFalse:[
+ hereChar == ${ ifTrue:[
+ "
+ special ST/X addition:
+ a ${ right after the initial double quote starts a directive
+ "
+ self parseDirective
+ ].
+
[hereChar notNil and:[hereChar ~~ (Character doubleQuote)]] whileTrue:[
hereChar == (Character cr) ifTrue:[
tokenLineNr := tokenLineNr + 1.