qualified name stuff
authorClaus Gittinger <cg@exept.de>
Thu, 19 Jun 2003 00:47:49 +0200
changeset 1436 e345acd83456
parent 1435 be9680c6145c
child 1437 a7a5db01ad12
qualified name stuff
Parser.st
--- a/Parser.st	Wed Jun 18 17:41:57 2003 +0200
+++ b/Parser.st	Thu Jun 19 00:47:49 2003 +0200
@@ -5938,45 +5938,67 @@
      and mapped to a global variable here.
      The initial #{ is supposed to be not yet skipped."
 
-    |elements elem pos1|
+    |elements elem pos1 nm|
 
     pos1 := tokenPosition.
     self nextToken.
     elements := OrderedCollection new.
-    [tokenType ~~ $} ] whileTrue:[
-        elem := self variable.
-        (elem == #Error) ifTrue:[
-            (tokenType == #EOF) ifTrue:[
-                self syntaxError:'unterminated qualifiedName; ''}'' expected' 
-                        position:pos1 to:tokenPosition
-            ].
-            ^ #Error
-        ].
-        errorFlag := false.
-        (elem isVariable and:[elem isGlobal]) ifFalse:[
-            self warning:'elements of a qualifiedName should be globalIdentifiers' 
+    [ tokenType ~~ $} ] whileTrue:[
+        (tokenType == #Identifier) ifFalse:[
+            self syntaxError:'bad qualifiedName; Identifier expected' 
                     position:pos1 to:tokenPosition
         ].
+        elem := tokenName.
         elements add:elem.
 
         self nextToken.
-        tokenType == #'::' ifTrue:[
-            "/ notice that Foo.Bar has already been scanned as Foo::Bar
-            "/(which is a kludge)
-            self nextToken.
+        tokenType = $} ifTrue:[
         ] ifFalse:[
-            tokenType ~~ $} ifTrue:[
+            tokenType == #'::' ifTrue:[
+                "/ notice that Foo.Bar has already been scanned as Foo::Bar
+                "/(which is a kludge)
+                self nextToken.
+            ] ifFalse:[
                 self syntaxError:'bad qualifiedName syntax; ''.'' or ''}'' expected' 
                         position:pos1 to:tokenPosition.
-                ^ #Error
             ].
         ].
-    ].
-
-    elements size > 1 ifTrue:[
-        self syntaxError:'Sorry: qualified names are not yet implemented.'.
-    ].
-    ^ elements first.
+
+"/        elem := self variable.
+"/        (elem == #Error) ifTrue:[
+"/            (tokenType == #EOF) ifTrue:[
+"/                self syntaxError:'unterminated qualifiedName; ''}'' expected' 
+"/                        position:pos1 to:tokenPosition
+"/            ].
+"/            ^ #Error
+"/        ].
+"/        errorFlag := false.
+"/        (elem isVariable and:[elem isGlobal]) ifFalse:[
+"/            self warning:'elements of a qualifiedName should be globalIdentifiers' 
+"/                    position:pos1 to:tokenPosition
+"/        ].
+"/        elements add:elem.
+"/
+"/        self nextToken.
+"/        tokenType == #'::' ifTrue:[
+"/            "/ notice that Foo.Bar has already been scanned as Foo::Bar
+"/            "/(which is a kludge)
+"/            self nextToken.
+"/        ] ifFalse:[
+"/            tokenType ~~ $} ifTrue:[
+"/                self syntaxError:'bad qualifiedName syntax; ''.'' or ''}'' expected' 
+"/                        position:pos1 to:tokenPosition.
+"/                ^ #Error
+"/            ].
+"/        ].
+    ].
+    nm := elements asStringWith:'::'.
+    ^ ConstantNode type:#Symbol value:nm
+
+"/    elements size > 1 ifTrue:[
+"/        self syntaxError:'Sorry: qualified names are not yet implemented.'.
+"/    ].
+"/    ^ elements first.
 
     "Modified: / 14.4.1998 / 17:03:29 / cg"
 !
@@ -7400,7 +7422,7 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.397 2003-06-18 15:35:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.398 2003-06-18 22:47:49 cg Exp $'
 ! !
 
 Parser initialize!