PPFailure.st
author sr
Thu, 05 Jul 2018 09:23:25 +0200
changeset 626 5159b1039a8f
parent 45 ca9fad0faa21
child 377 6112a403a52d
permissions -rw-r--r--
order

"{ Package: 'stx:goodies/petitparser' }"

Object subclass:#PPFailure
	instanceVariableNames:'message position'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitParser-Core'
!


!PPFailure class methodsFor:'instance creation'!

message: aString at: anInteger
	^ self basicNew initializeMessage: aString at: anInteger
! !

!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 at: anInteger
	message := aString.
	position := anInteger
! !

!PPFailure methodsFor:'printing'!

printOn: aStream
	aStream nextPutAll: self message; nextPutAll: ' at '; print: 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 §'
! !