Introducion a JavaSourceDocument.
JavaSourceDocument aims to keep various information abou Java source such
as parse tree, index, highlighted source. A limited cache of source documents
is also maintained to speed up browsing.
--- a/GroovyLanguage.st Fri Aug 30 12:12:44 2013 +0100
+++ b/GroovyLanguage.st Fri Aug 30 12:19:02 2013 +0100
@@ -118,7 +118,9 @@
It is OK to return nil, which means that the code is shown as-is"
"return nil by default"
- ^JavaSyntaxHighlighter
+ ^JavaSourceHighlighter
+
+ "Modified: / 30-08-2013 / 01:11:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GroovyLanguage methodsFor:'queries'!
--- a/JavaLanguage.st Fri Aug 30 12:12:44 2013 +0100
+++ b/JavaLanguage.st Fri Aug 30 12:19:02 2013 +0100
@@ -157,10 +157,11 @@
"return nil by default"
"/ ^nil
- ^JavaSyntaxHighlighter
+ ^JavaSourceHighlighter
"/ ^ JavaSyntaxHighlighter_Old
"Created: / 11-02-2012 / 18:11:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 30-08-2013 / 01:11:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaLanguage methodsFor:'queries'!
--- a/Make.proto Fri Aug 30 12:12:44 2013 +0100
+++ b/Make.proto Fri Aug 30 12:19:02 2013 +0100
@@ -21,7 +21,7 @@
INCLUDE_TOP=$(TOP)/..
# subdirectories where targets are to be made:
-SUBDIRS= tools experiments libs mauve
+SUBDIRS= experiments tools examples
# subdirectories where Makefiles are to be made:
@@ -34,7 +34,7 @@
# add the path(es) here:,
# ********** OPTIONAL: MODIFY the next lines ***
# LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES=-I$(ZLIB_DIR) -Isupport/fdlibm -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic3 -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libview
+LOCALINCLUDES=-I$(ZLIB_DIR) -Isupport/fdlibm -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic3 -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/libview
# if you need any additional defines for embedded C code,
@@ -144,8 +144,6 @@
cd ../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
- cd ../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
- cd ../goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
--- a/abbrev.stc Fri Aug 30 12:12:44 2013 +0100
+++ b/abbrev.stc Fri Aug 30 12:19:02 2013 +0100
@@ -37,6 +37,7 @@
JavaFieldRefTests JavaFieldRefTests stx:libjava 'Languages-Java-Tests-RuntimeConstantPool' 1
JavaFinalizationRegistry JavaFinalizationRegistry stx:libjava 'Languages-Java-Support' 0
JavaFreshlyInitializedResource JavaFreshlyInitializedResource stx:libjava 'Languages-Java-Tests' 1
+JavaInitializedResource JavaInitializedResource stx:libjava 'Languages-Java-Tests' 2
JavaInterfaceMethodRefTests JavaInterfaceMethodRefTests stx:libjava 'Languages-Java-Tests-RuntimeConstantPool' 1
JavaJUnitTests JavaJUnitTests stx:libjava 'Languages-Java-Tests-Libraries' 1
JavaLanguage JavaLanguage stx:libjava 'Languages-Java-Support' 1
@@ -75,6 +76,7 @@
JavaSourceFileWriter JavaSourceFileWriter stx:libjava 'Languages-Java-Support' 0
JavaTestCaseProxy JavaTestCaseProxy stx:libjava 'Languages-Java-Tests-Proxies' 3
JavaTestsLoader JavaTestsLoader stx:libjava 'Languages-Java-Tests' 0
+JavaTestsResource JavaTestsResource stx:libjava 'Languages-Java-Tests' 2
JavaTopView JavaTopView stx:libjava 'Languages-Java-Views-Support' 2
JavaUTF8Tests JavaUTF8Tests stx:libjava 'Languages-Java-Tests' 1
JavaUnresolvedCompilationError JavaUnresolvedCompilationError stx:libjava 'Languages-Java-Support' 1
@@ -88,6 +90,7 @@
ProxyMethodNode ProxyMethodNode stx:libjava 'System-Compiler-Interop' 0
SmalltalkAppletContext SmalltalkAppletContext stx:libjava 'Languages-Java-Views-Support' 0
SmalltalkAppletStub SmalltalkAppletStub stx:libjava 'Languages-Java-Views-Support' 0
+TestletTestCaseProxy TestletTestCaseProxy stx:libjava 'Languages-Java-Tests-Proxies' 3
stx_libjava stx_libjava stx:libjava '* Projects & Packages *' 3
GroovyMetaclass GroovyMetaclass stx:libjava 'Languages-Groovy-Classes' 0
Java Java stx:libjava 'Languages-Java-Support' 0
@@ -111,7 +114,6 @@
JavaFieldAnnotationContainer JavaFieldAnnotationContainer stx:libjava 'Languages-Java-Annotations' 1
JavaFieldDescriptor JavaFieldDescriptor stx:libjava 'Languages-Java-Support' 0
JavaFieldDescriptorWithUnionType JavaFieldDescriptorWithUnionType stx:libjava 'Languages-Java-Support' 0
-JavaInitializedResource JavaInitializedResource stx:libjava 'Languages-Java-Tests' 2
JavaInvalidRefError JavaInvalidRefError stx:libjava 'Languages-Java-Support' 1
JavaMethod JavaMethod stx:libjava 'Languages-Java-Classes' 0
JavaMethodAnnotationContainer JavaMethodAnnotationContainer stx:libjava 'Languages-Java-Annotations' 1
@@ -119,7 +121,6 @@
JavaNativeMethodImpl_OpenJDK6 JavaNativeMethodImpl_OpenJDK6 stx:libjava 'Languages-Java-Support-OpenJDK6' 0
JavaRelease JavaRelease stx:libjava 'Languages-Java-Support' 1
JavaStringRef2 JavaStringRef2 stx:libjava 'Languages-Java-Reader-Support-new' 0
-JavaTestsResource JavaTestsResource stx:libjava 'Languages-Java-Tests' 2
JavaUnhandledExceptionError JavaUnhandledExceptionError stx:libjava 'Languages-Java-Support' 1
JavaUnresolvedClassConstant JavaUnresolvedClassConstant stx:libjava 'Languages-Java-Reader-Support' 0
JavaUnresolvedStringConstant JavaUnresolvedStringConstant stx:libjava 'Languages-Java-Reader-Support' 0
@@ -128,7 +129,6 @@
ProxyMethodGuardNode ProxyMethodGuardNode stx:libjava 'System-Compiler-Interop' 0
ProxyMethodInvocationNode ProxyMethodInvocationNode stx:libjava 'System-Compiler-Interop' 0
ProxyMethodJavaFieldAccessor ProxyMethodJavaFieldAccessor stx:libjava 'Languages-Java-Interop' 0
-TestletTestCaseProxy TestletTestCaseProxy stx:libjava 'Languages-Java-Tests-Proxies' 3
JavaByteCodePreresolver JavaByteCodePreresolver stx:libjava 'Languages-Java-Bytecode' 0
JavaClass JavaClass stx:libjava 'Languages-Java-Classes' 0
JavaClassPathBundle JavaClassPathBundle stx:libjava 'Languages-Java-Support-Libraries' 0
--- a/bc.mak Fri Aug 30 12:12:44 2013 +0100
+++ b/bc.mak Fri Aug 30 12:19:02 2013 +0100
@@ -34,7 +34,7 @@
-LOCALINCLUDES=-I$(ZLIB_DIR) -Isupport\fdlibm -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic3 -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libview
+LOCALINCLUDES=-I$(ZLIB_DIR) -Isupport\fdlibm -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic3 -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\libview
LOCALDEFINES=
STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -varPrefix=$(LIBNAME)
@@ -54,8 +54,6 @@
pushd ..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
- pushd ..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
- pushd ..\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
--- a/bmake.bat Fri Aug 30 12:12:44 2013 +0100
+++ b/bmake.bat Fri Aug 30 12:19:02 2013 +0100
@@ -10,13 +10,6 @@
make.exe -N -f bc.mak %DEFINES% %*
@echo "***********************************"
-@echo "Buildung stx/libjava/libs
-@echo "***********************************"
-@cd libs
-@call bmake %1 %2
-@cd ..
-
-@echo "***********************************"
@echo "Buildung stx/libjava/tools
@echo "***********************************"
@cd tools
@@ -24,9 +17,9 @@
@cd ..
@echo "***********************************"
-@echo "Buildung stx/libjava/mauve
+@echo "Buildung stx/libjava/examples
@echo "***********************************"
-@cd mauve
+@cd examples
@call bmake %1 %2
@cd ..
--- a/lccmake.bat Fri Aug 30 12:12:44 2013 +0100
+++ b/lccmake.bat Fri Aug 30 12:19:02 2013 +0100
@@ -6,13 +6,6 @@
make.exe -N -f bc.mak -DUSELCC=1 %*
@echo "***********************************"
-@echo "Buildung stx/libjava/libs
-@echo "***********************************"
-@cd libs
-@call lccmake %1 %2
-@cd ..
-
-@echo "***********************************"
@echo "Buildung stx/libjava/tools
@echo "***********************************"
@cd tools
@@ -20,9 +13,9 @@
@cd ..
@echo "***********************************"
-@echo "Buildung stx/libjava/mauve
+@echo "Buildung stx/libjava/examples
@echo "***********************************"
-@cd mauve
+@cd examples
@call lccmake %1 %2
@cd ..
--- a/libjava.rc Fri Aug 30 12:12:44 2013 +0100
+++ b/libjava.rc Fri Aug 30 12:19:02 2013 +0100
@@ -25,7 +25,7 @@
VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\nCopyright Jan Vrany, Jan Kurs and Marcel Hlopko\n SWING Research Group, Czech Technical University In Prague\0"
VALUE "ProductName", "Smalltalk/X\0"
VALUE "ProductVersion", "6.2.3.0\0"
- VALUE "ProductDate", "Thu, 15 Aug 2013 22:29:48 GMT\0"
+ VALUE "ProductDate", "Fri, 30 Aug 2013 11:10:08 GMT\0"
END
END
--- a/mingwmake.bat Fri Aug 30 12:12:44 2013 +0100
+++ b/mingwmake.bat Fri Aug 30 12:19:02 2013 +0100
@@ -14,13 +14,6 @@
make.exe -N -f bc.mak %DEFINES% %USEMINGW_ARG% %*
@echo "***********************************"
-@echo "Buildung stx/libjava/libs
-@echo "***********************************"
-@cd libs
-@call mingwmake %1 %2
-@cd ..
-
-@echo "***********************************"
@echo "Buildung stx/libjava/tools
@echo "***********************************"
@cd tools
@@ -28,9 +21,9 @@
@cd ..
@echo "***********************************"
-@echo "Buildung stx/libjava/mauve
+@echo "Buildung stx/libjava/examples
@echo "***********************************"
-@cd mauve
+@cd examples
@call mingwmake %1 %2
@cd ..
--- a/stx_libjava.st Fri Aug 30 12:12:44 2013 +0100
+++ b/stx_libjava.st Fri Aug 30 12:19:02 2013 +0100
@@ -156,7 +156,6 @@
(the browser has a menu function for that)"
^ #(
- #'stx:goodies/sunit' "TestAsserter - superclass of JavaAntProjectResource "
#'stx:libbasic' "AbstractNumberVector - extended "
#'stx:libbasic2' "BitArray - extended "
#'stx:libbasic3' "WrappedMethod - extended "
@@ -173,6 +172,7 @@
exclude individual packages in the #excludedFromPreRequisites method."
^ #(
+ #'stx:goodies/sunit' "TestSuite - referenced by JavaTestsLoader class>>buildSuiteFrom: "
#'stx:libcomp' "BlockNode - referenced by JavaNativeMethod>>numberOfArgs: "
#'stx:libhtml' "URL - referenced by JavaEmbeddedFrameView>>setupAppletFrameIn:initializeJava: "
#'stx:libjava/experiments' "JavaByteCodeInterpreter - referenced by JavaMethod>>interpretWithReceiver:arguments: "
@@ -191,10 +191,9 @@
for those, redefine requiredPrerequisites"
^ #(
+ #'stx:libjava/experiments'
#'stx:libjava/tools'
- #'stx:libjava/experiments'
- #'stx:libjava/libs'
- #'stx:libjava/mauve'
+ #'stx:libjava/examples'
)
! !
@@ -343,6 +342,7 @@
(JavaFieldRefTests autoload)
JavaFinalizationRegistry
(JavaFreshlyInitializedResource autoload)
+ (JavaInitializedResource autoload)
(JavaInterfaceMethodRefTests autoload)
(JavaJUnitTests autoload)
JavaLanguage
@@ -381,6 +381,7 @@
JavaSourceFileWriter
(JavaTestCaseProxy autoload)
JavaTestsLoader
+ (JavaTestsResource autoload)
JavaTopView
(JavaUTF8Tests autoload)
JavaUnresolvedCompilationError
@@ -394,6 +395,7 @@
ProxyMethodNode
SmalltalkAppletContext
SmalltalkAppletStub
+ (TestletTestCaseProxy autoload)
#'stx_libjava'
GroovyMetaclass
Java
@@ -417,7 +419,6 @@
JavaFieldAnnotationContainer
JavaFieldDescriptor
JavaFieldDescriptorWithUnionType
- (JavaInitializedResource autoload)
JavaInvalidRefError
JavaMethod
JavaMethodAnnotationContainer
@@ -425,7 +426,6 @@
#'JavaNativeMethodImpl_OpenJDK6'
JavaRelease
JavaStringRef2
- (JavaTestsResource autoload)
JavaUnhandledExceptionError
JavaUnresolvedClassConstant
JavaUnresolvedStringConstant
@@ -434,7 +434,6 @@
ProxyMethodGuardNode
ProxyMethodInvocationNode
ProxyMethodJavaFieldAccessor
- (TestletTestCaseProxy autoload)
JavaByteCodePreresolver
JavaClass
JavaClassPathBundle
--- a/tools/JavaDeclarationNode.st Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/JavaDeclarationNode.st Fri Aug 30 12:19:02 2013 +0100
@@ -8,6 +8,33 @@
!
+!JavaDeclarationNode methodsFor:'accessing'!
+
+javadoc
+ ^ javadoc
+!
+
+javadoc:anInterval
+ javadoc := anInterval.
+
+ "Modified: / 30-08-2013 / 02:52:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+startPosition
+ javadoc notNil ifTrue:[
+ ^ javadoc first
+ ].
+ ^ startPosition.
+
+ "Created: / 30-08-2013 / 02:52:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaDeclarationNode methodsFor:'testing'!
+
+isJavaDeclarationNode
+ ^ true
+! !
+
!JavaDeclarationNode class methodsFor:'documentation'!
version_HG
--- a/tools/JavaParseNode.st Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/JavaParseNode.st Fri Aug 30 12:19:02 2013 +0100
@@ -149,6 +149,12 @@
"Created: / 13-12-2010 / 14:34:14 / Jan Kurs <kurs.jan@post.cz>"
! !
+!JavaParseNode methodsFor:'testing'!
+
+isJavaDeclarationNode
+ ^ false
+! !
+
!JavaParseNode class methodsFor:'documentation'!
version_CVS
--- a/tools/JavaParser.st Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/JavaParser.st Fri Aug 30 12:19:02 2013 +0100
@@ -196,7 +196,7 @@
| oldBlock |
oldBlock := production block.
production setBlock:[:nodes|
- | first last start stop |
+ | first last start stop node |
first := nodes.
[ first isSequenceable and:[first notEmpty] ] whileTrue:[
@@ -209,15 +209,30 @@
start := first perform: #startPosition ifNotUnderstood:[nil].
stop := last perform: #endPosition ifNotUnderstood:[nil].
-
builder start: start stop: stop.
- oldBlock value: nodes.
+ node := oldBlock value: nodes.
+"/ (node isKindOf: JavaDeclarationNode) ifTrue:[
+"/ | comments javadoc streamPos |
+"/
+"/ comments := scanner comments.
+"/ javadoc := comments detectLast:[:comment|comment last < start] ifNone:nil.
+"/ javadoc notNil ifTrue:[
+"/ streamPos := scanner sourceStream position.
+"/ scanner sourceStream position: javadoc first.
+"/ (scanner sourceStream next: 3) = '/**' ifTrue:[
+"/ node javadoc: javadoc.
+"/ ].
+"/ scanner sourceStream position: streamPos
+"/ ].
+"/ ].
+ node
].
].
^ production
"Created: / 25-08-2013 / 11:00:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 30-08-2013 / 03:00:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaParser class methodsFor:'documentation'!
--- a/tools/JavaParserI.st Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/JavaParserI.st Fri Aug 30 12:19:02 2013 +0100
@@ -8,7 +8,7 @@
commentTail charactersInLine commentTailStar notStar
notStarNotSlash inputCharacter booleanLiteral nullLiteral
keywords floatingPointLiteral integerLiteral characterLiteral
- stringLiteral input operators separators block'
+ stringLiteral input operators separators block scanner'
classVariableNames:'Debugging'
poolDictionaries:''
category:'Languages-Java-Parser'
@@ -100,7 +100,9 @@
namesToIgnore
- ^#('keywords' 'operators' 'separators')
+ ^#('keywords' 'operators' 'separators' 'scanner')
+
+ "Modified (format): / 30-08-2013 / 02:32:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaParserI methodsFor:'accessing'!
@@ -729,8 +731,6 @@
parse: anObject
"Parse anObject with the receiving parser and answer the parse-result or an instance of PPFailure."
- | scanner |
-
(anObject isKindOf: JavaScanner) ifFalse:[
scanner := JavaScanner for: anObject readStream.
] ifTrue:[
@@ -740,6 +740,7 @@
^super parse: scanner
"Created: / 15-03-2012 / 11:10:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (format): / 30-08-2013 / 02:32:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaParserI methodsFor:'private'!
--- a/tools/JavaScanner.st Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/JavaScanner.st Fri Aug 30 12:19:02 2013 +0100
@@ -274,6 +274,9 @@
allowDegeneratedMantissa := true. "/ something like 123.
keywordTable := self class keywordTable.
+ saveComments := true.
+
+ "Modified: / 30-08-2013 / 02:48:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaScanner methodsFor:'private'!
@@ -926,37 +929,38 @@
!
skipComment
- |commentStream commentType startPos|
+ |startPos|
startPos := source position.
source next.
hereChar := source peekOrNil.
[
- [hereChar notNil and:[hereChar ~~ $*]] whileTrue:[
- hereChar == (Character cr) ifTrue:[
- lineNr := lineNr + 1.
- ].
- hereChar := source nextPeek
- ].
+ [hereChar notNil and:[hereChar ~~ $*]] whileTrue:[
+ hereChar == (Character cr) ifTrue:[
+ lineNr := lineNr + 1.
+ ].
+ hereChar := source nextPeek
+ ].
] doUntil:[
- hereChar := source nextPeek.
- hereChar isNil or:[hereChar == $/].
+ hereChar := source nextPeek.
+ hereChar isNil or:[hereChar == $/].
].
"skip final /"
source next.
hereChar isNil ifTrue:[
- self warning:'unclosed comment' position:startPos to:(source position)
+ self warning:'unclosed comment' position:startPos - 2" '/*' already eaten" to:(source position)
].
-"/ saveComments ifTrue:[
-"/ self endComment:(commentStream contents) type:commentType.
-"/ ].
+ saveComments ifTrue:[
+ self addComment: (startPos - 2" '/*' already eaten" to: source position - 1)
+ ].
^ nil. "/ force nextToken again
- "Modified: / 31.3.1998 / 23:45:26 / cg"
+ "Modified: / 31-03-1998 / 23:45:26 / cg"
+ "Modified: / 30-08-2013 / 02:51:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
skipEOLComment
--- a/tools/JavaScannerBase.st Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/JavaScannerBase.st Fri Aug 30 12:19:02 2013 +0100
@@ -14,8 +14,8 @@
Object subclass:#JavaScannerBase
instanceVariableNames:'typeArray actionArray source lineNr tokenType tokenStartPosition
tokenEndPosition tokenLineNr numberRadix numberScale hereChar
- peekChar peekChar2 requestor saveComments currentComments
- tokenValue scaledMantissaValue parserFlags'
+ peekChar peekChar2 requestor saveComments tokenValue
+ scaledMantissaValue parserFlags comments'
classVariableNames:'Warnings'
poolDictionaries:''
category:'Languages-Java-Parser'
@@ -44,7 +44,6 @@
"
! !
-
!JavaScannerBase class methodsFor:'initialization'!
initialize
@@ -93,7 +92,6 @@
"/
! !
-
!JavaScannerBase class methodsFor:'instance creation'!
for:aStringOrStream
@@ -113,7 +111,6 @@
"Created: / 26.5.1999 / 12:02:16 / stefan"
! !
-
!JavaScannerBase class methodsFor:'Signal constants'!
emptySourceNotificationSignal
@@ -140,7 +137,6 @@
"Created: / 16.5.1998 / 15:55:14 / cg"
! !
-
!JavaScannerBase class methodsFor:'defaults'!
warnings
@@ -160,7 +156,6 @@
"Modified: 23.5.1997 / 12:03:05 / cg"
! !
-
!JavaScannerBase class methodsFor:'private accessing'!
actionArray
@@ -175,7 +170,6 @@
^ TypeArray
! !
-
!JavaScannerBase class methodsFor:'utility scanning'!
scanNumberFrom:aStream
@@ -215,7 +209,6 @@
"Modified: / 18.6.1998 / 23:10:39 / cg"
! !
-
!JavaScannerBase methodsFor:'Compatibility - ST80'!
endOfLastToken
@@ -273,7 +266,6 @@
"Modified: 20.6.1997 / 18:22:58 / cg"
! !
-
!JavaScannerBase methodsFor:'accessing'!
actionArray
@@ -291,8 +283,8 @@
|ret|
- ret := currentComments ? #().
- currentComments := nil.
+ ret := comments ? #().
+ comments := nil.
^ ret
"Created: 20.4.1996 / 20:07:01 / cg"
@@ -382,7 +374,6 @@
typeArray := something.
! !
-
!JavaScannerBase methodsFor:'error handling'!
correctableError:message position:pos1 to:pos2
@@ -541,7 +532,6 @@
^ 'Warning:'
! !
-
!JavaScannerBase methodsFor:'general scanning'!
scanPositionsFor:aTokenString inString:aSourceString
@@ -583,7 +573,6 @@
"
! !
-
!JavaScannerBase methodsFor:'initialization'!
initialize
@@ -615,7 +604,7 @@
tokenStartPosition := 1.
tokenLineNr := lineNr := 1.
- currentComments := nil.
+ comments := nil.
aStringOrStream isStream ifFalse:[
source := ReadStream on:aStringOrStream
@@ -626,15 +615,14 @@
"Modified: / 26.5.1999 / 12:02:16 / stefan"
! !
-
!JavaScannerBase methodsFor:'private'!
addComment:comment
saveComments ifTrue:[
- currentComments isNil ifTrue:[
- currentComments := OrderedCollection with:comment
+ comments isNil ifTrue:[
+ comments := OrderedCollection with:comment
] ifFalse:[
- currentComments add:comment
+ comments add:comment
]
].
!
@@ -658,7 +646,6 @@
requestor := anObject
! !
-
!JavaScannerBase methodsFor:'reading next token'!
atEnd
@@ -779,7 +766,6 @@
self subclassResponsibility
! !
-
!JavaScannerBase methodsFor:'reading next token - private'!
nextMantissa:radix
@@ -806,7 +792,6 @@
"Modified: / 5.3.1998 / 02:54:11 / cg"
! !
-
!JavaScannerBase class methodsFor:'documentation'!
version_CVS
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/JavaSourceDocument.st Fri Aug 30 12:19:02 2013 +0100
@@ -0,0 +1,146 @@
+"{ Package: 'stx:libjava/tools' }"
+
+Object subclass:#JavaSourceDocument
+ instanceVariableNames:'javaClass sourceText sourceTree sourceIndex'
+ classVariableNames:'Cache CacheSize'
+ poolDictionaries:''
+ category:'Languages-Java-Tools-Source'
+!
+
+!JavaSourceDocument class methodsFor:'documentation'!
+
+documentation
+"
+ JavaSourceDocument object keeps various useful information about one source
+ file. In particular, it keeps parse tree and index for navigation/quickfix
+ services.
+
+ [author:]
+ Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ [instance variables:]
+
+ [class variables:]
+
+ [see also:]
+
+"
+! !
+
+!JavaSourceDocument class methodsFor:'initialization'!
+
+initialize
+ "Invoked at system start or when the class is dynamically loaded."
+
+ "/ please change as required (and remove this comment)
+
+ CacheSize := 25.
+ Cache := OrderedCollection new: CacheSize * 2 "To avoid excessive shifting..."
+
+ "Modified: / 30-08-2013 / 01:43:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceDocument class methodsFor:'instance creation'!
+
+for: aJavaClass
+ ^self new javaClass: aJavaClass.
+
+ "Created: / 30-08-2013 / 01:46:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceDocument class methodsFor:'accessing'!
+
+cachedDocumentFor: aJavaClass
+ "Returns a cached document for given class or nil if no cached
+ document is found."
+
+ Cache withIndexDo:[:document :index|
+ document javaClass == aJavaClass ifTrue:[
+ "/ Move that document towards the end so it'll be less likely
+ "/ to be removed
+ index < Cache size ifTrue:[
+ Cache swap: index with: index + 1.
+ ].
+ ^ document.
+ ]
+ ].
+ ^ nil
+
+ "Created: / 30-08-2013 / 01:27:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+cachedDocumentFor: aJavaClass put: aJavaSourceDocument
+ "Stores given source document in the cache"
+
+ self assert: aJavaSourceDocument javaClass == aJavaClass.
+ Cache size = CacheSize ifTrue:[
+ Cache removeFirst.
+ ].
+ Cache addLast: aJavaSourceDocument
+
+ "Created: / 30-08-2013 / 01:42:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceDocument methodsFor:'accessing'!
+
+javaClass
+ ^ javaClass
+!
+
+javaClass:aJavaClass
+ javaClass := aJavaClass.
+!
+
+sourceIndex
+ ^ sourceIndex
+!
+
+sourceIndex:aParseTreeIndex
+ sourceIndex := aParseTreeIndex.
+!
+
+sourceText
+ ^ sourceText
+!
+
+sourceText:aText
+ sourceText := aText.
+!
+
+sourceTree
+ ^ sourceTree
+!
+
+sourceTree:aJavaSourceNode
+ sourceTree := aJavaSourceNode.
+! !
+
+!JavaSourceDocument methodsFor:'debugging'!
+
+inspector2TabParseTree
+
+ SmallSense::ParseNodeInspector notNil ifTrue:[
+ ^self newInspector2Tab
+ label: 'Parse Tree';
+ priority: 35;
+ application: (SmallSense::ParseNodeInspector new node: sourceTree source: sourceText)
+ ].
+ ^nil
+
+ "Created: / 30-08-2013 / 01:59:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+inspector2Tabs
+ | tabs |
+
+ tabs := super inspector2Tabs.
+ (SmallSense::ParseNodeInspector notNil and:[sourceTree notNil and:[sourceText notNil]]) ifTrue:[
+ tabs := tabs , #(inspector2TabParseTree)
+ ].
+ ^tabs
+
+ "Created: / 30-08-2013 / 02:00:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+
+JavaSourceDocument initialize!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/JavaSourceHighlighter.st Fri Aug 30 12:19:02 2013 +0100
@@ -0,0 +1,827 @@
+"
+ COPYRIGHT (c) 1996-2011 by Claus Gittinger
+
+ New code and modifications done at SWING Research Group [1]:
+
+ COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ SWING Research Group, Czech Technical University in Prague
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+
+ [1] Code written at SWING Research Group contains a signature
+ of one of the above copright owners. For exact set of such code,
+ see the differences between this version and version stx:libjava
+ as of 1.9.2010
+"
+"{ Package: 'stx:libjava/tools' }"
+
+Object subclass:#JavaSourceHighlighter
+ instanceVariableNames:'preferences cachedStringEmphasis cachedStringColor sourceText
+ sourceIndex'
+ classVariableNames:'FormattedSourceCache'
+ poolDictionaries:''
+ category:'Languages-Java-Tools-Source'
+!
+
+JavaParseNodeBuilder subclass:#Builder
+ instanceVariableNames:'highlighter'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:JavaSourceHighlighter
+!
+
+JavaParser subclass:#Parser
+ instanceVariableNames:'stream'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:JavaSourceHighlighter
+!
+
+JavaScanner subclass:#Scanner
+ instanceVariableNames:'highlighter'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:JavaSourceHighlighter
+!
+
+!JavaSourceHighlighter class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 1996-2011 by Claus Gittinger
+
+ New code and modifications done at SWING Research Group [1]:
+
+ COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ SWING Research Group, Czech Technical University in Prague
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+
+ [1] Code written at SWING Research Group contains a signature
+ of one of the above copright owners. For exact set of such code,
+ see the differences between this version and version stx:libjava
+ as of 1.9.2010
+
+"
+!
+
+documentation
+"
+ A syntax highligter for Java. This highlighter is SmallSense-aware and
+ supports incremental highlighting.
+
+ [author:]
+ Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ [instance variables:]
+
+ [class variables:]
+
+ [see also:]
+
+"
+! !
+
+!JavaSourceHighlighter class methodsFor:'formatting'!
+
+formatClass: javaClass
+
+ ^self new formatClassDefinition: javaClass source in: javaClass
+
+ "Created: / 15-12-2011 / 21:54:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatClassDefinition:source in:class
+
+ ^self new formatClassDefinition:source in:class
+
+ "Created: / 04-08-2011 / 23:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatClassDefinition:source in:class elementsInto: elements
+
+ ^self new formatClassDefinition:source in:class elementsInto: elements
+
+ "Created: / 04-08-2011 / 23:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatClassDefinition:newCode line: ln number: lnr in:cls
+ ^self new formatClassDefinition:newCode line: ln number: lnr in:cls.
+
+ "Created: / 04-08-2013 / 00:25:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatExpression:source in:class
+
+ ^self new formatExpression:source in:class
+
+ "Created: / 04-08-2011 / 23:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatExpression:source in:class elementsInto: elements
+
+ ^self new formatExpression:source in:class elementsInto: elements
+
+ "Created: / 04-08-2011 / 23:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mth source:source in:class
+
+ ^self formatMethod: mth source: source in: class using: UserPreferences current
+
+ "Created: / 11-02-2012 / 18:18:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mth source:source in:class using: preferences
+
+ ^self new formatMethod:mth source:source in:class using: preferences
+
+ "Created: / 04-08-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mth source:source in:class using: preferences elementsInto: elements
+
+ ^self new formatMethod:mth source:source in:class using: preferences elementsInto: elements
+
+ "Created: / 04-08-2011 / 23:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mthd source:newCode line: ln number: lnr in:cls using:syntaxPreferences
+ ^ self new formatMethod:mthd source:newCode line: ln number: lnr in:cls using:syntaxPreferences
+
+ "Created: / 04-08-2013 / 00:26:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter methodsFor:'formatting'!
+
+formatClassDefinition:source in:class
+
+ ^ self format: source kind: #start in: class
+
+ "Created: / 04-08-2011 / 23:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatClassDefinition:source in:class elementsInto: els
+
+ sourceIndex := els.
+ ^self formatClassDefinition:source in:class
+
+ "Created: / 04-08-2011 / 23:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatClassDefinition:newCode line: line number: lnr in:cls
+ | scanner |
+
+ line isEmptyOrNil ifTrue:[ ^ nil ].
+
+ sourceText := line asText.
+ preferences isNil ifTrue:[
+ preferences := UserPreferences current.
+ ].
+ scanner := Scanner for: line asString.
+ scanner highlighter: self.
+ [
+ [ scanner nextToken ~~ #EOF ] whileTrue.
+ ] on: Error do:[
+
+ ].
+ ^ sourceText
+
+ "Created: / 04-08-2013 / 00:25:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatExpression:source in:class
+
+"/ self breakPoint:#jv.
+ ^source.
+ ^ self format: source kind: #'K_EXPRESSION' in: class
+
+ "Created: / 04-08-2011 / 23:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatExpression:source in:class elementsInto: els
+
+ sourceIndex := els.
+ ^self formatExpression:source in:class
+
+ "Created: / 04-08-2011 / 23:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mth source:source in:class using: prefs
+
+ preferences := prefs.
+ ^ self format: source kind: #start in: class
+
+ "Created: / 04-08-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mth source:source in:class using: prefs elementsInto: els
+
+ preferences := prefs.
+ sourceIndex := els.
+ ^self formatMethod:mth source:source in:class using: prefs
+
+ "Created: / 04-08-2011 / 23:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mthd source:newCode line: line number: lnr in:cls using:syntaxPreferences
+ | scanner |
+
+ line isEmptyOrNil ifTrue:[ ^ nil ].
+
+ sourceText := line asText.
+ preferences := syntaxPreferences.
+ preferences isNil ifTrue:[
+ preferences := UserPreferences current.
+ ].
+ scanner := Scanner for: line asString.
+ scanner highlighter: self.
+ [
+ [ scanner nextToken ~~ #EOF ] whileTrue.
+ ] on: Error do:[
+
+ ].
+ ^ sourceText
+
+ "Created: / 04-08-2013 / 00:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter methodsFor:'formatting - private'!
+
+format: source kind: kind in: class
+
+ | scanner parser builder cacheIt document tree |
+
+ "Optimization - if full class source is to be formatted,
+ consult cache - when browsing the code or debugging, very
+ often same same source is to be highlighted"
+
+ preferences isNil ifTrue:[
+ preferences := UserPreferences current.
+ ].
+ cacheIt := kind == #start and: [class notNil].
+ cacheIt ifTrue:[
+ document := JavaSourceDocument cachedDocumentFor: class.
+ document notNil ifTrue:[
+ (document sourceText notNil and:[document sourceText string = source]) ifTrue:[
+ document sourceText copy.
+ ].
+ ].
+ document := JavaSourceDocument for: class.
+ ].
+
+
+ source isText ifTrue:[
+ sourceText := source copy
+ ] ifFalse:[
+ sourceText := source asText.
+ ].
+
+ scanner := Scanner for: source.
+ builder := Builder new.
+ builder highlighter: self.
+ scanner highlighter: self.
+ parser := Parser newStartingAt: kind.
+ parser builder: builder.
+ parser stream: scanner.
+ tree := parser parse: scanner.
+
+ ^ cacheIt ifTrue:[
+ document sourceText: sourceText.
+ document sourceIndex: sourceIndex.
+ document sourceTree: tree.
+ JavaSourceDocument cachedDocumentFor: class put: document.
+
+ sourceText copy
+ ] ifFalse:[
+ sourceText
+ ]
+
+ "Created: / 17-03-2012 / 14:02:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 30-08-2013 / 01:53:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter methodsFor:'syntax detection'!
+
+markArgumentIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences argumentIdentifierEmphasis) color:(preferences argumentIdentifierColor)
+!
+
+markBadIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences badIdentifierEmphasis)
+ color:(preferences badIdentifierColor)
+!
+
+markClassVariableIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences classVariableIdentifierEmphasis) color:(preferences classVariableIdentifierColor)
+
+ "Modified: / 31.3.1998 / 18:02:14 / cg"
+!
+
+markCommentFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences commentEmphasis) color:(preferences commentColor)
+!
+
+markConstantFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences constantEmphasis) color:(preferences constantColor)
+!
+
+markFrom:pos1 to:pos2 withEmphasis:fontEmp color:clrIn
+ |e p2 clr|
+
+ clr := clrIn onDevice:Screen current.
+
+ clr = Color black ifTrue:[
+ e := fontEmp
+ ] ifFalse:[
+ fontEmp isNil ifTrue:[
+ e := (#color->clr)
+ ] ifFalse:[
+ e := Text addEmphasis:fontEmp to:(#color->clr).
+ ]
+ ].
+ (p2 := pos2) isNil ifTrue:[
+ p2 := sourceText size
+ ] ifFalse:[
+ p2 := p2 min:sourceText size
+ ].
+ sourceText emphasizeFrom:pos1 to:p2 with:e
+
+ "Created: / 31.3.1998 / 13:26:53 / cg"
+ "Modified: / 1.4.1998 / 12:51:56 / cg"
+!
+
+markFunctionNameFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences methodSelectorEmphasis) color:(preferences methodSelectorColor)
+!
+
+markGlobalClassIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences globalClassIdentifierEmphasis) color:(preferences globalClassIdentifierColor)
+
+ "Modified: / 31.3.1998 / 18:02:14 / cg"
+ "Created: / 4.3.1999 / 12:53:02 / cg"
+!
+
+markGlobalIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences globalIdentifierEmphasis) color:(preferences globalIdentifierColor)
+
+ "Modified: / 31.3.1998 / 18:02:14 / cg"
+!
+
+markIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences identifierEmphasis) color:(preferences identifierColor)
+!
+
+markInstVarIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences instVarIdentifierEmphasis) color:(preferences instVarIdentifierColor)
+
+ "Created: / 16.4.1998 / 18:35:40 / cg"
+ "Modified: / 16.4.1998 / 18:37:30 / cg"
+!
+
+markKeyword:kw from:pos1 to:pos2
+ |em clr|
+
+ ( #( 'if' 'else'
+ 'while'
+ 'for'
+ 'do'
+ 'return'
+ 'continue'
+ 'break'
+ ) includes:kw) ifTrue:[
+ em := preferences controlFlowSelectorEmphasis.
+ clr := preferences controlFlowSelectorColor.
+ ] ifFalse:[
+ em := preferences jsKeywordEmphasis.
+ clr := preferences jsKeywordColor.
+ ].
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:em color:clr
+
+ "Modified: / 19-05-2010 / 15:07:59 / cg"
+ "Modified: / 07-08-2013 / 00:28:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markLocalIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences localIdentifierEmphasis) color:(preferences localIdentifierColor)
+!
+
+markProblem: problem from:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences badIdentifierEmphasis)
+ color:(preferences badIdentifierColor)
+
+ "Created: / 15-04-2013 / 22:23:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markSelector:selectorString from:pos1 to:pos2
+ | fg em |
+
+ fg := preferences selectorColor.
+ em := preferences selectorEmphasis.
+
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:em color:fg
+
+ "Modified: / 04-10-2011 / 19:48:48 / cg"
+ "Modified: / 17-03-2012 / 13:26:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: / 17-03-2012 / 19:12:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markSelector:selectorString from:pos1 to:pos2 receiverNode:aReceiverNodeOrNil numArgs:numArgs
+ |fg selectorSymbol check ok rec em currentEnvironment currentSuperclasses currentSubclasses classToCompileFor fullSelectorCheck|
+
+ fg := preferences selectorColor.
+ em := preferences selectorEmphasis.
+
+"/ (currentEnvironment notNil
+"/ and:[ (((currentEnvironment _localVariables ? #()) contains:[:local | local name = selectorString])
+"/ or:[((currentEnvironment _argVariables ? #()) contains:[:local | local name = selectorString])])
+"/ ])
+"/ ifTrue:[
+"/ "/ a local call
+"/ ] ifFalse:[
+"/ selectorSymbol := (self translatedSmalltalkSelectorFor:selectorString numArgs:numArgs) asSymbolIfInterned.
+"/ selectorSymbol isNil ifTrue:[
+"/ fg := Color red.
+"/ ] ifFalse:[
+"/ fullSelectorCheck == true ifTrue:[
+"/ aReceiverNodeOrNil notNil ifTrue:[
+"/ check := [:cls | (cls includesSelector:selectorSymbol)
+"/ or:[cls class includesSelector:selectorSymbol]].
+"/
+"/ ok := false.
+"/
+"/ "/ limit search if possible
+"/ (classToCompileFor notNil
+"/ and:[aReceiverNodeOrNil isSelf or:[aReceiverNodeOrNil isSuper]]) ifTrue:[
+"/ currentSuperclasses isNil ifTrue:[
+"/ currentSuperclasses := classToCompileFor withAllSuperclasses.
+"/ ].
+"/ ok := currentSuperclasses contains:check.
+"/ (ok not and:[aReceiverNodeOrNil isSelf]) ifTrue:[
+"/ currentSubclasses isNil ifTrue:[
+"/ currentSubclasses := classToCompileFor allSubclasses.
+"/ ].
+"/ ok := currentSubclasses contains:check.
+"/ ].
+"/ ] ifFalse:[
+"/ aReceiverNodeOrNil isConstant ifTrue:[
+"/ ok := aReceiverNodeOrNil evaluate class withAllSuperclasses contains:check.
+"/ ] ifFalse:[
+"/ (aReceiverNodeOrNil isGlobal
+"/ and:[(rec := aReceiverNodeOrNil evaluate) isBehavior]) ifTrue:[
+"/ ok := rec class withAllSuperclasses contains:check.
+"/ ] ifFalse:[
+"/ ok := Smalltalk allClasses contains:check
+"/ ]
+"/ ]
+"/ ].
+"/
+"/ ok ifFalse:[
+"/ em := preferences unimplementedSelectorEmphasis.
+"/ fg := preferences unimplementedSelectorColor.
+"/ ]
+"/ ]
+"/ ]
+"/ ].
+"/ ].
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:em color:fg
+
+ "Modified: / 04-10-2011 / 19:48:48 / cg"
+ "Modified: / 17-03-2012 / 13:26:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markSelfFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences selfEmphasis) color:(preferences selfColor)
+!
+
+markStringFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences stringEmphasis) color:(preferences stringColor)
+!
+
+markUnknownIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences unknownIdentifierEmphasis) color:(preferences unknownIdentifierColor)
+!
+
+markVariable:v from:pos to:endPos
+ "support for syntaxColoring"
+
+ |type globalValue nameSym|
+
+ type := v type.
+ (type == #BlockArg
+ or:[type == #MethodArg]) ifTrue:[
+ self markArgumentIdentifierFrom:pos to:endPos.
+ ^ self
+ ].
+ (type == #BlockVariable
+ or:[type == #MethodVariable]) ifTrue:[
+ self markLocalIdentifierFrom:pos to:endPos.
+ ^ self
+ ].
+ (type == #GlobalVariable) ifTrue:[
+ nameSym := v name asSymbolIfInterned.
+ (nameSym isNil
+ or:[(Smalltalk includesKey:nameSym) not]) ifTrue:[
+ self markUnknownIdentifierFrom:pos to:endPos.
+ ^ self
+ ].
+ globalValue := Smalltalk at:nameSym ifAbsent:nil.
+ globalValue isBehavior ifTrue:[
+ self markGlobalClassIdentifierFrom:pos to:endPos.
+ ] ifFalse:[
+ self markGlobalIdentifierFrom:pos to:endPos.
+ ].
+ ^ self
+ ].
+ (type == #ClassVariable) ifTrue:[
+ self markClassVariableIdentifierFrom:pos to:endPos.
+ ^ self
+ ].
+ (type == #InstanceVariable) ifTrue:[
+ self markInstVarIdentifierFrom:pos to:endPos.
+ ^ self
+ ].
+
+ self markIdentifierFrom:pos to:endPos.
+
+ "Created: / 16.4.1998 / 18:49:34 / cg"
+ "Modified: / 4.3.1999 / 12:56:13 / cg"
+! !
+
+!JavaSourceHighlighter::Builder methodsFor:'accessing'!
+
+highlighter
+ ^ highlighter
+!
+
+highlighter:something
+ highlighter := something.
+! !
+
+!JavaSourceHighlighter::Builder methodsFor:'building'!
+
+newComment: text
+
+ highlighter markCommentFrom:start to: stop.
+ ^super newComment: text
+
+ "Created: / 09-03-2012 / 17:11:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+newJavaDoc: text
+
+ highlighter markCommentFrom:start to: stop.
+ ^super newJavaDoc: text
+
+ "Created: / 09-03-2012 / 17:11:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+newStringLiteral: text
+
+ highlighter markStringFrom:start to: stop.
+ ^super newStringLiteral: text
+
+ "Created: / 22-04-2013 / 18:22:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter::Parser methodsFor:'accessing'!
+
+highlighter
+
+ ^builder highlighter
+
+ "Created: / 17-03-2012 / 19:11:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+stream
+ ^ stream
+!
+
+stream:something
+ stream := something.
+! !
+
+!JavaSourceHighlighter::Parser methodsFor:'grammar-classes-method'!
+
+constructorNameIdentifier
+
+ ^super constructorNameIdentifier ==> [:token|
+ self highlighter
+ markSelector: token value
+ from: token startPosition to: token endPosition
+ ]
+
+ "Created: / 17-03-2012 / 19:12:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+identifier
+
+ ^(JavaParserI::TokenParser for: #Identifier)
+
+ "Created: / 16-12-2012 / 10:29:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 17-01-2013 / 11:10:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+methodNameIdentifier
+
+ ^super methodNameIdentifier ==> [:token|
+ self highlighter
+ markSelector: token value
+ from: token startPosition to: token endPosition
+ ]
+
+ "Created: / 17-03-2012 / 19:13:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+typeNameIdentifier
+
+ ^super typeNameIdentifier ==> [:token|
+ self highlighter
+ markSelector: token value
+ from: token startPosition to: token endPosition
+ ]
+
+ "Created: / 17-03-2012 / 19:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter::Parser methodsFor:'grammar-literals-string'!
+
+stringLiteral
+
+ ^super stringLiteral ==> [:stringToken|
+ builder
+ start: stringToken startPosition;
+ stop: stringToken endPosition;
+ newStringLiteral: stringToken value
+ ]
+
+ "Created: / 17-03-2012 / 17:31:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 22-04-2013 / 18:13:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter::Parser methodsFor:'utility'!
+
+tokenFor: aString
+
+"/ | p |
+"/
+"/ p := keywords at: aString ifAbsent:[nil].
+"/ p notNil ifTrue:[
+"/ ^ (self asToken: p) ==> [:token|
+"/ | start stop |
+"/
+"/ stop := stream position.
+"/ start := stop - keyword size.
+"/ builder highlighter markKeyword: keyword from:start to:stop
+"/ ].
+"/ ].
+
+ ^super tokenFor: aString
+
+ "Created: / 10-03-2012 / 11:52:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter::Scanner methodsFor:'accessing'!
+
+highlighter
+ ^ highlighter
+!
+
+highlighter:aJavaSyntaxHighlighter
+ highlighter := aJavaSyntaxHighlighter.
+! !
+
+!JavaSourceHighlighter::Scanner methodsFor:'error handling'!
+
+syntaxError:aMessage position:position to:endPos
+ "a syntax error happened"
+
+ endPos notNil ifTrue:[
+ highlighter markBadIdentifierFrom:position to: endPos.
+ ]
+
+ "Created: / 13-04-2012 / 18:31:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter::Scanner methodsFor:'initialization'!
+
+initialize
+ "initialize the scanner"
+
+ super initialize.
+ saveComments := true
+
+ "Created: / 17-03-2012 / 00:02:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter::Scanner methodsFor:'private'!
+
+checkForKeyword:string
+ | isKW |
+
+ isKW := super checkForKeyword:string.
+ isKW ifTrue:[
+ highlighter markKeyword:string from:tokenStartPosition + 1 to:tokenStartPosition + string size
+ ].
+ ^isKW
+
+ "Created: / 17-03-2012 / 00:15:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter::Scanner methodsFor:'reading next token'!
+
+nextToken
+ | t |
+
+ t := super nextToken.
+ t == #String ifTrue:[
+ highlighter markStringFrom:tokenStartPosition + 1 to: tokenEndPosition + 1.
+ ] ifFalse:[
+ t == #Integer ifTrue:[
+ highlighter markConstantFrom:tokenStartPosition + 1 to: tokenEndPosition + 1.
+ ]].
+ ^ t
+
+ "Created: / 14-05-1998 / 15:48:04 / cg"
+ "Modified: / 16-05-1998 / 19:12:29 / cg"
+ "Created: / 17-03-2012 / 19:15:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 03-08-2013 / 20:12:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+skipComment
+ super skipComment.
+ highlighter markCommentFrom:((tokenStartPosition + 1) max: 1) to: source position.
+ ^nil
+
+ "Created: / 17-03-2012 / 00:04:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+skipEOLComment
+ super skipEOLComment.
+ highlighter markCommentFrom:((tokenStartPosition - 1) max: 1) to: source position.
+ ^nil
+
+ "Created: / 17-03-2012 / 00:05:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaSourceHighlighter class methodsFor:'documentation'!
+
+version_CVS
+ ^ '$Header: /cvs/stx/stx/libjava/tools/JavaSyntaxHighlighter.st,v 1.2 2013-02-25 11:15:35 vrany Exp $'
+!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+ ^ 'Id'
+! !
+
--- a/tools/JavaSyntaxHighlighter.st Fri Aug 30 12:12:44 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,815 +0,0 @@
-"
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
-
- New code and modifications done at SWING Research Group [1]:
-
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
- SWING Research Group, Czech Technical University in Prague
-
- This software is furnished under a license and may be used
- only in accordance with the terms of that license and with the
- inclusion of the above copyright notice. This software may not
- be provided or otherwise made available to, or used by, any
- other person. No title to or ownership of the software is
- hereby transferred.
-
- [1] Code written at SWING Research Group contains a signature
- of one of the above copright owners. For exact set of such code,
- see the differences between this version and version stx:libjava
- as of 1.9.2010
-"
-"{ Package: 'stx:libjava/tools' }"
-
-Object subclass:#JavaSyntaxHighlighter
- instanceVariableNames:'preferences elements cachedStringEmphasis cachedStringColor
- sourceText'
- classVariableNames:'FormattedSourceCache'
- poolDictionaries:''
- category:'Languages-Java-Tools'
-!
-
-JavaParseNodeBuilder subclass:#Builder
- instanceVariableNames:'highlighter'
- classVariableNames:''
- poolDictionaries:''
- privateIn:JavaSyntaxHighlighter
-!
-
-JavaParser subclass:#Parser
- instanceVariableNames:'stream'
- classVariableNames:''
- poolDictionaries:''
- privateIn:JavaSyntaxHighlighter
-!
-
-JavaScanner subclass:#Scanner
- instanceVariableNames:'highlighter'
- classVariableNames:''
- poolDictionaries:''
- privateIn:JavaSyntaxHighlighter
-!
-
-!JavaSyntaxHighlighter class methodsFor:'documentation'!
-
-copyright
-"
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
-
- New code and modifications done at SWING Research Group [1]:
-
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
- SWING Research Group, Czech Technical University in Prague
-
- This software is furnished under a license and may be used
- only in accordance with the terms of that license and with the
- inclusion of the above copyright notice. This software may not
- be provided or otherwise made available to, or used by, any
- other person. No title to or ownership of the software is
- hereby transferred.
-
- [1] Code written at SWING Research Group contains a signature
- of one of the above copright owners. For exact set of such code,
- see the differences between this version and version stx:libjava
- as of 1.9.2010
-
-"
-! !
-
-!JavaSyntaxHighlighter class methodsFor:'formatting'!
-
-formatClass: javaClass
-
- ^self new formatClassDefinition: javaClass source in: javaClass
-
- "Created: / 15-12-2011 / 21:54:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatClassDefinition:source in:class
-
- ^self new formatClassDefinition:source in:class
-
- "Created: / 04-08-2011 / 23:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatClassDefinition:source in:class elementsInto: elements
-
- ^self new formatClassDefinition:source in:class elementsInto: elements
-
- "Created: / 04-08-2011 / 23:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatClassDefinition:newCode line: ln number: lnr in:cls
- ^self new formatClassDefinition:newCode line: ln number: lnr in:cls.
-
- "Created: / 04-08-2013 / 00:25:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatExpression:source in:class
-
- ^self new formatExpression:source in:class
-
- "Created: / 04-08-2011 / 23:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatExpression:source in:class elementsInto: elements
-
- ^self new formatExpression:source in:class elementsInto: elements
-
- "Created: / 04-08-2011 / 23:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatMethod:mth source:source in:class
-
- ^self formatMethod: mth source: source in: class using: UserPreferences current
-
- "Created: / 11-02-2012 / 18:18:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatMethod:mth source:source in:class using: preferences
-
- ^self new formatMethod:mth source:source in:class using: preferences
-
- "Created: / 04-08-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatMethod:mth source:source in:class using: preferences elementsInto: elements
-
- ^self new formatMethod:mth source:source in:class using: preferences elementsInto: elements
-
- "Created: / 04-08-2011 / 23:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatMethod:mthd source:newCode line: ln number: lnr in:cls using:syntaxPreferences
- ^ self new formatMethod:mthd source:newCode line: ln number: lnr in:cls using:syntaxPreferences
-
- "Created: / 04-08-2013 / 00:26:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter methodsFor:'formatting'!
-
-formatClassDefinition:source in:class
-
- ^ self format: source kind: #start in: class
-
- "Created: / 04-08-2011 / 23:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatClassDefinition:source in:class elementsInto: els
-
- elements := els.
- ^self formatClassDefinition:source in:class
-
- "Created: / 04-08-2011 / 23:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatClassDefinition:newCode line: line number: lnr in:cls
- | scanner |
-
- line isEmptyOrNil ifTrue:[ ^ nil ].
-
- sourceText := line asText.
- preferences isNil ifTrue:[
- preferences := UserPreferences current.
- ].
- scanner := Scanner for: line asString.
- scanner highlighter: self.
- [
- [ scanner nextToken ~~ #EOF ] whileTrue.
- ] on: Error do:[
-
- ].
- ^ sourceText
-
- "Created: / 04-08-2013 / 00:25:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatExpression:source in:class
-
-"/ self breakPoint:#jv.
- ^source.
- ^ self format: source kind: #'K_EXPRESSION' in: class
-
- "Created: / 04-08-2011 / 23:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatExpression:source in:class elementsInto: els
-
- elements := els.
- ^self formatExpression:source in:class
-
- "Created: / 04-08-2011 / 23:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatMethod:mth source:source in:class using: prefs
-
- preferences := prefs.
- ^ self format: source kind: #start in: class
-
- "Created: / 04-08-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatMethod:mth source:source in:class using: prefs elementsInto: els
-
- preferences := prefs.
- elements := els.
- ^self formatMethod:mth source:source in:class using: prefs
-
- "Created: / 04-08-2011 / 23:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatMethod:mthd source:newCode line: line number: lnr in:cls using:syntaxPreferences
- | scanner |
-
- line isEmptyOrNil ifTrue:[ ^ nil ].
-
- sourceText := line asText.
- preferences := syntaxPreferences.
- preferences isNil ifTrue:[
- preferences := UserPreferences current.
- ].
- scanner := Scanner for: line asString.
- scanner highlighter: self.
- [
- [ scanner nextToken ~~ #EOF ] whileTrue.
- ] on: Error do:[
-
- ].
- ^ sourceText
-
- "Created: / 04-08-2013 / 00:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter methodsFor:'formatting - private'!
-
-format: source kind: kind in: class
-
- | scanner parser builder cacheIt |
-
- "Optimization - if full class source is to be formatted,
- consult cache - when browsing the code or debugging, very
- often same same source is to be highlighted"
-
- preferences isNil ifTrue:[
- preferences := UserPreferences current.
- ].
- cacheIt := kind == #start and: [class notNil].
- cacheIt ifTrue:[
- FormattedSourceCache isNil ifTrue:[
- FormattedSourceCache := OrderedDictionary new
- ] ifFalse:[
- FormattedSourceCache
- at: class
- ifPresent:[:sourceAndText|
- sourceAndText first = source ifTrue:[
- sourceText := sourceAndText second.
- ^sourceText copy.
- ].
-
- ].
- ]
- ].
-
-
- source isText ifTrue:[
- sourceText := source copy
- ] ifFalse:[
- sourceText := source asText.
- ].
-
-
-
- scanner := Scanner for: source.
- builder := Builder new.
- builder highlighter: self.
- scanner highlighter: self.
- parser := Parser newStartingAt: kind.
- parser builder: builder.
- parser stream: scanner.
- parser parse: scanner.
-
- cacheIt ifTrue:[
- [ FormattedSourceCache size > 25 ] whileTrue:[
- FormattedSourceCache removeKey: FormattedSourceCache keys first ifAbsent:[nil]
- ].
- FormattedSourceCache at: class put: { source . sourceText }
- ].
- ^sourceText copy
-
- "Created: / 17-03-2012 / 14:02:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 08-08-2013 / 23:29:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter methodsFor:'syntax detection'!
-
-markArgumentIdentifierFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences argumentIdentifierEmphasis) color:(preferences argumentIdentifierColor)
-!
-
-markBadIdentifierFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences badIdentifierEmphasis)
- color:(preferences badIdentifierColor)
-!
-
-markClassVariableIdentifierFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences classVariableIdentifierEmphasis) color:(preferences classVariableIdentifierColor)
-
- "Modified: / 31.3.1998 / 18:02:14 / cg"
-!
-
-markCommentFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences commentEmphasis) color:(preferences commentColor)
-!
-
-markConstantFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences constantEmphasis) color:(preferences constantColor)
-!
-
-markFrom:pos1 to:pos2 withEmphasis:fontEmp color:clrIn
- |e p2 clr|
-
- clr := clrIn onDevice:Screen current.
-
- clr = Color black ifTrue:[
- e := fontEmp
- ] ifFalse:[
- fontEmp isNil ifTrue:[
- e := (#color->clr)
- ] ifFalse:[
- e := Text addEmphasis:fontEmp to:(#color->clr).
- ]
- ].
- (p2 := pos2) isNil ifTrue:[
- p2 := sourceText size
- ] ifFalse:[
- p2 := p2 min:sourceText size
- ].
- sourceText emphasizeFrom:pos1 to:p2 with:e
-
- "Created: / 31.3.1998 / 13:26:53 / cg"
- "Modified: / 1.4.1998 / 12:51:56 / cg"
-!
-
-markFunctionNameFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences methodSelectorEmphasis) color:(preferences methodSelectorColor)
-!
-
-markGlobalClassIdentifierFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences globalClassIdentifierEmphasis) color:(preferences globalClassIdentifierColor)
-
- "Modified: / 31.3.1998 / 18:02:14 / cg"
- "Created: / 4.3.1999 / 12:53:02 / cg"
-!
-
-markGlobalIdentifierFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences globalIdentifierEmphasis) color:(preferences globalIdentifierColor)
-
- "Modified: / 31.3.1998 / 18:02:14 / cg"
-!
-
-markIdentifierFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences identifierEmphasis) color:(preferences identifierColor)
-!
-
-markInstVarIdentifierFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences instVarIdentifierEmphasis) color:(preferences instVarIdentifierColor)
-
- "Created: / 16.4.1998 / 18:35:40 / cg"
- "Modified: / 16.4.1998 / 18:37:30 / cg"
-!
-
-markKeyword:kw from:pos1 to:pos2
- |em clr|
-
- ( #( 'if' 'else'
- 'while'
- 'for'
- 'do'
- 'return'
- 'continue'
- 'break'
- ) includes:kw) ifTrue:[
- em := preferences controlFlowSelectorEmphasis.
- clr := preferences controlFlowSelectorColor.
- ] ifFalse:[
- em := preferences jsKeywordEmphasis.
- clr := preferences jsKeywordColor.
- ].
- self
- markFrom:pos1 to:pos2
- withEmphasis:em color:clr
-
- "Modified: / 19-05-2010 / 15:07:59 / cg"
- "Modified: / 07-08-2013 / 00:28:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-markLocalIdentifierFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences localIdentifierEmphasis) color:(preferences localIdentifierColor)
-!
-
-markProblem: problem from:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences badIdentifierEmphasis)
- color:(preferences badIdentifierColor)
-
- "Created: / 15-04-2013 / 22:23:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-markSelector:selectorString from:pos1 to:pos2
- | fg em |
-
- fg := preferences selectorColor.
- em := preferences selectorEmphasis.
-
- self
- markFrom:pos1 to:pos2
- withEmphasis:em color:fg
-
- "Modified: / 04-10-2011 / 19:48:48 / cg"
- "Modified: / 17-03-2012 / 13:26:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Created: / 17-03-2012 / 19:12:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-markSelector:selectorString from:pos1 to:pos2 receiverNode:aReceiverNodeOrNil numArgs:numArgs
- |fg selectorSymbol check ok rec em currentEnvironment currentSuperclasses currentSubclasses classToCompileFor fullSelectorCheck|
-
- fg := preferences selectorColor.
- em := preferences selectorEmphasis.
-
-"/ (currentEnvironment notNil
-"/ and:[ (((currentEnvironment _localVariables ? #()) contains:[:local | local name = selectorString])
-"/ or:[((currentEnvironment _argVariables ? #()) contains:[:local | local name = selectorString])])
-"/ ])
-"/ ifTrue:[
-"/ "/ a local call
-"/ ] ifFalse:[
-"/ selectorSymbol := (self translatedSmalltalkSelectorFor:selectorString numArgs:numArgs) asSymbolIfInterned.
-"/ selectorSymbol isNil ifTrue:[
-"/ fg := Color red.
-"/ ] ifFalse:[
-"/ fullSelectorCheck == true ifTrue:[
-"/ aReceiverNodeOrNil notNil ifTrue:[
-"/ check := [:cls | (cls includesSelector:selectorSymbol)
-"/ or:[cls class includesSelector:selectorSymbol]].
-"/
-"/ ok := false.
-"/
-"/ "/ limit search if possible
-"/ (classToCompileFor notNil
-"/ and:[aReceiverNodeOrNil isSelf or:[aReceiverNodeOrNil isSuper]]) ifTrue:[
-"/ currentSuperclasses isNil ifTrue:[
-"/ currentSuperclasses := classToCompileFor withAllSuperclasses.
-"/ ].
-"/ ok := currentSuperclasses contains:check.
-"/ (ok not and:[aReceiverNodeOrNil isSelf]) ifTrue:[
-"/ currentSubclasses isNil ifTrue:[
-"/ currentSubclasses := classToCompileFor allSubclasses.
-"/ ].
-"/ ok := currentSubclasses contains:check.
-"/ ].
-"/ ] ifFalse:[
-"/ aReceiverNodeOrNil isConstant ifTrue:[
-"/ ok := aReceiverNodeOrNil evaluate class withAllSuperclasses contains:check.
-"/ ] ifFalse:[
-"/ (aReceiverNodeOrNil isGlobal
-"/ and:[(rec := aReceiverNodeOrNil evaluate) isBehavior]) ifTrue:[
-"/ ok := rec class withAllSuperclasses contains:check.
-"/ ] ifFalse:[
-"/ ok := Smalltalk allClasses contains:check
-"/ ]
-"/ ]
-"/ ].
-"/
-"/ ok ifFalse:[
-"/ em := preferences unimplementedSelectorEmphasis.
-"/ fg := preferences unimplementedSelectorColor.
-"/ ]
-"/ ]
-"/ ]
-"/ ].
-"/ ].
- self
- markFrom:pos1 to:pos2
- withEmphasis:em color:fg
-
- "Modified: / 04-10-2011 / 19:48:48 / cg"
- "Modified: / 17-03-2012 / 13:26:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-markSelfFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences selfEmphasis) color:(preferences selfColor)
-!
-
-markStringFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences stringEmphasis) color:(preferences stringColor)
-!
-
-markUnknownIdentifierFrom:pos1 to:pos2
- self
- markFrom:pos1 to:pos2
- withEmphasis:(preferences unknownIdentifierEmphasis) color:(preferences unknownIdentifierColor)
-!
-
-markVariable:v from:pos to:endPos
- "support for syntaxColoring"
-
- |type globalValue nameSym|
-
- type := v type.
- (type == #BlockArg
- or:[type == #MethodArg]) ifTrue:[
- self markArgumentIdentifierFrom:pos to:endPos.
- ^ self
- ].
- (type == #BlockVariable
- or:[type == #MethodVariable]) ifTrue:[
- self markLocalIdentifierFrom:pos to:endPos.
- ^ self
- ].
- (type == #GlobalVariable) ifTrue:[
- nameSym := v name asSymbolIfInterned.
- (nameSym isNil
- or:[(Smalltalk includesKey:nameSym) not]) ifTrue:[
- self markUnknownIdentifierFrom:pos to:endPos.
- ^ self
- ].
- globalValue := Smalltalk at:nameSym ifAbsent:nil.
- globalValue isBehavior ifTrue:[
- self markGlobalClassIdentifierFrom:pos to:endPos.
- ] ifFalse:[
- self markGlobalIdentifierFrom:pos to:endPos.
- ].
- ^ self
- ].
- (type == #ClassVariable) ifTrue:[
- self markClassVariableIdentifierFrom:pos to:endPos.
- ^ self
- ].
- (type == #InstanceVariable) ifTrue:[
- self markInstVarIdentifierFrom:pos to:endPos.
- ^ self
- ].
-
- self markIdentifierFrom:pos to:endPos.
-
- "Created: / 16.4.1998 / 18:49:34 / cg"
- "Modified: / 4.3.1999 / 12:56:13 / cg"
-! !
-
-!JavaSyntaxHighlighter::Builder methodsFor:'accessing'!
-
-highlighter
- ^ highlighter
-!
-
-highlighter:something
- highlighter := something.
-! !
-
-!JavaSyntaxHighlighter::Builder methodsFor:'building'!
-
-newComment: text
-
- highlighter markCommentFrom:start to: stop.
- ^super newComment: text
-
- "Created: / 09-03-2012 / 17:11:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-newJavaDoc: text
-
- highlighter markCommentFrom:start to: stop.
- ^super newJavaDoc: text
-
- "Created: / 09-03-2012 / 17:11:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-newStringLiteral: text
-
- highlighter markStringFrom:start to: stop.
- ^super newStringLiteral: text
-
- "Created: / 22-04-2013 / 18:22:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter::Parser methodsFor:'accessing'!
-
-highlighter
-
- ^builder highlighter
-
- "Created: / 17-03-2012 / 19:11:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-stream
- ^ stream
-!
-
-stream:something
- stream := something.
-! !
-
-!JavaSyntaxHighlighter::Parser methodsFor:'grammar-classes-method'!
-
-constructorNameIdentifier
-
- ^super constructorNameIdentifier ==> [:token|
- self highlighter
- markSelector: token value
- from: token startPosition to: token endPosition
- ]
-
- "Created: / 17-03-2012 / 19:12:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-identifier
-
- ^(JavaParserI::TokenParser for: #Identifier)
-
- "Created: / 16-12-2012 / 10:29:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 17-01-2013 / 11:10:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-methodNameIdentifier
-
- ^super methodNameIdentifier ==> [:token|
- self highlighter
- markSelector: token value
- from: token startPosition to: token endPosition
- ]
-
- "Created: / 17-03-2012 / 19:13:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-typeNameIdentifier
-
- ^super typeNameIdentifier ==> [:token|
- self highlighter
- markSelector: token value
- from: token startPosition to: token endPosition
- ]
-
- "Created: / 17-03-2012 / 19:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter::Parser methodsFor:'grammar-literals-string'!
-
-stringLiteral
-
- ^super stringLiteral ==> [:stringToken|
- builder
- start: stringToken startPosition;
- stop: stringToken endPosition;
- newStringLiteral: stringToken value
- ]
-
- "Created: / 17-03-2012 / 17:31:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 22-04-2013 / 18:13:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter::Parser methodsFor:'utility'!
-
-tokenFor: aString
-
-"/ | p |
-"/
-"/ p := keywords at: aString ifAbsent:[nil].
-"/ p notNil ifTrue:[
-"/ ^ (self asToken: p) ==> [:token|
-"/ | start stop |
-"/
-"/ stop := stream position.
-"/ start := stop - keyword size.
-"/ builder highlighter markKeyword: keyword from:start to:stop
-"/ ].
-"/ ].
-
- ^super tokenFor: aString
-
- "Created: / 10-03-2012 / 11:52:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter::Scanner methodsFor:'accessing'!
-
-highlighter
- ^ highlighter
-!
-
-highlighter:aJavaSyntaxHighlighter
- highlighter := aJavaSyntaxHighlighter.
-! !
-
-!JavaSyntaxHighlighter::Scanner methodsFor:'error handling'!
-
-syntaxError:aMessage position:position to:endPos
- "a syntax error happened"
-
- endPos notNil ifTrue:[
- highlighter markBadIdentifierFrom:position to: endPos.
- ]
-
- "Created: / 13-04-2012 / 18:31:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter::Scanner methodsFor:'initialization'!
-
-initialize
- "initialize the scanner"
-
- super initialize.
- saveComments := true
-
- "Created: / 17-03-2012 / 00:02:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter::Scanner methodsFor:'private'!
-
-checkForKeyword:string
- | isKW |
-
- isKW := super checkForKeyword:string.
- isKW ifTrue:[
- highlighter markKeyword:string from:tokenStartPosition + 1 to:tokenStartPosition + string size
- ].
- ^isKW
-
- "Created: / 17-03-2012 / 00:15:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter::Scanner methodsFor:'reading next token'!
-
-nextToken
- | t |
-
- t := super nextToken.
- t == #String ifTrue:[
- highlighter markStringFrom:tokenStartPosition + 1 to: tokenEndPosition + 1.
- ] ifFalse:[
- t == #Integer ifTrue:[
- highlighter markConstantFrom:tokenStartPosition + 1 to: tokenEndPosition + 1.
- ]].
- ^ t
-
- "Created: / 14-05-1998 / 15:48:04 / cg"
- "Modified: / 16-05-1998 / 19:12:29 / cg"
- "Created: / 17-03-2012 / 19:15:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 03-08-2013 / 20:12:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-skipComment
- super skipComment.
- highlighter markCommentFrom:((tokenStartPosition + 1) max: 1) to: source position.
- ^nil
-
- "Created: / 17-03-2012 / 00:04:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-skipEOLComment
- super skipEOLComment.
- highlighter markCommentFrom:((tokenStartPosition - 1) max: 1) to: source position.
- ^nil
-
- "Created: / 17-03-2012 / 00:05:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!JavaSyntaxHighlighter class methodsFor:'documentation'!
-
-version_CVS
- ^ '$Header: /cvs/stx/stx/libjava/tools/JavaSyntaxHighlighter.st,v 1.2 2013-02-25 11:15:35 vrany Exp $'
-!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
- ^ 'Id'
-! !
-
--- a/tools/Make.proto Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/Make.proto Fri Aug 30 12:19:02 2013 +0100
@@ -141,10 +141,9 @@
cd ../../libui && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../goodies/petitparser && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../ && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
- cd ../../goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../libwidg && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
- cd ../ && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../libwidg2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../libtool && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
@@ -180,6 +179,7 @@
$(OUTDIR)JavaScannerBase.$(O) JavaScannerBase.$(H): JavaScannerBase.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)JavaSetInspectorView.$(O) JavaSetInspectorView.$(H): JavaSetInspectorView.st $(INCLUDE_TOP)/stx/libtool/SetInspectorView.$(H) $(INCLUDE_TOP)/stx/libtool/InspectorView.$(H) $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/DeviceGraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsContext.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)JavaSettingsApplication.$(O) JavaSettingsApplication.$(H): JavaSettingsApplication.st $(INCLUDE_TOP)/stx/libtool/AbstractSettingsApplication.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)JavaSourceDocument.$(O) JavaSourceDocument.$(H): JavaSourceDocument.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)JavaSourcePartition.$(O) JavaSourcePartition.$(H): JavaSourcePartition.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)JavaSourceReference.$(O) JavaSourceReference.$(H): JavaSourceReference.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)stx_libjava_tools.$(O) stx_libjava_tools.$(H): stx_libjava_tools.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -200,7 +200,7 @@
$(OUTDIR)JavaEnumDeclarationNode.$(O) JavaEnumDeclarationNode.$(H): JavaEnumDeclarationNode.st $(INCLUDE_TOP)/stx/libjava/tools/JavaTypeDeclarationNode.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaDeclarationNode.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParseNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)JavaInterfaceDeclarationNode.$(O) JavaInterfaceDeclarationNode.$(H): JavaInterfaceDeclarationNode.st $(INCLUDE_TOP)/stx/libjava/tools/JavaTypeDeclarationNode.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaDeclarationNode.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParseNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)JavaMethodDeclarationNode.$(O) JavaMethodDeclarationNode.$(H): JavaMethodDeclarationNode.st $(INCLUDE_TOP)/stx/libjava/tools/JavaMethodLikeDeclarationNode.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaDeclarationNode.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParseNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)JavaSyntaxHighlighter.$(O) JavaSyntaxHighlighter.$(H): JavaSyntaxHighlighter.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParser.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParserII.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParserI.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPCompositeParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParseNodeBuilder.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaScanner.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaScannerBase.$(H) $(STCHDR)
+$(OUTDIR)JavaSourceHighlighter.$(O) JavaSourceHighlighter.$(H): JavaSourceHighlighter.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParseNodeBuilder.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParser.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParserII.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParserI.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPCompositeParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaScanner.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaScannerBase.$(H) $(STCHDR)
$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/libjava/JavaObject.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__NewSystemBrowser.$(H) $(INCLUDE_TOP)/stx/libtool/SystemBrowser.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/ConfigurableFeatures.$(H) $(STCHDR)
# ENDMAKEDEPEND --- do not remove this line
--- a/tools/Make.spec Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/Make.spec Fri Aug 30 12:19:02 2013 +0100
@@ -64,6 +64,7 @@
JavaScannerBase \
JavaSetInspectorView \
JavaSettingsApplication \
+ JavaSourceDocument \
JavaSourcePartition \
JavaSourceReference \
stx_libjava_tools \
@@ -84,7 +85,7 @@
JavaEnumDeclarationNode \
JavaInterfaceDeclarationNode \
JavaMethodDeclarationNode \
- JavaSyntaxHighlighter \
+ JavaSourceHighlighter \
@@ -104,6 +105,7 @@
$(OUTDIR_SLASH)JavaScannerBase.$(O) \
$(OUTDIR_SLASH)JavaSetInspectorView.$(O) \
$(OUTDIR_SLASH)JavaSettingsApplication.$(O) \
+ $(OUTDIR_SLASH)JavaSourceDocument.$(O) \
$(OUTDIR_SLASH)JavaSourcePartition.$(O) \
$(OUTDIR_SLASH)JavaSourceReference.$(O) \
$(OUTDIR_SLASH)stx_libjava_tools.$(O) \
@@ -124,7 +126,7 @@
$(OUTDIR_SLASH)JavaEnumDeclarationNode.$(O) \
$(OUTDIR_SLASH)JavaInterfaceDeclarationNode.$(O) \
$(OUTDIR_SLASH)JavaMethodDeclarationNode.$(O) \
- $(OUTDIR_SLASH)JavaSyntaxHighlighter.$(O) \
+ $(OUTDIR_SLASH)JavaSourceHighlighter.$(O) \
$(OUTDIR_SLASH)extensions.$(O) \
--- a/tools/abbrev.stc Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/abbrev.stc Fri Aug 30 12:19:02 2013 +0100
@@ -17,7 +17,9 @@
JavaScannerBase JavaScannerBase stx:libjava/tools 'Languages-Java-Parser' 3
JavaSetInspectorView JavaSetInspectorView stx:libjava/tools 'Languages-Java-Tools-Inspectors' 2
JavaSettingsApplication JavaSettingsApplication stx:libjava/tools 'Languages-Java-Tools' 1
+JavaSourceDocument JavaSourceDocument stx:libjava/tools 'Languages-Java-Tools-Source' 0
JavaSourcePartition JavaSourcePartition stx:libjava/tools 'Languages-Java-Parser-Utils' 0
+JavaSourcePartitioner JavaSourcePartitioner stx:libjava/tools 'Languages-Java-Parser-Utils' 0
JavaSourcePartitionerTests JavaSourcePartitionerTests stx:libjava/tools 'Languages-Java-Tests-Parser' 1
JavaSourceReference JavaSourceReference stx:libjava/tools 'Languages-Java-Parser-Utils' 0
JavaSyntaxHighlighter_Eclipse JavaSyntaxHighlighter_Eclipse stx:libjava/tools 'Languages-Java-Tools-Eclipse' 0
@@ -32,7 +34,6 @@
JavaSourceFile JavaSourceFile stx:libjava/tools 'Languages-Java-Parser-AST' 0
JavaMethodLikeDeclarationNode JavaMethodLikeDeclarationNode stx:libjava/tools 'Languages-Java-Parser-AST' 0
JavaParser JavaParser stx:libjava/tools 'Languages-Java-Parser' 0
-JavaSourcePartitioner JavaSourcePartitioner stx:libjava/tools 'Languages-Java-Parser-Utils' 0
JavaTypeDeclarationNode JavaTypeDeclarationNode stx:libjava/tools 'Languages-Java-Parser-AST' 0
JavaVariableDeclarationNode JavaVariableDeclarationNode stx:libjava/tools 'Languages-Java-Parser-AST' 0
JavaAnnotationDeclarationNode JavaAnnotationDeclarationNode stx:libjava/tools 'Languages-Java-Parser-AST' 0
@@ -41,4 +42,4 @@
JavaEnumDeclarationNode JavaEnumDeclarationNode stx:libjava/tools 'Languages-Java-Parser-AST' 0
JavaInterfaceDeclarationNode JavaInterfaceDeclarationNode stx:libjava/tools 'Languages-Java-Parser-AST' 0
JavaMethodDeclarationNode JavaMethodDeclarationNode stx:libjava/tools 'Languages-Java-Parser-AST' 0
-JavaSyntaxHighlighter JavaSyntaxHighlighter stx:libjava/tools 'Languages-Java-Tools' 0
+JavaSourceHighlighter JavaSourceHighlighter stx:libjava/tools 'Languages-Java-Tools-Source' 0
--- a/tools/bc.mak Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/bc.mak Fri Aug 30 12:19:02 2013 +0100
@@ -58,10 +58,9 @@
pushd ..\..\libui & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\goodies\petitparser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd .. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
- pushd ..\..\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\libwidg & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
- pushd .. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\libwidg2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\libtool & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
@@ -104,6 +103,7 @@
$(OUTDIR)JavaScannerBase.$(O) JavaScannerBase.$(H): JavaScannerBase.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)JavaSetInspectorView.$(O) JavaSetInspectorView.$(H): JavaSetInspectorView.st $(INCLUDE_TOP)\stx\libtool\SetInspectorView.$(H) $(INCLUDE_TOP)\stx\libtool\InspectorView.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\DeviceGraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsContext.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)JavaSettingsApplication.$(O) JavaSettingsApplication.$(H): JavaSettingsApplication.st $(INCLUDE_TOP)\stx\libtool\AbstractSettingsApplication.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)JavaSourceDocument.$(O) JavaSourceDocument.$(H): JavaSourceDocument.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)JavaSourcePartition.$(O) JavaSourcePartition.$(H): JavaSourcePartition.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)JavaSourceReference.$(O) JavaSourceReference.$(H): JavaSourceReference.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)stx_libjava_tools.$(O) stx_libjava_tools.$(H): stx_libjava_tools.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -124,7 +124,7 @@
$(OUTDIR)JavaEnumDeclarationNode.$(O) JavaEnumDeclarationNode.$(H): JavaEnumDeclarationNode.st $(INCLUDE_TOP)\stx\libjava\tools\JavaTypeDeclarationNode.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaDeclarationNode.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParseNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)JavaInterfaceDeclarationNode.$(O) JavaInterfaceDeclarationNode.$(H): JavaInterfaceDeclarationNode.st $(INCLUDE_TOP)\stx\libjava\tools\JavaTypeDeclarationNode.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaDeclarationNode.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParseNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)JavaMethodDeclarationNode.$(O) JavaMethodDeclarationNode.$(H): JavaMethodDeclarationNode.st $(INCLUDE_TOP)\stx\libjava\tools\JavaMethodLikeDeclarationNode.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaDeclarationNode.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParseNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)JavaSyntaxHighlighter.$(O) JavaSyntaxHighlighter.$(H): JavaSyntaxHighlighter.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParser.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParserII.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParserI.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPCompositeParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParseNodeBuilder.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaScanner.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaScannerBase.$(H) $(STCHDR)
+$(OUTDIR)JavaSourceHighlighter.$(O) JavaSourceHighlighter.$(H): JavaSourceHighlighter.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParseNodeBuilder.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParser.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParserII.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParserI.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPCompositeParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaScanner.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaScannerBase.$(H) $(STCHDR)
$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\libjava\JavaObject.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NewSystemBrowser.$(H) $(INCLUDE_TOP)\stx\libtool\SystemBrowser.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\ConfigurableFeatures.$(H) $(STCHDR)
# ENDMAKEDEPEND --- do not remove this line
--- a/tools/libInit.cc Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/libInit.cc Fri Aug 30 12:19:02 2013 +0100
@@ -41,6 +41,7 @@
_JavaScannerBase_Init(pass,__pRT__,snd);
_JavaSetInspectorView_Init(pass,__pRT__,snd);
_JavaSettingsApplication_Init(pass,__pRT__,snd);
+_JavaSourceDocument_Init(pass,__pRT__,snd);
_JavaSourcePartition_Init(pass,__pRT__,snd);
_JavaSourceReference_Init(pass,__pRT__,snd);
_stx_137libjava_137tools_Init(pass,__pRT__,snd);
@@ -61,7 +62,7 @@
_JavaEnumDeclarationNode_Init(pass,__pRT__,snd);
_JavaInterfaceDeclarationNode_Init(pass,__pRT__,snd);
_JavaMethodDeclarationNode_Init(pass,__pRT__,snd);
-_JavaSyntaxHighlighter_Init(pass,__pRT__,snd);
+_JavaSourceHighlighter_Init(pass,__pRT__,snd);
_stx_137libjava_137tools_extensions_Init(pass,__pRT__,snd);
__END_PACKAGE__();
--- a/tools/stx_libjava_tools.st Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/stx_libjava_tools.st Fri Aug 30 12:19:02 2013 +0100
@@ -70,7 +70,7 @@
exclude individual packages in the #excludedFromPreRequisites method."
^ #(
- #'jv:smallsense' "SmallSenseSyntaxHighlightingService - referenced by JavaCompilerProblemService>>rehighlight: "
+ #'jv:smallsense' "SmallSense::ParseNodeInspector - referenced by JavaSourceDocument>>inspector2TabParseTree "
#'stx:libbasic2' "CacheDictionary - referenced by JavaParser_Eclipse class>>initialize "
#'stx:libjava/experiments' "JavaCompiler - referenced by JavaCompilerProblemService>>syntaxHighlighter "
)
@@ -161,7 +161,9 @@
JavaScannerBase
JavaSetInspectorView
JavaSettingsApplication
+ JavaSourceDocument
JavaSourcePartition
+ (JavaSourcePartitioner autoload)
(JavaSourcePartitionerTests autoload)
JavaSourceReference
(#'JavaSyntaxHighlighter_Eclipse' autoload)
@@ -176,7 +178,6 @@
JavaSourceFile
JavaMethodLikeDeclarationNode
JavaParser
- (JavaSourcePartitioner autoload)
JavaTypeDeclarationNode
JavaVariableDeclarationNode
JavaAnnotationDeclarationNode
@@ -185,7 +186,7 @@
JavaEnumDeclarationNode
JavaInterfaceDeclarationNode
JavaMethodDeclarationNode
- JavaSyntaxHighlighter
+ JavaSourceHighlighter
)
!
--- a/tools/tools.rc Fri Aug 30 12:12:44 2013 +0100
+++ b/tools/tools.rc Fri Aug 30 12:19:02 2013 +0100
@@ -25,7 +25,7 @@
VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
VALUE "ProductName", "Smalltalk/X\0"
VALUE "ProductVersion", "6.2.3.0\0"
- VALUE "ProductDate", "Sun, 25 Aug 2013 10:48:59 GMT\0"
+ VALUE "ProductDate", "Fri, 30 Aug 2013 11:13:09 GMT\0"
END
END
--- a/vcmake.bat Fri Aug 30 12:12:44 2013 +0100
+++ b/vcmake.bat Fri Aug 30 12:19:02 2013 +0100
@@ -18,13 +18,6 @@
@echo "***********************************"
-@echo "Buildung stx/libjava/libs
-@echo "***********************************"
-@cd libs
-@call vcmake %1 %2
-@cd ..
-
-@echo "***********************************"
@echo "Buildung stx/libjava/tools
@echo "***********************************"
@cd tools
@@ -32,9 +25,9 @@
@cd ..
@echo "***********************************"
-@echo "Buildung stx/libjava/mauve
+@echo "Buildung stx/libjava/examples
@echo "***********************************"
-@cd mauve
+@cd examples
@call vcmake %1 %2
@cd ..