--- a/ParserFlags.st Fri Feb 06 11:36:04 2015 +0100
+++ b/ParserFlags.st Sat Feb 07 12:09:42 2015 +0100
@@ -10,96 +10,7 @@
other person. No title to or ownership of the software is
hereby transferred.
"
-"{ Package: 'stx:libcomp' }"
-
-"{ NameSpace: Smalltalk }"
-
-Object subclass:#ParserFlags
- instanceVariableNames:'warnings warnUnusedVars warnUndeclared warnST80Directives
- warnSTXHereExtensionUsed warnSTXSpecialComment
- warnUnderscoreInIdentifier warnOldStyleAssignment
- warnCommonMistakes warnSTXNameSpaceUse
- warnPossibleIncompatibilities warnDollarInIdentifier
- warnHiddenVariables warnAboutVariableNameConventions
- warnAboutWrongVariableNames warnAboutBadComments
- warnInconsistentReturnValues
- warnAboutNonLowercaseLocalVariableNames
- warnAboutPossibleSTCCompilationProblems
- warnAboutReferenceToPrivateClass warnAboutShortLocalVariableNames
- warnAboutPossiblyUnimplementedSelectors
- warnAboutUnknownCharacterEscapesInJavaScriptStringConstant
- warnPlausibilityChecks allowLiteralNameSpaceSymbols
- allowUnderscoreInIdentifier allowDollarInIdentifier
- allowOldStyleAssignment allowSqueakExtensions
- allowDolphinExtensions allowExtendedBinarySelectors
- allowQualifiedNames allowFunctionCallSyntaxForBlockEvaluation
- allowLocalVariableDeclarationWithInitializerExpression
- allowDomainVariables allowArrayIndexSyntaxExtension
- allowReservedWordsAsSelectors allowVariableReferences
- allowLazyValueExtension allowFixedPointLiterals
- allowExtendedSTXSyntax allowVisualAgeESSymbolLiterals
- allowExtensionsToPrivateClasses allowSqueakPrimitives
- allowVisualAgePrimitives allowSTVPrimitives allowSTVExtensions
- allowNationalCharactersInIdentifier allowHashAsBinarySelector
- allowSTXEOLComments allowEmptyStatements
- allowVisualWorksMethodAnnotations
- allowPossibleSTCCompilationProblems arraysAreImmutable
- stringsAreImmutable implicitSelfSends stcKeepCIntermediate
- stcKeepOIntermediate stcKeepSTIntermediate stcModulePath
- stcCompilation stcCompilationIncludes stcCompilationDefines
- stcCompilationOptions stcPath ccCompilationOptions ccPath
- linkArgs linkSharedArgs linkCommand libPath searchedLibraries
- warnAboutPeriodInSymbol allowPeriodInSymbol allowCaretAsBinop
- allowUnicodeStrings allowUnicodeCharacters allowCharacterEscapes
- allowStringEscapes allowAssignmentToBlockArgument
- allowAssignmentToMethodArgument allowAssignmentToPoolVariable
- lineNumberInfo allowSTXDelimiterComments
- warnAssignmentToBlockArgument warnAssignmentToMethodArgument
- warnAssignmentToPoolVariable'
- classVariableNames:'WarnST80Directives WarnUnusedVars WarnUndeclared
- WarnAboutWrongVariableNames WarnAboutBadComments
- WarnAboutVariableNameConventions WarnSTXSpecials
- WarnOldStyleAssignment WarnUnderscoreInIdentifier
- WarnCommonMistakes WarnPossibleIncompatibilities
- WarnDollarInIdentifier WarnHiddenVariables
- WarnAboutNonLowercaseLocalVariableNames
- WarnInconsistentReturnValues Warnings
- WarnAboutPossibleSTCCompilationProblems
- WarnAboutReferenceToPrivateClass WarnAboutShortLocalVariableNames
- WarnAboutPossiblyUnimplementedSelectors WarnAboutPeriodInSymbol
- WarnAboutUnknownCharacterEscapesInJavaScriptStringConstant
- WarnPlausibilityChecks AllowUnderscoreInIdentifier
- AllowFunctionCallSyntaxForBlockEvaluation AllowLazyValueExtension
- AllowVariableReferences AllowReservedWordsAsSelectors
- AllowLocalVariableDeclarationWithInitializerExpression
- AllowArrayIndexSyntaxExtension AllowDomainVariables
- AllowDollarInIdentifier AllowSqueakExtensions AllowQualifiedNames
- AllowDolphinExtensions AllowOldStyleAssignment
- AllowExtendedBinarySelectors AllowExtendedSTXSyntax
- AllowFixedPointLiterals AllowLiteralNameSpaceSymbols
- AllowVisualAgeESSymbolLiterals AllowExtensionsToPrivateClasses
- AllowSqueakPrimitives AllowVisualAgePrimitives AllowSTVPrimitives
- AllowSTVExtensions AllowNationalCharactersInIdentifier
- AllowHashAsBinarySelector AllowSTXEOLComments
- AllowPossibleSTCCompilationProblems AllowEmptyStatements
- AllowVisualWorksMethodAnnotations ArraysAreImmutable
- AllowPeriodInSymbol StringsAreImmutable ImplicitSelfSends
- STCModulePath STCKeepCIntermediate STCKeepOIntermediate
- STCKeepSTIntermediate STCCompilation STCCompilationIncludes
- STCCompilationDefines STCCompilationOptions STCPath
- CCCompilationOptions CCPath LinkArgs LinkSharedArgs LinkCommand
- LibPath SearchedLibraries MakeCommand AllowCaretAsBinop
- AllowUnicodeStrings AllowUnicodeCharacters AllowCharacterEscapes
- AllowStringEscapes AllowAssignmentToBlockArgument
- AllowAssignmentToMethodArgument AllowAssignmentToPoolVariable
- LineNumberInfo LibDirectory VCTop SDKTop BCCTop ForcedCompiler
- DefineForBorlandC DefineForVisualC DefineForMSC DefineForGNUC
- PerMethodFlags AllowSTXDelimiterComments DefineForMINGW32
- DefineForMINGW64 DefineForMINGW WarnAssignmentToBlockArgument
- WarnAssignmentToPoolVariable WarnAssignmentToMethodArgument'
- poolDictionaries:''
- category:'System-Compiler'
-!
+"{ Package: 'stx:libcomp' }"
"{ NameSpace: Smalltalk }"
Object subclass:#ParserFlags
instanceVariableNames:'warnings warnUnusedVars warnUndeclared warnST80Directives
warnSTXHereExtensionUsed warnSTXSpecialComment
warnUnderscoreInIdentifier warnOldStyleAssignment
warnCommonMistakes warnSTXNameSpaceUse
warnPossibleIncompatibilities warnDollarInIdentifier
warnHiddenVariables warnAboutVariableNameConventions
warnAboutWrongVariableNames warnAboutBadComments
warnInconsistentReturnValues
warnAboutNonLowercaseLocalVariableNames
warnAboutPossibleSTCCompilationProblems
warnAboutReferenceToPrivateClass warnAboutShortLocalVariableNames
warnAboutPossiblyUnimplementedSelectors
warnAboutUnknownCharacterEscapesInJavaScriptStringConstant
warnPlausibilityChecks allowLiteralNameSpaceSymbols
allowUnderscoreInIdentifier allowDollarInIdentifier
allowOldStyleAssignment allowSqueakExtensions
allowDolphinExtensions allowExtendedBinarySelectors
allowQualifiedNames allowFunctionCallSyntaxForBlockEvaluation
allowLocalVariableDeclarationWithInitializerExpression
allowDomainVariables allowArrayIndexSyntaxExtension
allowReservedWordsAsSelectors allowVariableReferences
allowLazyValueExtension allowFixedPointLiterals
allowExtendedSTXSyntax allowVisualAgeESSymbolLiterals
allowExtensionsToPrivateClasses allowSqueakPrimitives
allowVisualAgePrimitives allowSTVPrimitives allowSTVExtensions
allowNationalCharactersInIdentifier allowHashAsBinarySelector
allowSTXEOLComments allowEmptyStatements
allowVisualWorksMethodAnnotations
allowPossibleSTCCompilationProblems arraysAreImmutable
stringsAreImmutable implicitSelfSends stcKeepCIntermediate
stcKeepOIntermediate stcKeepSTIntermediate stcModulePath
stcCompilation stcCompilationIncludes stcCompilationDefines
stcCompilationOptions stcPath ccCompilationOptions ccPath
linkArgs linkSharedArgs linkCommand libPath searchedLibraries
warnAboutPeriodInSymbol allowPeriodInSymbol allowCaretAsBinop
allowUnicodeStrings allowUnicodeCharacters allowCharacterEscapes
allowStringEscapes allowAssignmentToBlockArgument
allowAssignmentToMethodArgument allowAssignmentToPoolVariable
lineNumberInfo allowSTXDelimiterComments
warnAssignmentToBlockArgument warnAssignmentToMethodArgument
warnAssignmentToPoolVariable'
classVariableNames:'WarnST80Directives WarnUnusedVars WarnUndeclared
WarnAboutWrongVariableNames WarnAboutBadComments
WarnAboutVariableNameConventions WarnSTXSpecials
WarnOldStyleAssignment WarnUnderscoreInIdentifier
WarnCommonMistakes WarnPossibleIncompatibilities
WarnDollarInIdentifier WarnHiddenVariables
WarnAboutNonLowercaseLocalVariableNames
WarnInconsistentReturnValues Warnings
WarnAboutPossibleSTCCompilationProblems
WarnAboutReferenceToPrivateClass WarnAboutShortLocalVariableNames
WarnAboutPossiblyUnimplementedSelectors WarnAboutPeriodInSymbol
WarnAboutUnknownCharacterEscapesInJavaScriptStringConstant
WarnPlausibilityChecks AllowUnderscoreInIdentifier
AllowFunctionCallSyntaxForBlockEvaluation AllowLazyValueExtension
AllowVariableReferences AllowReservedWordsAsSelectors
AllowLocalVariableDeclarationWithInitializerExpression
AllowArrayIndexSyntaxExtension AllowDomainVariables
AllowDollarInIdentifier AllowSqueakExtensions AllowQualifiedNames
AllowDolphinExtensions AllowOldStyleAssignment
AllowExtendedBinarySelectors AllowExtendedSTXSyntax
AllowFixedPointLiterals AllowLiteralNameSpaceSymbols
AllowVisualAgeESSymbolLiterals AllowExtensionsToPrivateClasses
AllowSqueakPrimitives AllowVisualAgePrimitives AllowSTVPrimitives
AllowSTVExtensions AllowNationalCharactersInIdentifier
AllowHashAsBinarySelector AllowSTXEOLComments
AllowPossibleSTCCompilationProblems AllowEmptyStatements
AllowVisualWorksMethodAnnotations ArraysAreImmutable
AllowPeriodInSymbol StringsAreImmutable ImplicitSelfSends
STCModulePath STCKeepCIntermediate STCKeepOIntermediate
STCKeepSTIntermediate STCCompilation STCCompilationIncludes
STCCompilationDefines STCCompilationOptions STCPath
CCCompilationOptions CCPath LinkArgs LinkSharedArgs LinkCommand
LibPath SearchedLibraries MakeCommand AllowCaretAsBinop
AllowUnicodeStrings AllowUnicodeCharacters AllowCharacterEscapes
AllowStringEscapes AllowAssignmentToBlockArgument
AllowAssignmentToMethodArgument AllowAssignmentToPoolVariable
LineNumberInfo LibDirectory VCTop SDKTop BCCTop ForcedCompiler
DefineForBorlandC DefineForVisualC DefineForMSC DefineForGNUC
PerMethodFlags AllowSTXDelimiterComments DefineForMINGW32
DefineForMINGW64 DefineForMINGW WarnAssignmentToBlockArgument
WarnAssignmentToPoolVariable WarnAssignmentToMethodArgument'
poolDictionaries:''
category:'System-Compiler'
!
!ParserFlags class methodsFor:'documentation'!
@@ -893,27 +804,9 @@
"
!
-allowQualifiedNames
- "return true, if #{..} qualified names are allowed"
-
- ^ AllowQualifiedNames
-!
-
-allowQualifiedNames:aBoolean
- "this allows turning on/off support for qualifiedNames #{ .., } as in vw3.
- If you want to fileIn vw3 or later classes, enable this with:
- Compiler allowQualifiedNames:true
- Notice, that qualified names are not really supported semantically
- (they are parsed, but treated like regular globals)
- "
-
- AllowQualifiedNames := aBoolean.
-
- "
- self allowQualifiedNames:true
- self allowQualifiedNames:false
- "
-!
+allowQualifiedNames
"return true, if #{..} qualified names are allowed"
^ AllowQualifiedNames
!
+
+allowQualifiedNames:aBoolean
"this allows turning on/off support for qualifiedNames #{ .., } as in vw3.
If you want to fileIn vw3 or later classes, enable this with:
Compiler allowQualifiedNames:true
Notice, that qualified names are not really supported semantically
(they are parsed, but treated like regular globals)
"
AllowQualifiedNames := aBoolean.
"
self allowQualifiedNames:true
self allowQualifiedNames:false
"
!
allowReservedWordsAsSelectors
"return true, if self, super, thisContext, nil, true and false are to be allowed
@@ -1019,30 +912,9 @@
"
!
-allowSqueakExtensions
- "return true, if support for squeak extensions
- computed arrays { .., }
- c/java style arguments in message sends rec foo(arg1, ... argN)
- is enabled."
-
- ^ AllowSqueakExtensions
-!
-
-allowSqueakExtensions:aBoolean
- "this allows turning on/off support for squeak extensions:
- computed arrays { .., }
- c/java style arguments in message sends rec foo(arg1, ... argN)
-
- If you want to fileIn Squeak classes, enable this with:
- Compiler allowSqueakComputedArrays:true"
-
- AllowSqueakExtensions := aBoolean.
-
- "
- self allowSqueakExtensions:true
- self allowSqueakExtensions:false
- "
-!
+allowSqueakExtensions
"return true, if support for squeak extensions
computed arrays { .., }
c/java style arguments in message sends rec foo(arg1, ... argN)
is enabled."
^ AllowSqueakExtensions
!
+
+allowSqueakExtensions:aBoolean
"this allows turning on/off support for squeak extensions:
computed arrays { .., }
c/java style arguments in message sends rec foo(arg1, ... argN)
If you want to fileIn Squeak classes, enable this with:
Compiler allowSqueakComputedArrays:true"
AllowSqueakExtensions := aBoolean.
"
self allowSqueakExtensions:true
self allowSqueakExtensions:false
"
!
allowSqueakPrimitives
"return true, if support for squeak primitives is enabled."
@@ -1487,262 +1359,9 @@
!ParserFlags class methodsFor:'class initialization'!
-initialize
- |executablePath|
-
- Warnings := true.
- WarnUndeclared := true.
- WarnUnusedVars := true.
- WarnSTXSpecials := false.
- WarnST80Directives := false.
- WarnAboutWrongVariableNames := true.
- WarnAboutVariableNameConventions := true.
- WarnAboutBadComments := true.
- WarnUnderscoreInIdentifier := false.
- WarnDollarInIdentifier := true.
- WarnOldStyleAssignment := true.
- WarnCommonMistakes := true.
- WarnPossibleIncompatibilities := false.
- WarnHiddenVariables := true.
- WarnInconsistentReturnValues := true.
- WarnAboutNonLowercaseLocalVariableNames := true.
- WarnAboutShortLocalVariableNames := false.
- WarnAboutPossibleSTCCompilationProblems := true.
- WarnAboutReferenceToPrivateClass := true.
- WarnAboutPossiblyUnimplementedSelectors := true.
- WarnAboutPeriodInSymbol := true.
- WarnAboutUnknownCharacterEscapesInJavaScriptStringConstant := false.
- WarnPlausibilityChecks := true.
- WarnAssignmentToBlockArgument := true.
- WarnAssignmentToMethodArgument := true.
- WarnAssignmentToPoolVariable := true.
-
- AllowReservedWordsAsSelectors := false.
- AllowUnderscoreInIdentifier := true.
- AllowDollarInIdentifier := false. "/ st80-vms dollars in identifiers
- AllowOldStyleAssignment := true. "/ st80 underscore as assignment
- AllowDolphinExtensions := false. "/ dolphin computed literal
- AllowQualifiedNames := false. "/ vw3 qualified names
- AllowExtendedBinarySelectors := false. "/ vw5.4 extended binary selectors (plus/minus, center-dot etc.)
- AllowCaretAsBinop := false. "/ too dangerous
- AllowLiteralNameSpaceSymbols := true. "/ st/x literal nameSpace-symbols (#foo::bar)
- AllowArrayIndexSyntaxExtension := false.
- AllowFunctionCallSyntaxForBlockEvaluation := false.
- AllowLocalVariableDeclarationWithInitializerExpression := false.
- AllowDomainVariables := false.
- AllowArrayIndexSyntaxExtension := false.
- AllowReservedWordsAsSelectors := true.
- AllowVariableReferences := false.
- AllowLazyValueExtension := false.
- AllowFixedPointLiterals := true "false".
- AllowExtendedSTXSyntax := false.
- AllowVisualAgeESSymbolLiterals := false.
- AllowExtensionsToPrivateClasses := true.
- AllowVisualAgePrimitives := false.
- AllowSqueakExtensions := true. "/ squeak computed array
- AllowSqueakPrimitives := false.
- AllowSTVPrimitives := false. "/ number-sign syntax
- AllowSTVExtensions := false.
- AllowNationalCharactersInIdentifier := false.
- AllowHashAsBinarySelector := true.
- AllowSTXEOLComments := true.
- AllowSTXDelimiterComments := true. "/ until stc and RBScanner support it also
- AllowVisualWorksMethodAnnotations := false.
- AllowPossibleSTCCompilationProblems := false.
- AllowEmptyStatements := false.
- AllowPeriodInSymbol := false.
- "/ these are only used by the new compiler
- AllowUnicodeStrings := false.
- AllowUnicodeCharacters := false.
- AllowCharacterEscapes := false.
- AllowStringEscapes := false.
- AllowAssignmentToBlockArgument := false.
- AllowAssignmentToMethodArgument := false.
- AllowAssignmentToPoolVariable := false.
- "/ AllowAssignmentToPoolVariable := true.
-
- ArraysAreImmutable := false. "/ still care for ST-80 compatibility
- StringsAreImmutable := false. "/ still care for ST-80 compatibility
- "/ ArraysAreImmutable := true. "/ do not care for ST-80 compatibility
- "/ StringsAreImmutable := true. "/ do not care for ST-80 compatibility
- ImplicitSelfSends := false.
-
- STCKeepCIntermediate := false.
- STCKeepOIntermediate := false.
- STCKeepSTIntermediate := false.
- STCCompilation := #default.
-
- DefineForBorlandC := '__BORLANDC__'.
- DefineForVisualC := '__VISUALC__'.
- DefineForMSC := '__MSC__'.
- DefineForGNUC := '__GNUC__'.
- DefineForMINGW := '__MINGW__'.
- DefineForMINGW32 := '__MINGW32__'.
- DefineForMINGW64 := '__MINGW64__'.
-
- (executablePath := OperatingSystem pathOfSTXExecutable) notNil ifTrue:[
- executablePath := executablePath asFilename directory.
- (((executablePath / 'include') exists and:[(executablePath / 'stc') exists])
- or:[
- executablePath := executablePath directory.
- ((executablePath / 'include') exists and:[(executablePath / 'stc') exists])
- or:[
- executablePath := executablePath directory.
- ((executablePath / 'include') exists and:[(executablePath / 'stc') exists])
- ]
- ]
- ) ifTrue:[
- self initializeSTCFlagsForTopDirectory: executablePath.
- ]
- ].
-
- "
- ParserFlags initialize
- "
-
- "Modified: / 09-08-2006 / 18:47:18 / fm"
- "Modified: / 31-01-2012 / 12:06:32 / cg"
-!
-
-initializeSTCFlagsForTopDirectory:topDirArg
- "topDirArg must be the stx directory (where stc directory with stc-executable is found)
- notice: for now, can only initialize for borland+windows or linux;
- visualC setup still fails."
-
- |topDir topDirName vcTop sdkTop bccTop borlandDir useBorlandC useVisualC useMingw m32 programFiles|
-
- topDir := topDirArg.
- OperatingSystem isMSWINDOWSlike ifTrue:[
- topDirArg isString ifTrue:[
- topDir := topDirArg copyReplaceAll:$/ with:$\ ifNone:topDirArg.
- ]
- ].
- topDir := topDir asFilename.
- topDirName := topDir name.
-
- "/ if in the development directory, use ./modules
- Smalltalk isSmalltalkDevelopmentSystem ifTrue:[
- STCModulePath := 'modules'.
- ] ifFalse:[
- STCModulePath := Filename tempDirectory constructString:'modules'.
- ].
-
- (topDir construct:'stc') exists ifFalse:[
- ('ParserFlags [warning]: stc not found in "',topDirName,'"') infoPrintCR.
- 'ParserFlags [warning]: stc-compiling (primitive code) will not work in the browser' infoPrintCR.
- STCCompilation := #never.
- ].
-
- OperatingSystem isMSWINDOWSlike ifTrue:[
- useBorlandC := useVisualC := useMingw := false.
- programFiles := OperatingSystem getEnvironment:'ProgramFiles'.
- programFiles isEmptyOrNil ifTrue:[ programFiles := 'C:\Program Files' ].
-
- STCCompilationIncludes := '-I',topDirName,'\include -I',topDirName,'\libopengl'.
- (bccTop := BCCTop) isNil ifTrue:[
- borlandDir := OperatingSystem getEnvironment:'BCCDIR'.
- borlandDir isEmptyOrNil ifTrue:[ borlandDir := 'C:\Borland\bcc55' ].
- bccTop := {
- (borlandDir) .
- (programFiles , '\Borland\bcc55') .
- (programFiles , '\bcc55') .
- } detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]]
- ifNone:nil.
- ].
-
- (bccTop notNil and:[bccTop asFilename exists]) ifTrue:[
- STCCompilationIncludes := STCCompilationIncludes,' -I',bccTop,'\Include'.
- LibDirectory := topDirName,'\lib\bc'.
- LinkArgs := '-L',topDirName,'\lib\bc'.
- LinkArgs := LinkArgs,' -L',bccTop,'\Lib -r -c -ap -Tpd -Gi -w-dup'.
- CCPath := 'bcc32'.
- MakeCommand := 'bmake'.
- LinkCommand := 'ilink32'.
- CCCompilationOptions := '-w-'.
- useBorlandC := true.
- ] ifFalse:[
- (vcTop := VCTop) isNil ifTrue:[
- vcTop := {
- (programFiles,'\Microsoft Visual Studio 12.0\VC') .
- (programFiles,'\Microsoft Visual Studio 11.0\VC') .
- (programFiles,'\Microsoft Visual Studio 10.0\VC') .
- (programFiles,'\Microsoft Visual Studio 9.0\VC' ) .
- } detect:[:path | path asFilename exists and:[(path asFilename construct:'bin/cl.exe') exists]]
- ifNone:nil.
- ].
- (vcTop notNil and:[vcTop asFilename exists]) ifTrue:[
- useVisualC := true.
- STCCompilationIncludes := STCCompilationIncludes,' -I',vcTop,'include'.
-
- (sdkTop := SDKTop) isNil ifTrue:[
- sdkTop := {
- (programFiles,'\Microsoft SDKs\Windows\v8.0A') .
- (programFiles,'\Microsoft SDKs\Windows\v7.0A') .
- (programFiles,'\Microsoft SDKs\Windows\v6.0A') .
- } detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]] ifNone:nil.
- ].
- (sdkTop notNil and:[sdkTop asFilename exists]) ifTrue:[
- STCCompilationIncludes := STCCompilationIncludes,' -I',sdkTop,'\include'.
- ].
- LibDirectory := topDirName,'\lib\vc'.
- LinkArgs := '-L',topDirName,'\lib\vc'.
- LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
- CCPath := vcTop,'\bin\cl.exe'.
- LinkCommand := 'ilink32'.
- MakeCommand := 'vcmake'.
- CCCompilationOptions := '/nologo /ZI /w /GF /EHsc /FR.\objvc\'.
- ] ifFalse:[
- "/ add definitions for lcc, mingc etc.
- STCCompilationIncludes := STCCompilationIncludes,' -IC:\xxxxx\Include'.
- LibDirectory := topDirName,'\lib\vc'.
- LinkArgs := '-L',topDirName,'\lib\vc'.
- LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
- ].
- ].
- STCCompilationDefines := '-DWIN32'.
- STCCompilationOptions := '+optinline +inlineNew'.
- (topDirName,'\stc\stc.exe') asFilename exists ifTrue:[
- STCPath := (topDirName,'\stc\stc.exe').
- ] ifFalse:[
- STCPath := 'stc.exe'.
- ].
- LibPath := ''.
- SearchedLibraries := #('import32.lib').
- "/ SearchedLibraries := #('import32.lib' 'glu32.lib' 'opengl32.lib').
- ] ifFalse:[
- STCCompilationIncludes := '-I',topDirName,'/include'.
- STCCompilationDefines := ''.
- STCCompilationOptions := '+optinline +inlineNew'.
- STCPath := topDirName,'/stc/stc'.
-
- m32 := ''.
- (ExternalAddress pointerSize == 4) ifTrue:[
- m32 := ' -m32'
- ].
- CCCompilationOptions := OperatingSystem getCPUDefine,
- ' -D', self usedCompilerDefine,
- ' ', OperatingSystem getOSDefine,
- ' ', '-O', m32.
- ParserFlags useGnuC ifTrue:[
- CCPath := 'gcc'
- ] ifFalse:[
- CCPath := 'cc'
- ].
- LinkArgs := m32.
- LinkSharedArgs := '-shared', m32.
- LinkCommand := CCPath.
- LibPath := ''.
- SearchedLibraries := #().
- MakeCommand := 'make'.
- ].
-
- "
- ParserFlags initializeSTCFlagsForTopDirectory:'../..'
- "
-
- "Modified: / 09-08-2006 / 18:47:18 / fm"
- "Created: / 06-08-2011 / 19:47:47 / cg"
-! !
+initialize
|executablePath|
Warnings := true.
WarnUndeclared := true.
WarnUnusedVars := true.
WarnSTXSpecials := false.
WarnST80Directives := false.
WarnAboutWrongVariableNames := true.
WarnAboutVariableNameConventions := true.
WarnAboutBadComments := true.
WarnUnderscoreInIdentifier := false.
WarnDollarInIdentifier := true.
WarnOldStyleAssignment := true.
WarnCommonMistakes := true.
WarnPossibleIncompatibilities := false.
WarnHiddenVariables := true.
WarnInconsistentReturnValues := true.
WarnAboutNonLowercaseLocalVariableNames := true.
WarnAboutShortLocalVariableNames := false.
WarnAboutPossibleSTCCompilationProblems := true.
WarnAboutReferenceToPrivateClass := true.
WarnAboutPossiblyUnimplementedSelectors := true.
WarnAboutPeriodInSymbol := true.
WarnAboutUnknownCharacterEscapesInJavaScriptStringConstant := false.
WarnPlausibilityChecks := true.
WarnAssignmentToBlockArgument := true.
WarnAssignmentToMethodArgument := true.
WarnAssignmentToPoolVariable := true.
AllowReservedWordsAsSelectors := false.
AllowUnderscoreInIdentifier := true.
AllowDollarInIdentifier := false. "/ st80-vms dollars in identifiers
AllowOldStyleAssignment := true. "/ st80 underscore as assignment
AllowDolphinExtensions := false. "/ dolphin computed literal
AllowQualifiedNames := false. "/ vw3 qualified names
AllowExtendedBinarySelectors := false. "/ vw5.4 extended binary selectors (plus/minus, center-dot etc.)
AllowCaretAsBinop := false. "/ too dangerous
AllowLiteralNameSpaceSymbols := true. "/ st/x literal nameSpace-symbols (#foo::bar)
AllowArrayIndexSyntaxExtension := false.
AllowFunctionCallSyntaxForBlockEvaluation := false.
AllowLocalVariableDeclarationWithInitializerExpression := false.
AllowDomainVariables := false.
AllowArrayIndexSyntaxExtension := false.
AllowReservedWordsAsSelectors := true.
AllowVariableReferences := false.
AllowLazyValueExtension := false.
AllowFixedPointLiterals := true "false".
AllowExtendedSTXSyntax := false.
AllowVisualAgeESSymbolLiterals := false.
AllowExtensionsToPrivateClasses := true.
AllowVisualAgePrimitives := false.
AllowSqueakExtensions := true. "/ squeak computed array
AllowSqueakPrimitives := false.
AllowSTVPrimitives := false. "/ number-sign syntax
AllowSTVExtensions := false.
AllowNationalCharactersInIdentifier := false.
AllowHashAsBinarySelector := true.
AllowSTXEOLComments := true.
AllowSTXDelimiterComments := true. "/ until stc and RBScanner support it also
AllowVisualWorksMethodAnnotations := false.
AllowPossibleSTCCompilationProblems := true. "/ must be true, to allow fileIn!!
AllowEmptyStatements := false.
AllowPeriodInSymbol := false.
"/ these are only used by the new compiler
AllowUnicodeStrings := false.
AllowUnicodeCharacters := false.
AllowCharacterEscapes := false.
AllowStringEscapes := false.
AllowAssignmentToBlockArgument := false.
AllowAssignmentToMethodArgument := false.
AllowAssignmentToPoolVariable := false.
"/ AllowAssignmentToPoolVariable := true.
ArraysAreImmutable := false. "/ still care for ST-80 compatibility
StringsAreImmutable := false. "/ still care for ST-80 compatibility
"/ ArraysAreImmutable := true. "/ do not care for ST-80 compatibility
"/ StringsAreImmutable := true. "/ do not care for ST-80 compatibility
ImplicitSelfSends := false.
STCKeepCIntermediate := false.
STCKeepOIntermediate := false.
STCKeepSTIntermediate := false.
STCCompilation := #default.
DefineForBorlandC := '__BORLANDC__'.
DefineForVisualC := '__VISUALC__'.
DefineForMSC := '__MSC__'.
DefineForGNUC := '__GNUC__'.
DefineForMINGW := '__MINGW__'.
DefineForMINGW32 := '__MINGW32__'.
DefineForMINGW64 := '__MINGW64__'.
(executablePath := OperatingSystem pathOfSTXExecutable) notNil ifTrue:[
executablePath := executablePath asFilename directory.
(((executablePath / 'include') exists and:[(executablePath / 'stc') exists])
or:[
executablePath := executablePath directory.
((executablePath / 'include') exists and:[(executablePath / 'stc') exists])
or:[
executablePath := executablePath directory.
((executablePath / 'include') exists and:[(executablePath / 'stc') exists])
]
]
) ifTrue:[
self initializeSTCFlagsForTopDirectory: executablePath.
]
].
"
ParserFlags initialize
"
"Modified: / 09-08-2006 / 18:47:18 / fm"
"Modified: / 31-01-2012 / 12:06:32 / cg"
!
+
+initializeSTCFlagsForTopDirectory:topDirArg
"topDirArg must be the stx directory (where stc directory with stc-executable is found)
notice: for now, can only initialize for borland+windows or linux;
visualC setup still fails."
|topDir topDirName vcTop sdkTop bccTop borlandDir useBorlandC useVisualC useMingw m32 programFiles|
topDir := topDirArg.
OperatingSystem isMSWINDOWSlike ifTrue:[
topDirArg isString ifTrue:[
topDir := topDirArg copyReplaceAll:$/ with:$\ ifNone:topDirArg.
]
].
topDir := topDir asFilename.
topDirName := topDir name.
"/ if in the development directory, use ./modules
Smalltalk isSmalltalkDevelopmentSystem ifTrue:[
STCModulePath := 'modules'.
] ifFalse:[
STCModulePath := Filename tempDirectory constructString:'modules'.
].
(topDir construct:'stc') exists ifFalse:[
('ParserFlags [warning]: stc not found in "',topDirName,'"') infoPrintCR.
'ParserFlags [warning]: stc-compiling (primitive code) will not work in the browser' infoPrintCR.
STCCompilation := #never.
].
OperatingSystem isMSWINDOWSlike ifTrue:[
useBorlandC := useVisualC := useMingw := false.
programFiles := OperatingSystem getEnvironment:'ProgramFiles'.
programFiles isEmptyOrNil ifTrue:[ programFiles := 'C:\Program Files' ].
STCCompilationIncludes := '-I',topDirName,'\include -I',topDirName,'\libopengl'.
(bccTop := BCCTop) isNil ifTrue:[
borlandDir := OperatingSystem getEnvironment:'BCCDIR'.
borlandDir isEmptyOrNil ifTrue:[ borlandDir := 'C:\Borland\bcc55' ].
bccTop := {
(borlandDir) .
(programFiles , '\Borland\bcc55') .
(programFiles , '\bcc55') .
} detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]]
ifNone:nil.
].
(bccTop notNil and:[bccTop asFilename exists]) ifTrue:[
STCCompilationIncludes := STCCompilationIncludes,' -I',bccTop,'\Include'.
LibDirectory := topDirName,'\lib\bc'.
LinkArgs := '-L',topDirName,'\lib\bc'.
LinkArgs := LinkArgs,' -L',bccTop,'\Lib -r -c -ap -Tpd -Gi -w-dup'.
CCPath := 'bcc32'.
MakeCommand := 'bmake'.
LinkCommand := 'ilink32'.
CCCompilationOptions := '-w-'.
useBorlandC := true.
] ifFalse:[
(vcTop := VCTop) isNil ifTrue:[
vcTop := {
(programFiles,'\Microsoft Visual Studio 12.0\VC') .
(programFiles,'\Microsoft Visual Studio 11.0\VC') .
(programFiles,'\Microsoft Visual Studio 10.0\VC') .
(programFiles,'\Microsoft Visual Studio 9.0\VC' ) .
} detect:[:path | path asFilename exists and:[(path asFilename construct:'bin/cl.exe') exists]]
ifNone:nil.
].
(vcTop notNil and:[vcTop asFilename exists]) ifTrue:[
useVisualC := true.
STCCompilationIncludes := STCCompilationIncludes,' -I',vcTop,'include'.
(sdkTop := SDKTop) isNil ifTrue:[
sdkTop := {
(programFiles,'\Microsoft SDKs\Windows\v8.0A') .
(programFiles,'\Microsoft SDKs\Windows\v7.0A') .
(programFiles,'\Microsoft SDKs\Windows\v6.0A') .
} detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]] ifNone:nil.
].
(sdkTop notNil and:[sdkTop asFilename exists]) ifTrue:[
STCCompilationIncludes := STCCompilationIncludes,' -I',sdkTop,'\include'.
].
LibDirectory := topDirName,'\lib\vc'.
LinkArgs := '-L',topDirName,'\lib\vc'.
LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
CCPath := vcTop,'\bin\cl.exe'.
LinkCommand := 'ilink32'.
MakeCommand := 'vcmake'.
CCCompilationOptions := '/nologo /ZI /w /GF /EHsc /FR.\objvc\'.
] ifFalse:[
"/ add definitions for lcc, mingc etc.
STCCompilationIncludes := STCCompilationIncludes,' -IC:\xxxxx\Include'.
LibDirectory := topDirName,'\lib\vc'.
LinkArgs := '-L',topDirName,'\lib\vc'.
LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
].
].
STCCompilationDefines := '-DWIN32'.
STCCompilationOptions := '+optinline +inlineNew'.
(topDirName,'\stc\stc.exe') asFilename exists ifTrue:[
STCPath := (topDirName,'\stc\stc.exe').
] ifFalse:[
STCPath := 'stc.exe'.
].
LibPath := ''.
SearchedLibraries := #('import32.lib').
"/ SearchedLibraries := #('import32.lib' 'glu32.lib' 'opengl32.lib').
] ifFalse:[
STCCompilationIncludes := '-I',topDirName,'/include'.
STCCompilationDefines := ''.
STCCompilationOptions := '+optinline +inlineNew'.
STCPath := topDirName,'/stc/stc'.
m32 := ''.
(ExternalAddress pointerSize == 4) ifTrue:[
m32 := ' -m32'
].
CCCompilationOptions := OperatingSystem getCPUDefine,
' -D', self usedCompilerDefine,
' ', OperatingSystem getOSDefine,
' ', '-O', m32.
ParserFlags useGnuC ifTrue:[
CCPath := 'gcc'
] ifFalse:[
CCPath := 'cc'
].
LinkArgs := m32.
LinkSharedArgs := '-shared', m32.
LinkCommand := CCPath.
LibPath := ''.
SearchedLibraries := #().
MakeCommand := 'make'.
].
"
ParserFlags initializeSTCFlagsForTopDirectory:'../..'
"
"Modified: / 09-08-2006 / 18:47:18 / fm"
"Created: / 06-08-2011 / 19:47:47 / cg"
! !
!ParserFlags methodsFor:'accessing'!
@@ -2185,23 +1804,9 @@
"Created: / 23-05-2011 / 17:43:45 / cg"
!
-allowSqueakExtensions
- "return true, if support for squeak extensions
- computed arrays { .., }
- c/java style arguments in message sends rec foo(arg1, ... argN)
- is enabled."
-
- ^ allowSqueakExtensions
-!
-
-allowSqueakExtensions:aBoolean
- "this allows turning on/off support for squeak extensions:
- computed arrays { .., }
- c/java style arguments in message sends rec foo(arg1, ... argN)
- "
-
- allowSqueakExtensions := aBoolean
-!
+allowSqueakExtensions
"return true, if support for squeak extensions
computed arrays { .., }
c/java style arguments in message sends rec foo(arg1, ... argN)
is enabled."
^ allowSqueakExtensions
!
+
+allowSqueakExtensions:aBoolean
"this allows turning on/off support for squeak extensions:
computed arrays { .., }
c/java style arguments in message sends rec foo(arg1, ... argN)
"
allowSqueakExtensions := aBoolean
!
allowSqueakPrimitives
"return true, if support for squeak primitives is enabled."
@@ -2661,11 +2266,11 @@
!ParserFlags class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/ParserFlags.st,v 1.122 2015-01-20 13:15:31 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/ParserFlags.st,v 1.123 2015-02-07 11:09:42 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libcomp/ParserFlags.st,v 1.122 2015-01-20 13:15:31 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/ParserFlags.st,v 1.123 2015-02-07 11:09:42 cg Exp $'
! !