*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Mon, 03 Aug 1998 19:10:34 +0200
changeset 755 49ae81e86b7b
parent 754 1363fa7dfcd1
child 756 ddc9b8aa6825
*** empty log message ***
Parser.st
--- a/Parser.st	Mon Aug 03 19:09:19 1998 +0200
+++ b/Parser.st	Mon Aug 03 19:10:34 1998 +0200
@@ -53,11 +53,11 @@
     the (planned) MachineCodeCompiler.
 
     methods of main interest are:
-	Parser evaluateExpression:...
+        Parser evaluateExpression:...
 
     and:
-	Parser parseExpression:...
-	Parser parseMethod:...
+        Parser parseExpression:...
+        Parser parseMethod:...
 
     there is protocol to parse complete methods, selector specs, body only etc.
 
@@ -68,8 +68,7 @@
     You can also use parsers for all kinds of other things (ChangesBrowser for
     example analyzes the expressions in the changelist ...) by looking at the
     parsers tree. (Although this is somewhat dangerous, since it exports the
-    compilers internals ... better style is to add specialized query methods here,
-    which will be done incrementally.)
+    compilers internals ... better style is to add specialized query methods here)
 
     One instance of Parser is created to parse one method or expression - i.e.
     its not suggested to reuse parsers.
@@ -87,6 +86,10 @@
     reduced to a constant point), but the resulting code may not be compatible with other 
     smalltalk systems (consider the case, where the point is modified using #x: or #y: messages). 
     Therefore, this mode is a bit dangerous and disabled by default.
+    The current implementation, base upon a global constant-folding setting is somewhat stupid
+    and intermediate - a better solution would be to allow the optimization to be controlled
+    by a method-pragma, since it may make sense to disable optimization on a method level,
+    if its known that the used constant objects are subject of modifications as described above.
     
 
   Immutable arrays:
@@ -107,108 +110,108 @@
 
     [Instance variables:]
 
-	classToCompileFor   <Class>             the class (or nil) we are compiling for
-
-	selfValue           <any>               value to use as self when interpreting
-
-	contextToEvaluateIn <Context>           the context (or nil) when interpreting
-
-	selector            <Symbol>            the selector of the parsed method
-						(valid after parseMethodSpecification)
-	methodArgs                              internal
-
-	methodArgNames      <Collection>        the names of the arguments
-						(valid after parseMethodSpecification)
-
-	methodVars                              internal
-
-	methodVarNames      <Collection>        the names of the method locals
-						(valid after parseMethodBodyVarSpec)
-
-	tree                <ParseTree>         the parse tree - valid after parsing
-
-	currentBlock                            if currently parsing for a block
-
-	usedInstVars                            set of all accessed instances variables
-						(valid after parsing)
-
-	usedClassVars                           same for classVars
-
-	usedVars                                all used variables (inst, class & globals)
-
-	modifiedInstVars                        set of all modified instance variables
-
-	modifiedClassVars                       same for clasVars
-
-	localVarDefPosition <Integer>           the character offset of the local variable
-						def. (i.e. the first '|' if any)
-						Not yet used - prepared for automatic add of
-						undefined variables
-
-	evalExitBlock                           internal for interpretation
-
-	selfNode            <Node>              cached one-and-only 'self' node
-	superNode           <Node>              cached one-and-only 'super' node
-
-	hasPrimitiveCode    <Boolean>           true, if it contains ST/X style primitive code
-	hasNonOptionalPrimitiveCode    
-			    <Boolean>           true, if it contains ST/X style primitive code
-						which is NOT flagged by the OPTIONAL directive.
-
-	primitiveNr         <Integer>           the parsed ST-80 type primitive number (or nil)
-
-	logged
-
-	warnedUndefVars     <Set>               set of all variables which the parser has
-						already output a warning (to avoid multiple
-						warnings about the same variable)
+        classToCompileFor   <Class>             the class (or nil) we are compiling for
+
+        selfValue           <any>               value to use as self when interpreting
+
+        contextToEvaluateIn <Context>           the context (or nil) when interpreting
+
+        selector            <Symbol>            the selector of the parsed method
+                                                (valid after parseMethodSpecification)
+        methodArgs                              internal
+
+        methodArgNames      <Collection>        the names of the arguments
+                                                (valid after parseMethodSpecification)
+
+        methodVars                              internal
+
+        methodVarNames      <Collection>        the names of the method locals
+                                                (valid after parseMethodBodyVarSpec)
+
+        tree                <ParseTree>         the parse tree - valid after parsing
+
+        currentBlock                            if currently parsing for a block
+
+        usedInstVars                            set of all accessed instances variables
+                                                (valid after parsing)
+
+        usedClassVars                           same for classVars
+
+        usedVars                                all used variables (inst, class & globals)
+
+        modifiedInstVars                        set of all modified instance variables
+
+        modifiedClassVars                       same for clasVars
+
+        localVarDefPosition <Integer>           the character offset of the local variable
+                                                def. (i.e. the first '|' if any)
+                                                Not yet used - prepared for automatic add of
+                                                undefined variables
+
+        evalExitBlock                           internal for interpretation
+
+        selfNode            <Node>              cached one-and-only 'self' node
+        superNode           <Node>              cached one-and-only 'super' node
+
+        hasPrimitiveCode    <Boolean>           true, if it contains ST/X style primitive code
+        hasNonOptionalPrimitiveCode    
+                            <Boolean>           true, if it contains ST/X style primitive code
+                                                which is NOT flagged by the OPTIONAL directive.
+
+        primitiveNr         <Integer>           the parsed ST-80 type primitive number (or nil)
+
+        logged
+
+        warnedUndefVars     <Set>               set of all variables which the parser has
+                                                already output a warning (to avoid multiple
+                                                warnings about the same variable)
 
     [Class variables:]
 
-	PrevClass           <Class>             class, of which properties are
-						cached in:
-
-	PrevInstVarNames      <Collection>      instance variablenames of cached class
-	PrevClassVarNames     <Collection>      class variablenames of cached class
-	PrevClassInstVarNames <Collection>      class instance variablenames of cached class
-
-	LazyCompilation       <Boolean>         EXPERIMENTAL: lazy compilation
-
-	ArraysAreImmutable    <Boolean>         if true, create array literals
-						as instances of ImmutableArray,
-						which cannot be stored into.
-						Default is false, for compatibility.
-						Can be turned on while developping
-						new code to make certain that side
-						effects are avoided.
-
-	WarnST80Directives    <Boolean>         if true, give warnings about
-						ST-80 directives (resource defs)
-						which are ignored in st/x.
-						defaults to false.
-
-	FoldConstants         <Symbol>          controls how constant folding should be
-						done.
-						Can be one of:
-							nil      - no constant folding
-							#level1  - numeric optimizations only
-							#level2  - secure optimizations only
-							#full    - full folding
-
-						level1:   arithmetic on constant numbers
-
-						level2:   above PLUS array conversions with #asFloatArray,
-							  #asDoubleArray, string concatenation
-
-						full:     constant points.
+        PrevClass           <Class>             class, of which properties are
+                                                cached in:
+
+        PrevInstVarNames      <Collection>      instance variablenames of cached class
+        PrevClassVarNames     <Collection>      class variablenames of cached class
+        PrevClassInstVarNames <Collection>      class instance variablenames of cached class
+
+        LazyCompilation       <Boolean>         EXPERIMENTAL: lazy compilation
+
+        ArraysAreImmutable    <Boolean>         if true, create array literals
+                                                as instances of ImmutableArray,
+                                                which cannot be stored into.
+                                                Default is false, for compatibility.
+                                                Can be turned on while developping
+                                                new code to make certain that side
+                                                effects are avoided.
+
+        WarnST80Directives    <Boolean>         if true, give warnings about
+                                                ST-80 directives (resource defs)
+                                                which are ignored in st/x.
+                                                defaults to false.
+
+        FoldConstants         <Symbol>          controls how constant folding should be
+                                                done.
+                                                Can be one of:
+                                                        nil      - no constant folding
+                                                        #level1  - numeric optimizations only
+                                                        #level2  - secure optimizations only
+                                                        #full    - full folding
+
+                                                level1:   arithmetic on constant numbers
+
+                                                level2:   above PLUS array conversions with #asFloatArray,
+                                                          #asDoubleArray, string concatenation
+
+                                                full:     constant points.
                                                           
     [see also:]
-	ByteCodeCompiler Scanner ObjectFileLoader
-	Workspace
-	SystemBrowser
+        ByteCodeCompiler Scanner ObjectFileLoader
+        Workspace
+        SystemBrowser
 
     [author:]
-	Claus Gittinger
+        Claus Gittinger
 "
 ! !
 
@@ -4688,6 +4691,6 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.185 1998-08-03 17:07:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.186 1998-08-03 17:10:34 cg Exp $'
 ! !
 Parser initialize!