JavaParser.st
author Stefan Vogel <sv@exept.de>
Tue, 08 Nov 2005 17:49:17 +0100
changeset 2121 7b06266d8249
parent 749 e898eaeff091
child 2152 1cbdfbcc685c
permissions -rw-r--r--
/tmp/cvsyRpZ5v
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     7
 license:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    14
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    15
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    17
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    19
 obtaining a copy of this software and associated documentation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    20
 files (the 'Software'), to deal in the Software without
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    21
 restriction, including without limitation the rights to use,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    23
 copies of the Software, and to permit persons to whom the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    24
 Software is furnished to do so, subject to the following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    25
 conditions:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    26
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
 The above copyright notice and this permission notice shall be
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
 included in all copies or substantial portions of the Software.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    38
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    40
     of one of the above copright owners.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
PPCompositeParser subclass:#JavaParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
	instanceVariableNames:'classDecl'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Parser'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    49
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    50
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    51
PPParser subclass:#BlockParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    52
	instanceVariableNames:'openBlockChar closeBlockChar innerBlockCount'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    53
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
	privateIn:JavaParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    56
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    57
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    58
PPParser subclass:#CommentParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    59
	instanceVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    60
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    61
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    62
	privateIn:JavaParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    63
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    64
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    65
PPParser subclass:#MultilineCommentParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    66
	instanceVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    67
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    68
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    69
	privateIn:JavaParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    70
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    71
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    72
PPJavaNode subclass:#PPBlockNode
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    73
	instanceVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    75
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    76
	privateIn:JavaParser::MultilineCommentParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    77
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    78
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    79
PPParser subclass:#LineNumberParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    80
	instanceVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    81
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    82
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    83
	privateIn:JavaParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    84
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    85
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    86
ReadStream subclass:#LineNumberStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    87
	instanceVariableNames:'eolPositions lastPosition previousWasCR'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    88
	classVariableNames:'CR LF'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    89
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    90
	privateIn:JavaParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    91
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    92
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
JavaParser::MultilineCommentParser subclass:#JavaDocParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
	instanceVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    95
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
	privateIn:JavaParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    98
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    99
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
PPParser subclass:#StatementParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   101
	instanceVariableNames:'brackets'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   102
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
	privateIn:JavaParser
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   105
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   106
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   107
!JavaParser class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   108
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   109
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
 Parts of the code written by Claus Gittinger are under following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
 license:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
 Permission is hereby granted, free of charge, to any person
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
 obtaining a copy of this software and associated documentation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
 files (the 'Software'), to deal in the Software without
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
 restriction, including without limitation the rights to use,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
 copy, modify, merge, publish, distribute, sublicense, and/or sell
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
 copies of the Software, and to permit persons to whom the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
 Software is furnished to do so, subject to the following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
 conditions:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
 The above copyright notice and this permission notice shall be
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
 included in all copies or substantial portions of the Software.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   146
 OTHER DEALINGS IN THE SOFTWARE.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
 [1] Code written at SWING Research Group contain a signature
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
     of one of the above copright owners.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   150
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   151
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   152
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   153
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   154
!JavaParser class methodsFor:'parsing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   155
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   156
methodsIn: sourceCode
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   157
    ^ (self parse: sourceCode) methods.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
    "Created: / 08-01-2011 / 15:42:24 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   160
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   161
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   162
parse: code
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
    ^ JavaParseResult from: (super parse: code).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
    "Created: / 08-01-2011 / 16:05:01 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
    "Modified: / 07-04-2011 / 22:07:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   167
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
!JavaParser methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   170
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   171
lineNumber
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   172
    ^ LineNumberParser new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
    "Created: / 29-12-2010 / 22:14:02 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   175
    "Modified: / 07-04-2011 / 22:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
start
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
	^ self javaFile end.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
