4
|
1 |
"{ Package: 'stx:goodies/petitparser' }"
|
0
|
2 |
|
|
3 |
Object subclass:#PPFailure
|
|
4 |
instanceVariableNames:'message position'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'PetitParser-Core'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!PPFailure class methodsFor:'instance creation'!
|
|
12 |
|
|
13 |
message: aString at: anInteger
|
|
14 |
^ self basicNew initializeMessage: aString at: anInteger
|
|
15 |
! !
|
|
16 |
|
|
17 |
!PPFailure methodsFor:'accessing'!
|
|
18 |
|
|
19 |
message
|
|
20 |
"Answer a human readable error message of this parse failure."
|
45
|
21 |
|
0
|
22 |
^ message
|
|
23 |
!
|
|
24 |
|
|
25 |
position
|
|
26 |
"Answer the position in the source string that caused this parse failure."
|
|
27 |
|
|
28 |
^ position
|
|
29 |
! !
|
|
30 |
|
|
31 |
!PPFailure methodsFor:'initialization'!
|
|
32 |
|
|
33 |
initializeMessage: aString at: anInteger
|
|
34 |
message := aString.
|
|
35 |
position := anInteger
|
|
36 |
! !
|
|
37 |
|
|
38 |
!PPFailure methodsFor:'printing'!
|
|
39 |
|
|
40 |
printOn: aStream
|
|
41 |
aStream nextPutAll: self message; nextPutAll: ' at '; print: position
|
|
42 |
! !
|
|
43 |
|
|
44 |
!PPFailure methodsFor:'testing'!
|
|
45 |
|
|
46 |
isPetitFailure
|
|
47 |
"I am the only class that should implement this method to return true."
|
|
48 |
|
|
49 |
^ true
|
|
50 |
! !
|
|
51 |
|
|
52 |
!PPFailure class methodsFor:'documentation'!
|
|
53 |
|
45
|
54 |
version
|
|
55 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPFailure.st,v 1.3 2012-05-04 22:08:15 vrany Exp $'
|
|
56 |
!
|
|
57 |
|
|
58 |
version_CVS
|
|
59 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPFailure.st,v 1.3 2012-05-04 22:08:15 vrany Exp $'
|
|
60 |
!
|
|
61 |
|
0
|
62 |
version_SVN
|
45
|
63 |
^ '§Id: PPFailure.st 2 2010-12-17 18:44:23Z vranyj1 §'
|
0
|
64 |
! !
|