Ignore tests in MemberVisibilityTests (package-private methods not yet supported)
"{ Package: 'stx:libjava/tools' }"
PPParser subclass:#JavaTokenParser
instanceVariableNames:'tokenType'
classVariableNames:''
poolDictionaries:''
category:'Languages-Java-Parser'
!
!JavaTokenParser class methodsFor:'instance creation'!
for: tokenType
^self new tokenType: tokenType
"Created: / 14-03-2012 / 23:10:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaTokenParser methodsFor:'accessing'!
tokenType
^ tokenType
!
tokenType:something
tokenType := something.
! !
!JavaTokenParser methodsFor:'parsing'!
parseOn:aJavaScanner
"Parse aStream with the receiving parser and answer the parse-result or an instance of PPFailure.
Override this method in subclasses to specify custom parse behavior. Do not call this method from outside,
instead use #parse:."
| pos |
pos := aJavaScanner position.
^(aJavaScanner nextToken = tokenType) ifTrue:[
aJavaScanner token
] ifFalse:[
aJavaScanner position: pos.
PPFailure message: (tokenType printString , ' token expected (got ', aJavaScanner tokenType , ' {',(aJavaScanner tokenValue ? '<nil>') printString,'})') at: aJavaScanner position
]
"Modified: / 17-03-2012 / 13:34:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaTokenParser class methodsFor:'documentation'!
version_SVN
^ '$Id$'
! !