!JavaParser methodsFor:'grammar'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
annotation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
	^ $@ asParser, self identifier, self annotationBlock optional 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   187
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   188
annotationBlock
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
        ^ BlockParser new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
                openBlockChar: $(;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
                closeBlockChar: $);
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
                yourself;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   193
        trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   194
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
    "Modified: / 07-04-2011 / 21:46:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   197
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   198
argument
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   199
	^ (self finalKW optional, self type, self threeDotsKW optional, self typeIdentifier) trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   200
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   201
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   202
argumentList
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   203
	^ (self argument separatedBy:  ($, asParser trim) ==> [:token | nil]) ==> [: token | token select: [:each | each notNil ]].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   204
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   205
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   206
block
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   207
        ^ BlockParser new trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   208
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   209
    "Modified: / 07-04-2011 / 21:46:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   210
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   211
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   212
classBody
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   213
        ^ (${ asParser trim, self classContents star, $} asParser trim) 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   214
        foldLeft: [:a :contents :b | contents select: [:each | each notNil ]]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   215
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   216
    "Modified: / 30-12-2010 / 11:21:09 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   217
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   218
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   219
classContents 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   220
        ^       self methodDecl trim / 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   221
                self constructor trim /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   222
                self staticInitializer trim / 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   223
                self comment /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   224
                "Since classes may be nested recursively we have to use this syntax - without self" 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   225
                classDecl trim / 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   226
                "TODO JK: This will cause problems - sooner or later"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   227
                self statement.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   228
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   229
    "Modified: / 29-12-2010 / 22:12:11 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   230
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   231
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   232
classDecl
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   233
	^ 	self classModifiers, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   234
		(self classKW / self interfaceKW), 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   235
		(self identifier, self genericBlock optional) flatten,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   236
		(self extends optional),
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   237
		(self implements optional),
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   238
		self classBody
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   239
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   240
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   241
classModifiers
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   242
	^ 	('public' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   243
		'private' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   244
		'static' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   245
		'abstract' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   246
		'final' asParser 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   247
		
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   248
		) trim star
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   249
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   250
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   251
comment
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   252
        ^ (self oneLineComment / self multilineComment) ==> [ :token | nil ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   253
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   254
    "Modified: / 30-12-2010 / 11:20:56 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   255
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   256
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   257
constructor
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   258
        ^ (     
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   259
                self lineNumber,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   260
                self javadoc optional, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   261
                self methodModifiers optional, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   262
                self identifier, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   263
                self methodArguments, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   264
                self methodBody optional) trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   265
                        foldLeft: [:startLine :javadoc :modifiers :name :arguments :body | 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   266
                                JavaMethodDeclarationNode new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   267
                                        startLine: startLine;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   268
                                        javadoc: javadoc;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   269
                                        modifiers: modifiers;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   270
                                        retval: nil;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   271
                                        methodName: name;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   272
                                        arguments: arguments
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   273
                        ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   274
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   275
    "Modified: / 08-01-2011 / 16:27:25 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   276
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   277
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   278
extends
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   279
	^ self extendsKW, self type
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   280
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   281
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   282
fileHeader
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   283
	^ self comment star, self package optional, self imports optional, self comment star
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   284
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   285
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   286
fullIdentifier
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   287
	^ (self identifier separatedBy: $. asParser) trim flatten
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   288
	
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   289
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   290
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   291
genericBlock
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   292
        ^ BlockParser new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   293
                openBlockChar: $<;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   294
                closeBlockChar: $>;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   295
                yourself;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   296
        trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   297
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   298
    "Modified: / 07-04-2011 / 21:46:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   299
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   300
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   301
identifier
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   302
	^ (#letter asParser, #word asParser star) trim flatten
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   303
	
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   304
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   305
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   306
implements
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   307
	^ self implementsKW, (self type separatedBy: $, asParser trim)
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   308
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   309
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   310
import
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   311
	^ self comment star, 'import' asParser trim, self statement.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   312
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   313
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   314
imports
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   315
	^ self import star
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   316
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   317
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   318
javaFile
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   319
	^ (self fileHeader, classDecl trim) foldLeft: [:header :c | c ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   320
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   321
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   322
javadoc
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   323
        ^ JavaDocParser  new trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   324
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   325
    "Modified: / 07-04-2011 / 22:06:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   326
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   327
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   328
methodArguments
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   329
	^ ($( asParser, self argumentList optional, $) asParser) trim foldLeft: [:a :args :b | args].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   330
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   331
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   332
methodBody
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   333
	^ self block.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   334
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   335
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   336
methodDecl
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   337
        ^ (    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   338
                self lineNumber,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   339
                self javadoc optional, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   340
                self methodModifiers optional, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   341
                self genericBlock optional,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   342
                self methodRetval, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   343
                self identifier, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   344
                self methodArguments,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   345
                self throwsStatement optional, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   346
                self methodBody optional) trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   347
                        foldLeft: [:startLine :javadoc :modifiers :generic :retval :name :arguments :throws :body | 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   348
                                JavaMethodDeclarationNode new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   349
                                        javadoc: javadoc;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   350
                                        modifiers: modifiers;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   351
                                        retval: retval;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   352
                                        methodName: name;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   353
                                        arguments: arguments;
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   354
                                        startLine: startLine
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   355
                        ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   356
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   357
    "Modified: / 29-12-2010 / 22:47:53 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   358
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   359
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   360
methodModifiers 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   361
	^ ('public' asParser / 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   362
	   'static' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   363
	   'abstract' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   364
	   'private'	asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   365
	   'protected' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   366
	   'native' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   367
	   'final' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   368
	   'synchronized' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   369
	   self annotation 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   370
	) trim star
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   371
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   372
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   373
methodRetval
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   374
	^ self type
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   375
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   376
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   377
multilineComment
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   378
        ^ MultilineCommentParser new trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   379
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   380
    "Modified: / 07-04-2011 / 22:03:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   381
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   382
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   383
nameToken
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   384
	^ #word asParser 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   385
	
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   386
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   387
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   388
oneLineComment
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   389
        ^ CommentParser new trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   390
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   391
    "Modified: / 07-04-2011 / 22:03:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   392
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   393
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   394
otherClassContent 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   395
	^ self statement.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   396
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   397
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   398
package
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   399
	^ 'package' asParser trim, self statement.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   400
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   401
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   402
primitiveType
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   403
	^ (	'int' asParser / 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   404
		'byte' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   405
		'boolean' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   406
		'float' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   407
		'double' asParser /
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   408
		'char' asParser 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   409
	) trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   410
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   411
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   412
reference
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   413
	^ self fullIdentifier 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   414
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   415
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   416
statement
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   417
        ^ StatementParser new trim ==> [: token | nil ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   418
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   419
    "Modified: / 30-12-2010 / 11:20:45 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   420
    "Modified: / 07-04-2011 / 22:05:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   421
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   422
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   423
staticInitializer 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   424
        ^ 'static' asParser trim, BlockParser new ==> [:token | nil]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   425
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   426
    "Modified: / 07-04-2011 / 21:47:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   427
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   428
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   429
throwsStatement 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   430
	^ self throwsKW, (self identifier separatedBy: $, asParser trim)
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   431
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   432
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   433
type
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   434
	^ 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   435
	(
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   436
		('void' asParser / self primitiveType / self reference) trim, 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   437
		 self genericBlock optional,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   438
		'[]' asParser optional
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   439
	) 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   440
	flatten 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   441
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   442
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   443
typeIdentifier 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   444
	^ self identifier 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   445
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   446
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   447
!JavaParser methodsFor:'keywords'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   448
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   449
classKW
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   450
	^ 'class' asParser trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   451
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   452
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   453
extendsKW
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   454
	^ 'extends' asParser trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   455
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   456
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   457
finalKW
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   458
	^ 'final' asParser trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   459
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   460
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   461
implementsKW
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   462
	^ 'implements' asParser trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   463
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   464
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   465
interfaceKW
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   466
	^ 'interface' asParser trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   467
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   468
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   469
threeDotsKW
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   470
	^ '...' asParser trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   471
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   472
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   473
throwsKW
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   474
	^ 'throws' asParser trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   475
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   476
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   477
voidKW
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   478
	^ 'void' asParser trim
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   479
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   480
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   481
!JavaParser methodsFor:'parsing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   482
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   483
parseOn: ppStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   484
    ^ super parseOn: (LineNumberStream on: ppStream collection).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   485
"/    ^ super parseOn: ppStream.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   486
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   487
    "Created: / 29-12-2010 / 22:35:30 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   488
    "Modified: / 30-12-2010 / 10:01:20 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   489
    "Modified: / 07-04-2011 / 22:06:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   490
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   491
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   492
!JavaParser::BlockParser class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   493
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   494
version_SVN
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   495
    ^ '$Id$'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   496
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   497
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   498
!JavaParser::BlockParser methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   499
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   500
closeBlockChar: anObject
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   501
	closeBlockChar := anObject
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   502
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   503
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   504
openBlockChar: anObject
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   505
	openBlockChar := anObject
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   506
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   507
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   508
!JavaParser::BlockParser methodsFor:'initialization'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   509
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   510
initialize
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   511
	innerBlockCount := 0.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   512
	openBlockChar := ${.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   513
	closeBlockChar := $}.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   514
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   515
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   516
!JavaParser::BlockParser methodsFor:'parsing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   517
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   518
decInnerBlockCount
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   519
	innerBlockCount := innerBlockCount - 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   520
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   521
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   522
incInnerBlockCount
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   523
	innerBlockCount := innerBlockCount + 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   524
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   525
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   526
parseLoop: aStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   527
	| literal |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   528
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   529
	aStream atEnd ifFalse: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   530
	[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   531
		literal := aStream uncheckedPeek.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   532
		literal = openBlockChar  ifTrue: [ self incInnerBlockCount].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   533
		literal = closeBlockChar  ifTrue: [ self decInnerBlockCount].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   534
		aStream next.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   535
		^true
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   536
	].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   537
	^false
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   538
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   539
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   540
parseOn: aStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   541
	| literal |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   542
"	self halt.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   543
"	
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   544
	(self parseLoop: aStream) ifFalse: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   545
	[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   546
			^ PPFailure message: 'unexpected end of input' at: aStream position
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   547
	].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   548
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   549
	self zeroBlockCount ifTrue: [ ^ PPFailure message: ('expected ' copyWith: openBlockChar)  at: aStream position ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   550
	
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   551
	[self zeroBlockCount] whileFalse: [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   552
		(self parseLoop: aStream) ifFalse: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   553
		[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   554
			^ PPFailure message: 'unexpected end of input' at: aStream position
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   555
		]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   556
	].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   557
	^ nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   558
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   559
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   560
zeroBlockCount
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   561
	^ innerBlockCount = 0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   562
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   563
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   564
!JavaParser::CommentParser class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   565
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   566
version_SVN
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   567
    ^ '$Id$'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   568
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   569
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   570
!JavaParser::CommentParser methodsFor:'parsing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   571
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   572
parseOn: aStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   573
	| literal wasStar |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   574
	wasStar := false.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   575
	
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   576
	(aStream next: 2) = '//' ifFalse: [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   577
		^ PPFailure message: '// expected' at: aStream position.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   578
	].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   579
	
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   580
	[literal := aStream next.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   581
		literal = (Character cr) or: [ aStream atEnd ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   582
	] whileFalse.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   583
	
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   584
	^ nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   585
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   586
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   587
!JavaParser::MultilineCommentParser class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   588
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   589
version_SVN
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   590
    ^ '$Id$'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   591
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   592
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   593
!JavaParser::MultilineCommentParser methodsFor:'parsing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   594
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   595
checkStart: aStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   596
	^ (aStream next: self startSequence size) = self startSequence 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   597
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   598
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   599
parseOn: aStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   600
        | literal wasStar line |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   601
        wasStar := false.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   602
        line := aStream lineNumber.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   603
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   604
        (self checkStart: aStream) ifFalse:     [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   605
                 ^ PPFailure message: self startSequence, ' expected' at: aStream position.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   606
        ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   607
        
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   608
        [literal := aStream next.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   609
                aStream atEnd ifTrue: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   610
                [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   611
                        ^ PPFailure message: 'unexpected end of input' at: aStream position.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   612
                ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   613
        
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   614
                wasStar and: [literal = $/]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   615
        ] whileFalse: [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   616
                wasStar := literal = $*
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   617
        ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   618
        ^ PPBlockNode new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   619
            startLine: line
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   620
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   621
    "Modified: / 29-12-2010 / 21:29:26 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   622
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   623
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   624
startSequence 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   625
	^ '/*'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   626
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   627
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   628
!JavaParser::LineNumberParser class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   629
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   630
version_SVN
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   631
    ^ '$Id$'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   632
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   633
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   634
!JavaParser::LineNumberParser methodsFor:'parsing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   635
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   636
parseOn: aStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   637
    ^ aStream lineNumber.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   638
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   639
    "Created: / 29-12-2010 / 22:13:22 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   640
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   641
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   642
!JavaParser::LineNumberStream class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   643
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   644
version_SVN
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   645
    ^ '$Id$'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   646
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   647
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   648
!JavaParser::LineNumberStream class methodsFor:'initialization'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   649
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   650
initialize
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   651
    CR := Character cr.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   652
    Smalltalk isSmalltalkX ifTrue:[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   653
        CR := Character return.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   654
    ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   655
    LF := Character nl.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   656
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   657
    "Created: / 29-12-2010 / 23:11:17 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   658
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   659
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   660
!JavaParser::LineNumberStream methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   661
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   662
lineNumber
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   663
        | index start stop pos |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   664
        pos := position.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   665
        pos >= eolPositions last ifTrue: [^eolPositions size].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   666
        start := 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   667
        stop := eolPositions size.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   668
        [start + 1 < stop] whileTrue: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   669
                        [index := (start + stop) // 2.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   670
                        (eolPositions at: index) <= pos 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   671
                                ifTrue: [start := index]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   672
                                ifFalse: [stop := index]].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   673
        ^start
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   674
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   675
    "Created: / 30-12-2010 / 10:23:27 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   676
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   677
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   678
next
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   679
        | character |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   680
        character := super next.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   681
        position - 1 == lastPosition 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   682
                ifTrue: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   683
                        [ 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   684
"/                        self halt.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   685
                        lastPosition := lastPosition + 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   686
                        character == CR 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   687
                                ifTrue: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   688
                                        [eolPositions add: position.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   689
                                        previousWasCR := true]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   690
                                ifFalse: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   691
                                        [(previousWasCR not and: [character == LF]) 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   692
                                                ifTrue: [eolPositions add: position].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   693
                                        previousWasCR := false]].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   694
        ^character
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   695
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   696
    "Modified: / 30-12-2010 / 10:55:09 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   697
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   698
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   699
next: anInteger 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   700
    "Override for positioning purposes"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   701
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   702
    | answer num |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   703
    num:= readLimit - position min: anInteger.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   704
    answer := OrderedCollection new: num.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   705
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   706
    num timesRepeat: [ 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   707
        answer add: self next.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   708
    ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   709
    ^ answer asString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   710
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   711
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   712
"/        | answer endPosition |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   713
"/        endPosition := position + anInteger min: readLimit.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   714
"/        answer := collection copyFrom: position + 1 to: endPosition.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   715
"/        position := endPosition.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   716
"/        ^ answer
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   717
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   718
    "Modified: / 30-12-2010 / 10:57:37 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   719
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   720
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   721
uncheckedPeek
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   722
	"An unchecked version of peek that throws an error if we try to peek over the end of the stream, even faster than #peek."
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   723
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   724
	^ collection at: position + 1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   725
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   726
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   727
!JavaParser::LineNumberStream methodsFor:'converting'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   728
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   729
asPetitStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   730
	^ self
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   731
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   732
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   733
!JavaParser::LineNumberStream methodsFor:'initialization'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   734
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   735
initialize
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   736
        eolPositions := OrderedCollection with: ZeroPosition.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   737
        lastPosition := ZeroPosition.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   738
        previousWasCR := false
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   739
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   740
    "Created: / 30-12-2010 / 10:22:41 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   741
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   742
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   743
on: aCollection
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   744
    super on: aCollection.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   745
    eolPositions := OrderedCollection with: ZeroPosition.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   746
    lastPosition := ZeroPosition.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   747
    previousWasCR := false
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   748
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   749
    "Created: / 30-12-2010 / 10:26:17 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   750
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   751
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   752
!JavaParser::LineNumberStream methodsFor:'printing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   753
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   754
printOn: aStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   755
	collection isString
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   756
		ifFalse: [ ^ super printOn: aStream ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   757
	aStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   758
		nextPutAll: (collection copyFrom: 1 to: position);
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   759
		nextPutAll: '·';
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   760
		nextPutAll: (collection copyFrom: position + 1 to: readLimit)
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   761
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   762
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   763
!JavaParser::JavaDocParser class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   764
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   765
version_SVN
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   766
    ^ '$Id$'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   767
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   768
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   769
!JavaParser::JavaDocParser methodsFor:'parsing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   770
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   771
parseOn: aStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   772
    | blockNode |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   773
    blockNode := super parseOn: aStream.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   774
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   775
    blockNode isPetitFailure ifTrue:    [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   776
        ^ blockNode.    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   777
    ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   778
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   779
    ^ JavadocDeclarationNode new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   780
        startLine: blockNode startLine.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   781
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   782
    "Created: / 29-12-2010 / 21:22:42 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   783
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   784
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   785
startSequence 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   786
	^ '/**'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   787
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   788
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   789
!JavaParser::StatementParser class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   790
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   791
version_SVN
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   792
    ^ '$Id$'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   793
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   794
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   795
!JavaParser::StatementParser methodsFor:'parsing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   796
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   797
parseOn: aStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   798
	| literal |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   799
	[literal = $;] whileFalse: [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   800
		aStream atEnd ifFalse: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   801
		[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   802
			literal := aStream uncheckedPeek.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   803
			aStream next.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   804
		]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   805
		ifTrue: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   806
		[
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   807
			^ PPFailure message: 'unexpected end of input' at: aStream position.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   808
		].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   809
	
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   810
		"TODO JK: This will cause problems - sooner or later"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   811
		(literal = $}) ifTrue: [ ^
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   812
			PPFailure message: 'cannot parser $}' at: aStream position.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   813
		].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   814
	].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   815
	^ nil
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   816
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   817
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   818
!JavaParser class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   819
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   820
version_SVN
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   821
    ^ '$Id$'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   822
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   823
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   824
JavaParser::LineNumberStream initialize!