Fixes for Smalltalk/X
* Do not use Character class>>#cr /#lf as semantics of this method differ in Smalltalk/X and Squeak.
Use Character class>>#codePoint: instead
* Do not use Squeakism Dictionary >> #keysSortedSafely - there is no need for this as
all keys are strings.
--- a/parsers/java/PJAbstractTypeDeclarationNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJAbstractTypeDeclarationNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJAbstractTypeDeclarationNode comment:''
-!
-
!PJAbstractTypeDeclarationNode methodsFor:'accessing'!
simpleName
--- a/parsers/java/PJAnnotationNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJAnnotationNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJAnnotationNode comment:''
-!
-
!PJAnnotationNode class methodsFor:'instance creation'!
typeName: aPJNameNode
--- a/parsers/java/PJArrayTypeNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJArrayTypeNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJArrayTypeNode comment:''
-!
-
!PJArrayTypeNode class methodsFor:'instance creation'!
elementType: aTypeNode dimensions: aNumber
--- a/parsers/java/PJCharacterLiteralNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJCharacterLiteralNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJCharacterLiteralNode comment:''
-!
-
!PJCharacterLiteralNode class methodsFor:'as yet unclassified'!
literalValue: aString
--- a/parsers/java/PJCommentsNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJCommentsNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJCommentsNode comment:''
-!
-
!PJCommentsNode class methodsFor:'as yet unclassified'!
comment: aString
--- a/parsers/java/PJCompilationUnitNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJCompilationUnitNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJCompilationUnitNode comment:''
-!
-
!PJCompilationUnitNode methodsFor:'visiting'!
acceptVisitor: aVisitor
--- a/parsers/java/PJEndOfLineCommentsNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJEndOfLineCommentsNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJEndOfLineCommentsNode comment:''
-!
-
!PJEndOfLineCommentsNode class methodsFor:'as yet unclassified'!
comment: aString
--- a/parsers/java/PJExpressionStatementNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJExpressionStatementNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -12,6 +12,7 @@
PJExpressionStatementNode comment:'A statement which has nothing but expression in it.
Examples:
5;
a = 5;
a.foo();
a = for(5);'
!
+
!PJExpressionStatementNode methodsFor:'accessing'!
expression
@@ -29,3 +30,10 @@
^ aVisitor visitExpressionStatementNode: self
! !
+!PJExpressionStatementNode class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/parsers/java/PJFloatLiteralNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJFloatLiteralNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJFloatLiteralNode comment:''
-!
-
!PJFloatLiteralNode class methodsFor:'as yet unclassified'!
newFrom: literalString
--- a/parsers/java/PJImportDeclarationNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJImportDeclarationNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJImportDeclarationNode comment:''
-!
-
!PJImportDeclarationNode methodsFor:'accessing'!
isOnDemand
--- a/parsers/java/PJMethodDeclarationNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJMethodDeclarationNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -16,9 +16,6 @@
"
!
-PJMethodDeclarationNode comment:''
-!
-
!PJMethodDeclarationNode methodsFor:'accessing'!
body
--- a/parsers/java/PJModifierNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJModifierNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJModifierNode comment:''
-!
-
!PJModifierNode class methodsFor:'instance creation'!
keyword: aString
--- a/parsers/java/PJNameNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJNameNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJNameNode comment:''
-!
-
!PJNameNode methodsFor:'accessing'!
fullyQualifiedName
--- a/parsers/java/PJNullLiteralNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJNullLiteralNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJNullLiteralNode comment:''
-!
-
!PJNullLiteralNode class methodsFor:'as yet unclassified'!
literalValue: aLiteral
--- a/parsers/java/PJPackageDeclarationNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJPackageDeclarationNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJPackageDeclarationNode comment:''
-!
-
!PJPackageDeclarationNode methodsFor:'accessing'!
nameNode
--- a/parsers/java/PJParameterDeclaratorNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJParameterDeclaratorNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJParameterDeclaratorNode comment:''
-!
-
!PJParameterDeclaratorNode methodsFor:'accessing'!
arrayLevel
--- a/parsers/java/PJPrimitiveTypeNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJPrimitiveTypeNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJPrimitiveTypeNode comment:''
-!
-
!PJPrimitiveTypeNode methodsFor:'as yet unclassified'!
acceptVisitor: aVisitor
--- a/parsers/java/PJQualifiedNameNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJQualifiedNameNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJQualifiedNameNode comment:''
-!
-
!PJQualifiedNameNode class methodsFor:'instance creation'!
name: aPJSimpleName qualifier: aPJName
--- a/parsers/java/PJSeparatorNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJSeparatorNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJSeparatorNode comment:''
-!
-
!PJSeparatorNode class methodsFor:'as yet unclassified'!
separatorValue: aString
--- a/parsers/java/PJSimpleNameNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJSimpleNameNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJSimpleNameNode comment:''
-!
-
!PJSimpleNameNode class methodsFor:'instance creation'!
identifier: aString
--- a/parsers/java/PJTraditionalCommentsNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJTraditionalCommentsNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJTraditionalCommentsNode comment:''
-!
-
!PJTraditionalCommentsNode methodsFor:'as yet unclassified'!
--- a/parsers/java/PJTypeDeclarationNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJTypeDeclarationNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -10,9 +10,6 @@
category:'PetitJava-AST'
!
-PJTypeDeclarationNode comment:''
-!
-
!PJTypeDeclarationNode methodsFor:'accessing'!
fieldDeclarations
--- a/parsers/java/PJTypeNode.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PJTypeNode.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-AST'
!
-PJTypeNode comment:''
-!
-
!PJTypeNode class methodsFor:'instance creation'!
type: aString
--- a/parsers/java/PPJavaLexicon.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PPJavaLexicon.st Tue Apr 21 17:06:24 2015 +0100
@@ -28,6 +28,7 @@
PPJavaLexicon comment:'A parser with a definitions for some basic Java gramar parts
Grammar rules follow as closely as possible the specification found in "The Java Language Specification Third Edition"
URL = '
!
+
!PPJavaLexicon class methodsFor:'accessing'!
ignoredNames
@@ -159,11 +160,12 @@
keyword
- | keywordParsers |
-
- keywordParsers := keywords keysSortedSafely
- collect: [:eachKey | keywords at: eachKey ].
- ^ self asToken: ( (keywordParsers reduce: [ :a :b | a / b ]) )
+ | keywordParsers |
+
+ keywordParsers := keywords keys asSortedCollection collect: [:eachKey | keywords at: eachKey ].
+ ^ self asToken: ( (keywordParsers reduce: [ :a :b | a / b ]) )
+
+ "Modified (format): / 21-04-2015 / 15:27:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPJavaLexicon methodsFor:'grammar-lineTerminators'!
@@ -175,7 +177,9 @@
lineTerminator
- ^ (Character lf asParser) / (Character cr asParser , (Character lf asParser ) optional )
+ ^ ((Character codePoint: 10) asParser) / ((Character codePoint: 13) asParser , ((Character codePoint: 10) asParser ) optional )
+
+ "Modified: / 21-04-2015 / 16:55:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPJavaLexicon methodsFor:'grammar-literals'!
@@ -401,12 +405,12 @@
!PPJavaLexicon methodsFor:'grammar-operators'!
operator
- | operatorParsers |
-
- operatorParsers := operators keysSortedSafely
- collect: [:eachKey | operators at: eachKey ].
-
- ^self asToken: (operatorParsers reduce: [ :a :b | a / b ])
+ | operatorParsers |
+
+ operatorParsers := operators keys asSortedCollection collect: [:eachKey | operators at: eachKey ].
+ ^self asToken: (operatorParsers reduce: [ :a :b | a / b ])
+
+ "Modified: / 21-04-2015 / 15:26:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPJavaLexicon methodsFor:'grammar-separators'!
@@ -531,3 +535,10 @@
ifAbsent: [operators at: aString] ])
! !
+!PPJavaLexicon class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/parsers/java/PPJavaLexiconTest.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PPJavaLexiconTest.st Tue Apr 21 17:06:24 2015 +0100
@@ -11,9 +11,6 @@
category:'PetitJava-Tests'
!
-PPJavaLexiconTest comment:''
-!
-
!PPJavaLexiconTest methodsFor:'accessing'!
parserClass
@@ -221,9 +218,11 @@
testLineTerminator3
- self
- parse: (Character cr asString , Character lf asString)
- rule: #lineTerminator
+ self
+ parse: (Character codePoint: 13) asString , (Character codePoint: 10) asString
+ rule: #lineTerminator
+
+ "Modified: / 21-04-2015 / 15:47:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
testLineTerminator4
--- a/parsers/java/PPJavaParser.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PPJavaParser.st Tue Apr 21 17:06:24 2015 +0100
@@ -81,16 +81,18 @@
constructorDeclaration
- ^ super constructorDeclaration ==> [:nodes |
- |constructor|
-
- constructor := PJConstructorDeclarationNode named: nodes third name.
- constructor
- statements: nodes eighth;
- modifiers: nodes first;
- returnType: nodes second;
- parameters: nodes fourth.
- constructor]
+ ^ super constructorDeclaration ==> [:nodes |
+ |constructor|
+
+ constructor := PJConstructorDeclarationNode named: nodes third name.
+ constructor
+ statements: (nodes at: 8);
+ modifiers: nodes first;
+ returnType: nodes second;
+ parameters: nodes fourth.
+ constructor]
+
+ "Modified: / 21-04-2015 / 15:52:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
expressionStatement
@@ -118,16 +120,18 @@
methodNotConstructorDeclaration
- ^ super methodNotConstructorDeclaration ==> [:nodes |
- | methodDeclarationNode |
- methodDeclarationNode := PJMethodDeclarationNode named: nodes fourth name.
- methodDeclarationNode modifiers: nodes first.
- methodDeclarationNode returnType: nodes third.
- methodDeclarationNode body: nodes eighth.
- methodDeclarationNode parameters: nodes fifth.
- methodDeclarationNode
-
- ]
+ ^ super methodNotConstructorDeclaration ==> [:nodes |
+ | methodDeclarationNode |
+ methodDeclarationNode := PJMethodDeclarationNode named: nodes fourth name.
+ methodDeclarationNode modifiers: nodes first.
+ methodDeclarationNode returnType: nodes third.
+ methodDeclarationNode body: (nodes at: 8).
+ methodDeclarationNode parameters: nodes fifth.
+ methodDeclarationNode
+
+ ]
+
+ "Modified: / 21-04-2015 / 15:52:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
normalParameterDecl
--- a/parsers/java/PPJavaParserTest.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PPJavaParserTest.st Tue Apr 21 17:06:24 2015 +0100
@@ -11,9 +11,6 @@
category:'PetitJava-Tests'
!
-PPJavaParserTest comment:''
-!
-
!PPJavaParserTest methodsFor:'accessing'!
parserClass
@@ -555,9 +552,11 @@
!
testStringLiteral1
- super testStringLiteral1.
- self assert: result class equals: PJStringLiteralNode.
- self assert: result literalValue equals: String empty
+ super testStringLiteral1.
+ self assert: result class equals: PJStringLiteralNode.
+ self assert: result literalValue equals: (String new:0)
+
+ "Modified: / 21-04-2015 / 15:53:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
testStringLiteral11
--- a/parsers/java/PPJavaSyntaxTest.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PPJavaSyntaxTest.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-Tests'
!
-PPJavaSyntaxTest comment:''
-!
-
!PPJavaSyntaxTest methodsFor:'accessing'!
parserClass
--- a/parsers/java/PPJavaToken.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PPJavaToken.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-Core'
!
-PPJavaToken comment:''
-!
-
!PPJavaToken methodsFor:'accessing'!
comments
--- a/parsers/java/PPJavaTokenParser.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PPJavaTokenParser.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-Core'
!
-PPJavaTokenParser comment:''
-!
-
!PPJavaTokenParser methodsFor:'parsing'!
parseComments: anArray on: aStream
--- a/parsers/java/PPJavaWhitespaceParser.st Tue Apr 21 14:57:16 2015 +0100
+++ b/parsers/java/PPJavaWhitespaceParser.st Tue Apr 21 17:06:24 2015 +0100
@@ -9,9 +9,6 @@
category:'PetitJava-Core'
!
-PPJavaWhitespaceParser comment:''
-!
-
!PPJavaWhitespaceParser methodsFor:'as yet unclassified'!
acceptsEpsilon