Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Name: PetitCompiler-JanKurs.118
Author: JanKurs
Time: 13-05-2015, 03:59:01.292 PM
UUID: 4a8ccd94-3131-4cc7-9098-528f8e5ea0b5
Name: PetitCompiler-Tests-JanKurs.46
Author: JanKurs
Time: 04-05-2015, 04:25:06.162 PM
UUID: 9f4cf8b7-876e-4a13-9579-b833f016db66
Name: PetitCompiler-Extras-Tests-JanKurs.11
Author: JanKurs
Time: 13-05-2015, 04:27:27.940 PM
UUID: e9f30c31-fbd0-4e96-ad2a-868f88d20ea8
Name: PetitCompiler-Benchmarks-JanKurs.11
Author: JanKurs
Time: 13-05-2015, 02:21:49.932 PM
UUID: 6a23fd1e-a86f-46db-8221-cc41b778d32c
"{ Package: 'stx:goodies/petitparser' }"
Object subclass:#PPFailure
instanceVariableNames:'message context position'
classVariableNames:''
poolDictionaries:''
category:'PetitParser-Core'
!
!PPFailure class methodsFor:'instance creation'!
message: aString
^ self basicNew initializeMessage: aString
!
message: aString at: anInteger
"One should not use this method if the furthest failure is supposed to be reported correctly"
^ self basicNew initializeMessage: aString at: anInteger
!
message: aString context: aPPContext
^ self basicNew initializeMessage: aString context: aPPContext
!
message: aString context: aPPContext at: position
^ self basicNew initializeMessage: aString context: aPPContext position: position
! !
!PPFailure methodsFor:'accessing'!
message
"Answer a human readable error message of this parse failure."
^ message
!
position
"Answer the position in the source string that caused this parse failure."
^ position
! !
!PPFailure methodsFor:'initialization'!
initializeMessage: aString
message := aString.
!
initializeMessage: aString at: anInteger
"One should not use this method if the furthest failure is supposed to be reported correctly"
message := aString.
position := anInteger.
!
initializeMessage: aString context: aPPContext
self initializeMessage: aString context: aPPContext position: aPPContext position
!
initializeMessage: aString context: aPPContext position: anInteger
message := aString.
context := aPPContext.
position := anInteger.
"record the furthest failure encountered while parsing the input stream "
aPPContext noteFailure: self.
! !
!PPFailure methodsFor:'printing'!
printOn: aStream
aStream nextPutAll: self message; nextPutAll: ' at '; print: self position
! !
!PPFailure methodsFor:'testing'!
isPetitFailure
"I am the only class that should implement this method to return true."
^ true
! !
!PPFailure class methodsFor:'documentation'!
version
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPFailure.st,v 1.3 2012-05-04 22:08:15 vrany Exp $'
!
version_CVS
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPFailure.st,v 1.3 2012-05-04 22:08:15 vrany Exp $'
!
version_SVN
^ '§Id: PPFailure.st 2 2010-12-17 18:44:23Z vranyj1 §'
! !