1634
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
|
3 |
COPYRIGHT (c) 2005 by eXept Software AG
|
|
4 |
All Rights Reserved
|
|
5 |
|
|
6 |
This software is furnished under a license and may be used
|
|
7 |
only in accordance with the terms of that license and with the
|
|
8 |
inclusion of the above copyright notice. This software may not
|
|
9 |
be provided or otherwise made available to, or used by, any
|
|
10 |
other person. No title to or ownership of the software is
|
|
11 |
hereby transferred.
|
|
12 |
"
|
|
13 |
|
|
14 |
"{ Package: 'stx:libcomp' }"
|
|
15 |
|
|
16 |
Object subclass:#ParserFlags
|
|
17 |
instanceVariableNames:'warnUnusedVars warnUndeclared warnST80Directives
|
|
18 |
warnSTXHereExtensionUsed warnSTXSpecialComment
|
|
19 |
warnUnderscoreInIdentifier warnOldStyleAssignment
|
|
20 |
warnCommonMistakes warnSTXNameSpaceUse
|
|
21 |
warnPossibleIncompatibilities warnDollarInIdentifier
|
1638
|
22 |
warnHiddenVariables warnAboutVariableNameConventions
|
1652
|
23 |
warnAboutWrongVariableNames warnAboutBadComments
|
|
24 |
allowLiteralNameSpaceSymbols allowUnderscoreInIdentifier
|
|
25 |
allowDollarInIdentifier allowOldStyleAssignment
|
|
26 |
allowSqueakExtensions allowDolphinExtensions
|
|
27 |
allowExtendedBinarySelectors allowQualifiedNames
|
|
28 |
allowFunctionCallSyntaxForBlockEvaluation
|
1634
|
29 |
allowLocalVariableDeclarationWithInitializerExpression
|
|
30 |
allowDomainVariables allowArrayIndexSyntaxExtension
|
|
31 |
allowReservedWordsAsSelectors allowVariableReferences
|
|
32 |
allowLazyValueExtension allowFixedPointLiterals
|
|
33 |
allowExtendedSTXSyntax arraysAreImmutable stringsAreImmutable
|
|
34 |
implicitSelfSends'
|
|
35 |
classVariableNames:'WarnST80Directives WarnUnusedVars WarnUndeclared
|
1652
|
36 |
WarnAboutWrongVariableNames WarnAboutBadComments
|
|
37 |
WarnAboutVariableNameConventions WarnSTXSpecials
|
|
38 |
WarnOldStyleAssignment WarnUnderscoreInIdentifier
|
1634
|
39 |
WarnCommonMistakes WarnPossibleIncompatibilities
|
1638
|
40 |
WarnDollarInIdentifier WarnHiddenVariables Warnings
|
|
41 |
AllowUnderscoreInIdentifier
|
1634
|
42 |
AllowFunctionCallSyntaxForBlockEvaluation AllowLazyValueExtension
|
|
43 |
AllowVariableReferences AllowReservedWordsAsSelectors
|
|
44 |
AllowLocalVariableDeclarationWithInitializerExpression
|
|
45 |
AllowArrayIndexSyntaxExtension AllowDomainVariables
|
|
46 |
AllowDollarInIdentifier AllowSqueakExtensions AllowQualifiedNames
|
|
47 |
AllowDolphinExtensions AllowOldStyleAssignment
|
|
48 |
AllowExtendedBinarySelectors AllowExtendedSTXSyntax
|
|
49 |
AllowFixedPointLiterals AllowLiteralNameSpaceSymbols
|
|
50 |
ArraysAreImmutable StringsAreImmutable ImplicitSelfSends'
|
|
51 |
poolDictionaries:''
|
|
52 |
category:'System-Compiler'
|
|
53 |
!
|
|
54 |
|
|
55 |
!ParserFlags class methodsFor:'documentation'!
|
|
56 |
|
|
57 |
copyright
|
|
58 |
"
|
|
59 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
|
60 |
COPYRIGHT (c) 2005 by eXept Software AG
|
|
61 |
All Rights Reserved
|
|
62 |
|
|
63 |
This software is furnished under a license and may be used
|
|
64 |
only in accordance with the terms of that license and with the
|
|
65 |
inclusion of the above copyright notice. This software may not
|
|
66 |
be provided or otherwise made available to, or used by, any
|
|
67 |
other person. No title to or ownership of the software is
|
|
68 |
hereby transferred.
|
|
69 |
"
|
|
70 |
!
|
|
71 |
|
|
72 |
documentation
|
|
73 |
"
|
|
74 |
compiler flags (used to be defined in Scanner and Parser) have been extracted for easier
|
|
75 |
individual-method customization (using ST as scripting).
|
|
76 |
"
|
|
77 |
! !
|
|
78 |
|
|
79 |
!ParserFlags class methodsFor:'instance creation'!
|
|
80 |
|
|
81 |
new
|
|
82 |
^ self basicNew initialize
|
|
83 |
! !
|
|
84 |
|
|
85 |
!ParserFlags class methodsFor:'accessing-compilation control'!
|
|
86 |
|
|
87 |
arraysAreImmutable
|
|
88 |
"return true if arrays are immutable literals"
|
|
89 |
|
|
90 |
^ ArraysAreImmutable
|
|
91 |
!
|
|
92 |
|
|
93 |
arraysAreImmutable:aBoolean
|
|
94 |
"turn on/off immutable array literals - default is false for ST-80 compatibilty."
|
|
95 |
|
|
96 |
ArraysAreImmutable := aBoolean.
|
|
97 |
|
|
98 |
"
|
|
99 |
can be added to your private.rc file:
|
|
100 |
|
|
101 |
ParserFlags arraysAreImmutable:true
|
|
102 |
ParserFlags arraysAreImmutable:false
|
|
103 |
"
|
|
104 |
!
|
|
105 |
|
|
106 |
implicitSelfSends
|
|
107 |
"return true if undefined variables with
|
|
108 |
lowercase first character are to be turned
|
|
109 |
into implicit self sends"
|
|
110 |
|
|
111 |
^ ImplicitSelfSends
|
|
112 |
!
|
|
113 |
|
|
114 |
implicitSelfSends:aBoolean
|
|
115 |
"turn on/off implicit self sends"
|
|
116 |
|
|
117 |
ImplicitSelfSends := aBoolean
|
|
118 |
|
|
119 |
"
|
|
120 |
Compiler implicitSelfSends:true
|
|
121 |
Compiler implicitSelfSends:false
|
|
122 |
"
|
|
123 |
!
|
|
124 |
|
|
125 |
stringsAreImmutable
|
|
126 |
"return true if strings are immutable literals"
|
|
127 |
|
|
128 |
^ StringsAreImmutable
|
|
129 |
|
|
130 |
"Created: / 3.8.1998 / 14:53:25 / cg"
|
|
131 |
!
|
|
132 |
|
|
133 |
stringsAreImmutable:aBoolean
|
|
134 |
"turn on/off immutable string literals - default is false for ST-80 compatibilty."
|
|
135 |
|
|
136 |
StringsAreImmutable := aBoolean.
|
|
137 |
|
|
138 |
"
|
|
139 |
can be added to your private.rc file:
|
|
140 |
|
|
141 |
ParserFlags stringsAreImmutable:true
|
|
142 |
ParserFlags stringsAreImmutable:false
|
|
143 |
"
|
|
144 |
|
|
145 |
"Created: / 3.8.1998 / 14:53:28 / cg"
|
|
146 |
! !
|
|
147 |
|
|
148 |
!ParserFlags class methodsFor:'accessing-syntax-control'!
|
|
149 |
|
|
150 |
allowArrayIndexSyntaxExtension
|
|
151 |
"experimental"
|
|
152 |
|
|
153 |
^ AllowArrayIndexSyntaxExtension ? false
|
|
154 |
!
|
|
155 |
|
|
156 |
allowArrayIndexSyntaxExtension:aBoolean
|
|
157 |
"experimental"
|
|
158 |
|
|
159 |
AllowArrayIndexSyntaxExtension := aBoolean.
|
|
160 |
|
|
161 |
"
|
|
162 |
self allowArrayIndexSyntaxExtension:true
|
|
163 |
self allowArrayIndexSyntaxExtension:false
|
|
164 |
"
|
|
165 |
!
|
|
166 |
|
|
167 |
allowDollarInIdentifier
|
|
168 |
"return true, if $-characters are allowed in identifiers.
|
|
169 |
Notice, that dollars are NEVER allowed as the first character in an identifier."
|
|
170 |
|
|
171 |
^ AllowDollarInIdentifier
|
|
172 |
|
|
173 |
"Created: 7.9.1997 / 01:32:18 / cg"
|
|
174 |
"Modified: 7.9.1997 / 01:39:44 / cg"
|
|
175 |
!
|
|
176 |
|
|
177 |
allowDollarInIdentifier:aBoolean
|
|
178 |
"this allows turning on/off $-characters in identifiers.
|
|
179 |
Notice, that dollars are NEVER allowed as the first character in an identifier.
|
|
180 |
If turned off (the default), dollars are not allowed in identifiers,
|
|
181 |
but instead are scanned as character-constant prefix.
|
|
182 |
If turned on, dollars are in identifiers are allowed, while extra
|
|
183 |
dollars are still scanned as constant character prefix.
|
|
184 |
If you have to fileIn old VW-Vsn2.x classes, turn this off
|
|
185 |
before filing them in; i.e.:
|
|
186 |
Compiler allowDollarInIdentifiers:false"
|
|
187 |
|
|
188 |
AllowDollarInIdentifier := aBoolean.
|
|
189 |
|
|
190 |
"Created: 7.9.1997 / 01:34:49 / cg"
|
|
191 |
"Modified: 7.9.1997 / 01:39:30 / cg"
|
|
192 |
!
|
|
193 |
|
|
194 |
allowDolphinExtensions
|
|
195 |
"return true, if ##(..) computed literals are allowed"
|
|
196 |
|
|
197 |
^ AllowDolphinExtensions
|
|
198 |
!
|
|
199 |
|
|
200 |
allowDolphinExtensions:aBoolean
|
|
201 |
"this allows turning on/off support for computed arrays ##(..) as in dolphin.
|
|
202 |
If you want to fileIn Dolphin classes, enable this with:
|
|
203 |
Compiler allowDolphinComputedArrays:true"
|
|
204 |
|
|
205 |
AllowDolphinExtensions := aBoolean.
|
|
206 |
|
|
207 |
"
|
|
208 |
self allowDolphinExtensions:true
|
|
209 |
self allowDolphinExtensions:false
|
|
210 |
"
|
|
211 |
!
|
|
212 |
|
|
213 |
allowFunctionCallSyntaxForBlockEvaluation
|
|
214 |
"experimental"
|
|
215 |
|
|
216 |
^ AllowFunctionCallSyntaxForBlockEvaluation
|
|
217 |
!
|
|
218 |
|
|
219 |
allowFunctionCallSyntaxForBlockEvaluation:aBoolean
|
|
220 |
"experimental"
|
|
221 |
|
|
222 |
AllowFunctionCallSyntaxForBlockEvaluation := aBoolean.
|
|
223 |
!
|
|
224 |
|
|
225 |
allowLiteralNameSpaceSymbols
|
|
226 |
"return true, if literal nameSpace symbols are allowed (#foo::bar) are allowed"
|
|
227 |
|
|
228 |
^ AllowLiteralNameSpaceSymbols
|
|
229 |
!
|
|
230 |
|
|
231 |
allowLiteralNameSpaceSymbols:aBoolean
|
|
232 |
"controls, if literal nameSpace symbols are allowed (#foo::bar) are allowed"
|
|
233 |
|
|
234 |
AllowLiteralNameSpaceSymbols := aBoolean
|
|
235 |
!
|
|
236 |
|
|
237 |
allowLocalVariableDeclarationWithInitializerExpression
|
|
238 |
"experimental"
|
|
239 |
|
|
240 |
^ AllowLocalVariableDeclarationWithInitializerExpression
|
|
241 |
!
|
|
242 |
|
|
243 |
allowLocalVariableDeclarationWithInitializerExpression:aBoolean
|
|
244 |
"experimental"
|
|
245 |
|
|
246 |
AllowLocalVariableDeclarationWithInitializerExpression := aBoolean.
|
|
247 |
!
|
|
248 |
|
|
249 |
allowOldStyleAssignment
|
|
250 |
"return true, if underscore-assignment (pre ST-80v4 syntax) are to be allowed"
|
|
251 |
|
|
252 |
^ AllowOldStyleAssignment
|
|
253 |
!
|
|
254 |
|
|
255 |
allowOldStyleAssignment:aBoolean
|
|
256 |
"this allows turning on/off recognition of underscore-assignment (pre ST-80v4 syntax).
|
|
257 |
You must turn this off, if code with variables named '_' is to be filedIn"
|
|
258 |
|
|
259 |
AllowOldStyleAssignment := aBoolean
|
|
260 |
!
|
|
261 |
|
|
262 |
allowQualifiedNames
|
|
263 |
"return true, if #{..} qualified names are allowed"
|
|
264 |
|
|
265 |
^ AllowQualifiedNames
|
|
266 |
!
|
|
267 |
|
|
268 |
allowQualifiedNames:aBoolean
|
|
269 |
"this allows turning on/off support for qualifiedNames #{ .., } as in vw3.
|
|
270 |
If you want to fileIn vw3 or later classes, enable this with:
|
|
271 |
Compiler allowQualifiedNames:true
|
|
272 |
Notice, that qualified names are not really supported semantically
|
|
273 |
(they are parsed, but treated like regular globals)
|
|
274 |
"
|
|
275 |
|
|
276 |
AllowQualifiedNames := aBoolean.
|
|
277 |
|
|
278 |
"
|
|
279 |
self allowQualifiedNames:true
|
|
280 |
self allowQualifiedNames:false
|
|
281 |
"
|
|
282 |
!
|
|
283 |
|
|
284 |
allowReservedWordsAsSelectors
|
|
285 |
"return true, if self, super, thisContext, nil, true and false are to be allowed
|
|
286 |
as unary message selectors."
|
|
287 |
|
|
288 |
^ AllowReservedWordsAsSelectors ? false
|
|
289 |
!
|
|
290 |
|
|
291 |
allowReservedWordsAsSelectors:aBoolean
|
|
292 |
"enable/disable, if self, super, thisContext, nil, true and false are to be allowed
|
|
293 |
as unary message selectors."
|
|
294 |
|
|
295 |
AllowReservedWordsAsSelectors := aBoolean.
|
|
296 |
|
|
297 |
"
|
|
298 |
self allowReservedWordsAsSelectors:true
|
|
299 |
self allowReservedWordsAsSelectors:false
|
|
300 |
"
|
|
301 |
!
|
|
302 |
|
|
303 |
allowSqueakExtensions
|
|
304 |
"return true, if support for squeak extensions
|
|
305 |
computed arrays { .., }
|
|
306 |
c/java style arguments in message sends rec foo(arg1, ... argN)
|
|
307 |
is enabled."
|
|
308 |
|
|
309 |
^ AllowSqueakExtensions
|
|
310 |
!
|
|
311 |
|
|
312 |
allowSqueakExtensions:aBoolean
|
|
313 |
"this allows turning on/off support for squeak extensions:
|
|
314 |
computed arrays { .., }
|
|
315 |
c/java style arguments in message sends rec foo(arg1, ... argN)
|
|
316 |
|
|
317 |
If you want to fileIn Squeak classes, enable this with:
|
|
318 |
Compiler allowSqueakComputedArrays:true"
|
|
319 |
|
|
320 |
AllowSqueakExtensions := aBoolean.
|
|
321 |
|
|
322 |
"
|
|
323 |
self allowSqueakExtensions:true
|
|
324 |
self allowSqueakExtensions:false
|
|
325 |
"
|
|
326 |
!
|
|
327 |
|
|
328 |
allowUnderscoreInIdentifier
|
|
329 |
"return true, if underscores are allowed in identifiers"
|
|
330 |
|
|
331 |
^ AllowUnderscoreInIdentifier
|
|
332 |
!
|
|
333 |
|
|
334 |
allowUnderscoreInIdentifier:aBoolean
|
|
335 |
"this allows turning on/off underscores in identifiers.
|
|
336 |
If turned off (the default), underscores are not allowed in identifiers,
|
|
337 |
but instead scanned as assignment character (old ST/80 syntax).
|
|
338 |
If turned on, underscores are in identifiers are allowed, while extra
|
|
339 |
underscores are still scanned as assignment.
|
|
340 |
If you have to fileIn old VW-Vsn2.x classes,
|
|
341 |
turn them off with:
|
|
342 |
Compiler allowUnderscoreInIdentifiers:false"
|
|
343 |
|
|
344 |
AllowUnderscoreInIdentifier := aBoolean.
|
|
345 |
|
|
346 |
"Modified: 7.9.1997 / 01:35:19 / cg"
|
|
347 |
! !
|
|
348 |
|
|
349 |
!ParserFlags class methodsFor:'accessing-warning-control'!
|
|
350 |
|
1652
|
351 |
warnAboutBadComments
|
|
352 |
"controls generation of warning messages about empty comments"
|
|
353 |
|
|
354 |
^ WarnAboutBadComments
|
|
355 |
!
|
|
356 |
|
|
357 |
warnAboutBadComments:aBoolean
|
|
358 |
"controls generation of warning messages about empty comments"
|
|
359 |
|
|
360 |
WarnAboutBadComments := aBoolean
|
|
361 |
!
|
|
362 |
|
1634
|
363 |
warnAboutVariableNameConventions
|
|
364 |
"controls generation of warning messages about wrong variable names"
|
|
365 |
|
|
366 |
^ WarnAboutVariableNameConventions
|
|
367 |
!
|
|
368 |
|
|
369 |
warnAboutVariableNameConventions:aBoolean
|
|
370 |
"controls generation of warning messages about wrong variable names"
|
|
371 |
|
|
372 |
WarnAboutVariableNameConventions := aBoolean
|
|
373 |
!
|
|
374 |
|
|
375 |
warnAboutWrongVariableNames
|
|
376 |
"controls generation of warning messages about wrong variable names"
|
|
377 |
|
|
378 |
^ WarnAboutWrongVariableNames
|
|
379 |
!
|
|
380 |
|
|
381 |
warnAboutWrongVariableNames:aBoolean
|
|
382 |
"controls generation of warning messages about wrong variable names"
|
|
383 |
|
|
384 |
WarnAboutWrongVariableNames := aBoolean
|
|
385 |
!
|
|
386 |
|
|
387 |
warnCommonMistakes
|
|
388 |
"return true, if common beginners mistakes are to be warned about"
|
|
389 |
|
|
390 |
^ Warnings and:[WarnCommonMistakes]
|
|
391 |
!
|
|
392 |
|
|
393 |
warnCommonMistakes:aBoolean
|
|
394 |
"this allows turning on/off warnings about common beginners mistakes.
|
|
395 |
Those are not really errors in the strict sense, but often lead to
|
|
396 |
run time errors later.
|
|
397 |
Examples are: expr or:expr2, where expr2 is not a block.
|
|
398 |
If you get bored by those warnings, turn them off by adding
|
|
399 |
a line as:
|
|
400 |
Compiler warnCommonMistakes:false
|
|
401 |
in your 'private.rc' file"
|
|
402 |
|
|
403 |
WarnCommonMistakes := aBoolean
|
|
404 |
!
|
|
405 |
|
|
406 |
warnDollarInIdentifier
|
|
407 |
"return true, if $-characters in identifiers are to be warned about"
|
|
408 |
|
|
409 |
^ Warnings and:[WarnDollarInIdentifier]
|
|
410 |
|
|
411 |
"Created: 7.9.1997 / 01:36:17 / cg"
|
|
412 |
!
|
|
413 |
|
|
414 |
warnDollarInIdentifier:aBoolean
|
|
415 |
"this allows turning on/off warnings about $-characters in identifiers.
|
|
416 |
You may find those warnings useful, to make certain that your code
|
|
417 |
is portable to other smalltalk versions, which do not allow this
|
|
418 |
(i.e. VW releases 2.x and maybe others).
|
|
419 |
Notice, that dollars are NEVER allowed as the first character in an identifier.
|
|
420 |
If you get bored by those warnings, turn them off by adding
|
|
421 |
a line as:
|
|
422 |
Compiler warnDollarInIdentifier:false
|
|
423 |
in your 'private.rc' file"
|
|
424 |
|
|
425 |
WarnDollarInIdentifier := aBoolean
|
|
426 |
|
|
427 |
"Created: 7.9.1997 / 01:37:42 / cg"
|
|
428 |
"Modified: 7.9.1997 / 01:40:02 / cg"
|
|
429 |
!
|
|
430 |
|
|
431 |
warnOldStyleAssignment
|
|
432 |
"return true, if underscore-assignment (pre ST-80v4 syntax) are to be warned about"
|
|
433 |
|
|
434 |
^ Warnings and:[WarnOldStyleAssignment]
|
|
435 |
!
|
|
436 |
|
|
437 |
warnOldStyleAssignment:aBoolean
|
|
438 |
"this allows turning on/off warnings about underscore-assignment (pre ST-80v4 syntax).
|
|
439 |
If you get bored by those warnings, turn them off by adding
|
|
440 |
a line as:
|
|
441 |
Compiler warnOldStyleAssignment:false
|
|
442 |
in your 'private.rc' file"
|
|
443 |
|
|
444 |
WarnOldStyleAssignment := aBoolean
|
|
445 |
!
|
|
446 |
|
|
447 |
warnPossibleIncompatibilities
|
|
448 |
"return true, if possible incompatibilities (with other ST systems)
|
|
449 |
are to be warned about"
|
|
450 |
|
|
451 |
^ Warnings and:[WarnPossibleIncompatibilities]
|
|
452 |
|
|
453 |
"Modified: 23.5.1997 / 12:02:02 / cg"
|
|
454 |
!
|
|
455 |
|
|
456 |
warnPossibleIncompatibilities:aBoolean
|
|
457 |
"this turns warnings about possible incompatibilities (with other ST systems)
|
|
458 |
on or off.
|
|
459 |
If you get bored by those warnings, turn them off by adding
|
|
460 |
a line as:
|
|
461 |
Compiler warnPossibleIncompatibilities:false
|
|
462 |
in your 'private.rc' file."
|
|
463 |
|
|
464 |
WarnPossibleIncompatibilities := aBoolean
|
|
465 |
|
|
466 |
"Created: 23.5.1997 / 12:02:45 / cg"
|
|
467 |
!
|
|
468 |
|
|
469 |
warnSTXSpecials
|
|
470 |
"return true, if ST/X specials are to be warned about"
|
|
471 |
|
|
472 |
^ Warnings and:[WarnSTXSpecials]
|
|
473 |
!
|
|
474 |
|
|
475 |
warnSTXSpecials:aBoolean
|
|
476 |
"this allows turning on/off warnings about stx specials.
|
|
477 |
If you get bored by those warnings, turn them off by adding
|
|
478 |
a line as:
|
|
479 |
Compiler warnSTXSpecials:false
|
|
480 |
in your 'private.rc' file"
|
|
481 |
|
|
482 |
WarnSTXSpecials := aBoolean
|
|
483 |
!
|
|
484 |
|
|
485 |
warnUnderscoreInIdentifier
|
|
486 |
"return true, if underscores in identifiers are to be warned about"
|
|
487 |
|
|
488 |
^ Warnings and:[WarnUnderscoreInIdentifier]
|
|
489 |
!
|
|
490 |
|
|
491 |
warnUnderscoreInIdentifier:aBoolean
|
|
492 |
"this allows turning on/off warnings about underscores in identifiers.
|
|
493 |
You may find those warnings useful, to make certain that your code
|
|
494 |
is portable to other smalltalk versions, which do not allow this
|
|
495 |
(i.e. VW releases 2.x).
|
|
496 |
If you get bored by those warnings, turn them off by adding
|
|
497 |
a line as:
|
|
498 |
Compiler warnUnderscoreInIdentifier:false
|
|
499 |
in your 'private.rc' file"
|
|
500 |
|
|
501 |
WarnUnderscoreInIdentifier := aBoolean
|
|
502 |
|
|
503 |
"Modified: 7.9.1997 / 01:37:13 / cg"
|
|
504 |
!
|
|
505 |
|
|
506 |
warnUnusedVars
|
|
507 |
"controls generation of warning messages about unued method variables"
|
|
508 |
|
|
509 |
^ WarnUnusedVars
|
|
510 |
!
|
|
511 |
|
|
512 |
warnUnusedVars:aBoolean
|
|
513 |
"controls generation of warning messages about unued method variables"
|
|
514 |
|
|
515 |
WarnUnusedVars := aBoolean
|
|
516 |
!
|
|
517 |
|
|
518 |
warnings
|
|
519 |
"return true, if any warnings are to be shown"
|
|
520 |
|
|
521 |
^ Warnings
|
|
522 |
!
|
|
523 |
|
|
524 |
warnings:aBoolean
|
|
525 |
"this allows turning on/off all warnings; the default is on.
|
|
526 |
You can turn off warnings in your 'private.rc' file with
|
|
527 |
Compiler warnings:false
|
|
528 |
"
|
|
529 |
|
|
530 |
Warnings := aBoolean
|
|
531 |
|
|
532 |
"Modified: 23.5.1997 / 12:03:05 / cg"
|
|
533 |
! !
|
|
534 |
|
|
535 |
!ParserFlags class methodsFor:'class initialization'!
|
|
536 |
|
|
537 |
initialize
|
|
538 |
Warnings := true.
|
|
539 |
WarnUndeclared := true.
|
|
540 |
WarnUnusedVars := true.
|
|
541 |
WarnSTXSpecials := false.
|
|
542 |
WarnST80Directives := false.
|
|
543 |
WarnAboutWrongVariableNames := true.
|
|
544 |
WarnAboutVariableNameConventions := true.
|
1652
|
545 |
WarnAboutBadComments := true.
|
1634
|
546 |
WarnUnderscoreInIdentifier := false.
|
|
547 |
WarnDollarInIdentifier := true.
|
|
548 |
WarnOldStyleAssignment := true.
|
|
549 |
WarnCommonMistakes := true.
|
|
550 |
WarnPossibleIncompatibilities := false.
|
1638
|
551 |
WarnHiddenVariables := true.
|
1634
|
552 |
|
|
553 |
AllowReservedWordsAsSelectors := false.
|
|
554 |
AllowUnderscoreInIdentifier := true. "/ underscores in identifiers
|
|
555 |
AllowDollarInIdentifier := false. "/ st80-vms dollars in identifiers
|
|
556 |
AllowOldStyleAssignment := true. "/ st80 underscore as assignment
|
|
557 |
AllowSqueakExtensions := false. "/ squeak computed array
|
|
558 |
AllowDolphinExtensions := false. "/ dolphin computed literal
|
|
559 |
AllowQualifiedNames := false. "/ vw3 qualified names
|
|
560 |
AllowExtendedBinarySelectors := false. "/ vw5.4 extended binary selectors (plus/minus, center-dot etc.)
|
|
561 |
AllowLiteralNameSpaceSymbols := true. "/ st/x literal nameSpace-symbols (#foo::bar)
|
|
562 |
AllowArrayIndexSyntaxExtension := false.
|
|
563 |
AllowFunctionCallSyntaxForBlockEvaluation := false.
|
|
564 |
AllowLocalVariableDeclarationWithInitializerExpression := false.
|
|
565 |
AllowDomainVariables := false.
|
|
566 |
AllowArrayIndexSyntaxExtension := false.
|
|
567 |
AllowReservedWordsAsSelectors := true.
|
|
568 |
AllowVariableReferences := false.
|
|
569 |
AllowLazyValueExtension := false.
|
|
570 |
AllowFixedPointLiterals := false.
|
|
571 |
AllowExtendedSTXSyntax := false.
|
|
572 |
|
|
573 |
ArraysAreImmutable := false. "/ no longer care for ST-80 compatibility
|
|
574 |
StringsAreImmutable := false. "/ no longer care for ST-80 compatibility
|
|
575 |
ImplicitSelfSends := false.
|
|
576 |
|
|
577 |
"
|
|
578 |
ParserFlags initialize
|
|
579 |
"
|
|
580 |
! !
|
|
581 |
|
|
582 |
!ParserFlags methodsFor:'accessing'!
|
|
583 |
|
|
584 |
allowArrayIndexSyntaxExtension
|
|
585 |
^ allowArrayIndexSyntaxExtension
|
|
586 |
!
|
|
587 |
|
|
588 |
allowArrayIndexSyntaxExtension:aBoolean
|
|
589 |
allowArrayIndexSyntaxExtension := aBoolean.
|
|
590 |
!
|
|
591 |
|
|
592 |
allowDollarInIdentifier
|
|
593 |
^ allowDollarInIdentifier
|
|
594 |
!
|
|
595 |
|
|
596 |
allowDollarInIdentifier:aBoolean
|
|
597 |
allowDollarInIdentifier := aBoolean.
|
|
598 |
!
|
|
599 |
|
|
600 |
allowDolphinExtensions
|
|
601 |
^ allowDolphinExtensions
|
|
602 |
!
|
|
603 |
|
|
604 |
allowDolphinExtensions:aBoolean
|
|
605 |
allowDolphinExtensions := aBoolean
|
|
606 |
!
|
|
607 |
|
|
608 |
allowDomainVariables
|
|
609 |
^ allowDomainVariables
|
|
610 |
!
|
|
611 |
|
|
612 |
allowDomainVariables:aBoolean
|
|
613 |
allowDomainVariables := aBoolean.
|
|
614 |
!
|
|
615 |
|
|
616 |
allowExtendedBinarySelectors
|
|
617 |
^ allowExtendedBinarySelectors
|
|
618 |
!
|
|
619 |
|
|
620 |
allowExtendedBinarySelectors:aBoolean
|
|
621 |
allowExtendedBinarySelectors := aBoolean.
|
|
622 |
!
|
|
623 |
|
|
624 |
allowExtendedSTXSyntax
|
|
625 |
^ allowExtendedSTXSyntax
|
|
626 |
!
|
|
627 |
|
|
628 |
allowExtendedSTXSyntax:something
|
|
629 |
allowExtendedSTXSyntax := something.
|
|
630 |
!
|
|
631 |
|
|
632 |
allowFixedPointLiterals
|
|
633 |
^ allowFixedPointLiterals
|
|
634 |
!
|
|
635 |
|
|
636 |
allowFixedPointLiterals:something
|
|
637 |
allowFixedPointLiterals := something.
|
|
638 |
!
|
|
639 |
|
|
640 |
allowFunctionCallSyntaxForBlockEvaluation
|
|
641 |
^ allowFunctionCallSyntaxForBlockEvaluation
|
|
642 |
!
|
|
643 |
|
|
644 |
allowFunctionCallSyntaxForBlockEvaluation:aBoolean
|
|
645 |
allowFunctionCallSyntaxForBlockEvaluation := aBoolean.
|
|
646 |
!
|
|
647 |
|
|
648 |
allowLazyValueExtension
|
|
649 |
^ allowLazyValueExtension
|
|
650 |
!
|
|
651 |
|
|
652 |
allowLazyValueExtension:something
|
|
653 |
allowLazyValueExtension := something.
|
|
654 |
!
|
|
655 |
|
|
656 |
allowLiteralNameSpaceSymbols
|
|
657 |
^ allowLiteralNameSpaceSymbols
|
|
658 |
!
|
|
659 |
|
|
660 |
allowLiteralNameSpaceSymbols:aBoolean
|
|
661 |
allowLiteralNameSpaceSymbols := aBoolean
|
|
662 |
!
|
|
663 |
|
|
664 |
allowLocalVariableDeclarationWithInitializerExpression
|
|
665 |
^ allowLocalVariableDeclarationWithInitializerExpression
|
|
666 |
!
|
|
667 |
|
|
668 |
allowLocalVariableDeclarationWithInitializerExpression:aBoolean
|
|
669 |
allowLocalVariableDeclarationWithInitializerExpression := aBoolean.
|
|
670 |
!
|
|
671 |
|
|
672 |
allowOldStyleAssignment
|
|
673 |
^ allowOldStyleAssignment
|
|
674 |
!
|
|
675 |
|
|
676 |
allowOldStyleAssignment:aBoolean
|
|
677 |
allowOldStyleAssignment := aBoolean
|
|
678 |
!
|
|
679 |
|
|
680 |
allowQualifiedNames
|
|
681 |
^ allowQualifiedNames
|
|
682 |
!
|
|
683 |
|
|
684 |
allowQualifiedNames:aBoolean
|
|
685 |
allowQualifiedNames := aBoolean.
|
|
686 |
!
|
|
687 |
|
|
688 |
allowReservedWordsAsSelectors
|
|
689 |
^ allowReservedWordsAsSelectors
|
|
690 |
!
|
|
691 |
|
|
692 |
allowReservedWordsAsSelectors:aBoolean
|
|
693 |
allowReservedWordsAsSelectors := aBoolean.
|
|
694 |
!
|
|
695 |
|
|
696 |
allowSqueakExtensions
|
|
697 |
"return true, if support for squeak extensions
|
|
698 |
computed arrays { .., }
|
|
699 |
c/java style arguments in message sends rec foo(arg1, ... argN)
|
|
700 |
is enabled."
|
|
701 |
|
|
702 |
^ allowSqueakExtensions
|
|
703 |
!
|
|
704 |
|
|
705 |
allowSqueakExtensions:aBoolean
|
|
706 |
"this allows turning on/off support for squeak extensions:
|
|
707 |
computed arrays { .., }
|
|
708 |
c/java style arguments in message sends rec foo(arg1, ... argN)
|
|
709 |
"
|
|
710 |
|
|
711 |
allowSqueakExtensions := aBoolean
|
|
712 |
!
|
|
713 |
|
|
714 |
allowUnderscoreInIdentifier
|
|
715 |
^ allowUnderscoreInIdentifier
|
|
716 |
!
|
|
717 |
|
|
718 |
allowUnderscoreInIdentifier:aBoolean
|
|
719 |
allowUnderscoreInIdentifier := aBoolean
|
|
720 |
!
|
|
721 |
|
|
722 |
allowVariableReferences
|
|
723 |
^ allowVariableReferences
|
|
724 |
!
|
|
725 |
|
|
726 |
allowVariableReferences:aBoolean
|
|
727 |
allowVariableReferences := aBoolean.
|
|
728 |
!
|
|
729 |
|
|
730 |
arraysAreImmutable
|
|
731 |
^ arraysAreImmutable
|
|
732 |
!
|
|
733 |
|
|
734 |
arraysAreImmutable:aBoolean
|
|
735 |
arraysAreImmutable := aBoolean.
|
|
736 |
!
|
|
737 |
|
|
738 |
implicitSelfSends
|
|
739 |
^ implicitSelfSends
|
|
740 |
!
|
|
741 |
|
|
742 |
implicitSelfSends:aBoolean
|
|
743 |
implicitSelfSends := aBoolean.
|
|
744 |
!
|
|
745 |
|
|
746 |
stringsAreImmutable
|
|
747 |
^ stringsAreImmutable
|
|
748 |
!
|
|
749 |
|
|
750 |
stringsAreImmutable:aBoolean
|
|
751 |
stringsAreImmutable := aBoolean.
|
|
752 |
!
|
|
753 |
|
1652
|
754 |
warnAboutBadComments
|
|
755 |
^ warnAboutBadComments
|
|
756 |
!
|
|
757 |
|
|
758 |
warnAboutBadComments:aBoolean
|
|
759 |
warnAboutBadComments := aBoolean.
|
|
760 |
!
|
|
761 |
|
1634
|
762 |
warnAboutVariableNameConventions
|
|
763 |
^ warnAboutVariableNameConventions
|
|
764 |
!
|
|
765 |
|
|
766 |
warnAboutVariableNameConventions:aBoolean
|
|
767 |
warnAboutVariableNameConventions := aBoolean.
|
|
768 |
!
|
|
769 |
|
|
770 |
warnAboutWrongVariableNames
|
|
771 |
^ warnAboutWrongVariableNames
|
|
772 |
!
|
|
773 |
|
|
774 |
warnAboutWrongVariableNames:aBoolean
|
|
775 |
warnAboutWrongVariableNames := aBoolean.
|
|
776 |
!
|
|
777 |
|
|
778 |
warnCommonMistakes
|
|
779 |
^ warnCommonMistakes
|
|
780 |
!
|
|
781 |
|
|
782 |
warnCommonMistakes:aBoolean
|
|
783 |
warnCommonMistakes := aBoolean.
|
|
784 |
!
|
|
785 |
|
|
786 |
warnDollarInIdentifier
|
|
787 |
^ warnDollarInIdentifier
|
|
788 |
!
|
|
789 |
|
|
790 |
warnDollarInIdentifier:aBoolean
|
|
791 |
warnDollarInIdentifier := aBoolean.
|
|
792 |
!
|
|
793 |
|
1638
|
794 |
warnHiddenVariables
|
|
795 |
^ warnHiddenVariables
|
|
796 |
!
|
|
797 |
|
|
798 |
warnHiddenVariables:aBoolean
|
|
799 |
warnHiddenVariables := aBoolean.
|
|
800 |
!
|
|
801 |
|
1634
|
802 |
warnOldStyleAssignment
|
|
803 |
^ warnOldStyleAssignment
|
|
804 |
!
|
|
805 |
|
|
806 |
warnOldStyleAssignment:aBoolean
|
|
807 |
warnOldStyleAssignment := aBoolean.
|
|
808 |
!
|
|
809 |
|
|
810 |
warnPossibleIncompatibilities
|
|
811 |
^ warnPossibleIncompatibilities
|
|
812 |
!
|
|
813 |
|
|
814 |
warnPossibleIncompatibilities:aBoolean
|
|
815 |
warnPossibleIncompatibilities := aBoolean.
|
|
816 |
!
|
|
817 |
|
|
818 |
warnST80Directives
|
|
819 |
^ warnST80Directives
|
|
820 |
!
|
|
821 |
|
|
822 |
warnST80Directives:something
|
|
823 |
warnST80Directives := something.
|
|
824 |
!
|
|
825 |
|
|
826 |
warnSTXHereExtensionUsed
|
|
827 |
^ warnSTXHereExtensionUsed
|
|
828 |
!
|
|
829 |
|
|
830 |
warnSTXHereExtensionUsed:aBoolean
|
|
831 |
warnSTXHereExtensionUsed := aBoolean.
|
|
832 |
!
|
|
833 |
|
|
834 |
warnSTXNameSpaceUse
|
|
835 |
^ warnSTXNameSpaceUse
|
|
836 |
!
|
|
837 |
|
|
838 |
warnSTXNameSpaceUse:aBoolean
|
|
839 |
warnSTXNameSpaceUse := aBoolean.
|
|
840 |
!
|
|
841 |
|
|
842 |
warnSTXSpecialComment
|
|
843 |
^ warnSTXSpecialComment
|
|
844 |
!
|
|
845 |
|
|
846 |
warnSTXSpecialComment:aBoolean
|
|
847 |
warnSTXSpecialComment := aBoolean.
|
|
848 |
!
|
|
849 |
|
|
850 |
warnUndeclared
|
|
851 |
^ warnUndeclared
|
|
852 |
!
|
|
853 |
|
|
854 |
warnUndeclared:aBoolean
|
|
855 |
warnUndeclared := aBoolean.
|
|
856 |
!
|
|
857 |
|
|
858 |
warnUnderscoreInIdentifier
|
|
859 |
^ warnUnderscoreInIdentifier
|
|
860 |
!
|
|
861 |
|
|
862 |
warnUnderscoreInIdentifier:aBoolean
|
|
863 |
warnUnderscoreInIdentifier := aBoolean.
|
|
864 |
!
|
|
865 |
|
|
866 |
warnUnusedVars
|
|
867 |
^ warnUnusedVars
|
|
868 |
!
|
|
869 |
|
|
870 |
warnUnusedVars:aBoolean
|
|
871 |
warnUnusedVars := aBoolean.
|
|
872 |
! !
|
|
873 |
|
|
874 |
!ParserFlags methodsFor:'initialization'!
|
|
875 |
|
|
876 |
initialize
|
|
877 |
warnUndeclared := WarnUndeclared.
|
|
878 |
warnUnusedVars := WarnUnusedVars.
|
|
879 |
warnST80Directives := WarnST80Directives.
|
|
880 |
warnSTXSpecialComment := WarnSTXSpecials.
|
|
881 |
warnSTXNameSpaceUse := WarnSTXSpecials.
|
|
882 |
warnSTXHereExtensionUsed := WarnSTXSpecials.
|
|
883 |
warnUnderscoreInIdentifier := WarnUnderscoreInIdentifier.
|
|
884 |
warnDollarInIdentifier := WarnDollarInIdentifier.
|
|
885 |
warnOldStyleAssignment := WarnOldStyleAssignment.
|
|
886 |
warnCommonMistakes := WarnCommonMistakes.
|
|
887 |
warnPossibleIncompatibilities := WarnPossibleIncompatibilities.
|
|
888 |
warnAboutVariableNameConventions := WarnAboutVariableNameConventions.
|
|
889 |
warnAboutWrongVariableNames := WarnAboutWrongVariableNames.
|
1652
|
890 |
warnAboutBadComments := WarnAboutBadComments.
|
1638
|
891 |
warnHiddenVariables := WarnHiddenVariables.
|
1634
|
892 |
|
|
893 |
allowUnderscoreInIdentifier := AllowUnderscoreInIdentifier.
|
|
894 |
allowDollarInIdentifier := AllowDollarInIdentifier.
|
|
895 |
allowOldStyleAssignment := AllowOldStyleAssignment.
|
|
896 |
allowSqueakExtensions := AllowSqueakExtensions.
|
|
897 |
allowDolphinExtensions := AllowDolphinExtensions.
|
|
898 |
allowLiteralNameSpaceSymbols := AllowLiteralNameSpaceSymbols.
|
|
899 |
allowExtendedBinarySelectors := AllowExtendedBinarySelectors.
|
|
900 |
allowFunctionCallSyntaxForBlockEvaluation := AllowFunctionCallSyntaxForBlockEvaluation.
|
|
901 |
allowLocalVariableDeclarationWithInitializerExpression := AllowLocalVariableDeclarationWithInitializerExpression.
|
|
902 |
allowDomainVariables := AllowDomainVariables.
|
|
903 |
allowArrayIndexSyntaxExtension := AllowArrayIndexSyntaxExtension.
|
|
904 |
allowReservedWordsAsSelectors := AllowReservedWordsAsSelectors.
|
|
905 |
allowVariableReferences := AllowVariableReferences.
|
|
906 |
allowLazyValueExtension := AllowLazyValueExtension.
|
|
907 |
allowFixedPointLiterals := AllowFixedPointLiterals.
|
|
908 |
allowExtendedSTXSyntax := AllowExtendedSTXSyntax.
|
|
909 |
allowQualifiedNames := AllowQualifiedNames.
|
|
910 |
|
|
911 |
arraysAreImmutable := ArraysAreImmutable ? true.
|
|
912 |
stringsAreImmutable := StringsAreImmutable ? true.
|
|
913 |
implicitSelfSends := ImplicitSelfSends ? false.
|
|
914 |
|
|
915 |
"
|
|
916 |
ParserFlags initialize.
|
|
917 |
self new inspect.
|
|
918 |
"
|
|
919 |
! !
|
|
920 |
|
|
921 |
!ParserFlags class methodsFor:'documentation'!
|
|
922 |
|
|
923 |
version
|
1652
|
924 |
^ '$Header: /cvs/stx/stx/libcomp/ParserFlags.st,v 1.3 2006-01-25 09:49:45 cg Exp $'
|
1634
|
925 |
! !
|
|
926 |
|
|
927 |
ParserFlags initialize!
|