author | Claus Gittinger <cg@exept.de> |
Fri, 26 Oct 2012 11:48:52 +0200 | |
changeset 2958 | 4bb6acd04cfe |
parent 2853 | fab783ff128b |
child 3269 | 812d7cd10746 |
permissions | -rw-r--r-- |
1570 | 1 |
" |
2 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1532 | 12 |
"{ Package: 'stx:libcomp' }" |
13 |
||
2547
55ec27b3306c
ParserErrorNode now inherits from ParseNode
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
14 |
ParseNode subclass:#ParseErrorNode |
2853 | 15 |
instanceVariableNames:'errorString errorToken' |
1532 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
18 |
category:'System-Compiler-Support' |
|
19 |
! |
|
20 |
||
1570 | 21 |
!ParseErrorNode class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! ! |
|
1532 | 36 |
|
37 |
!ParseErrorNode class methodsFor:'instance creation'! |
|
38 |
||
39 |
errorString:arg |
|
40 |
^ self new errorString:arg |
|
41 |
! ! |
|
42 |
||
43 |
!ParseErrorNode methodsFor:'accessing'! |
|
44 |
||
45 |
errorString |
|
46 |
^ errorString |
|
47 |
! |
|
48 |
||
49 |
errorString:something |
|
50 |
errorString := something. |
|
2549 | 51 |
! |
52 |
||
2853 | 53 |
errorToken |
54 |
||
55 |
^errorToken |
|
56 |
||
57 |
"Created: / 27-11-2011 / 09:25:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
58 |
! |
|
59 |
||
60 |
errorToken:something |
|
61 |
||
62 |
errorToken := something |
|
63 |
||
64 |
"Created: / 27-11-2011 / 09:25:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
65 |
! |
|
66 |
||
2549 | 67 |
lineNumber |
68 |
||
69 |
^self objectAttributeAt: #lineNumber |
|
70 |
||
71 |
"Created: / 09-07-2011 / 22:30:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
72 |
! |
|
73 |
||
74 |
lineNumber: anInteger |
|
75 |
||
76 |
self objectAttributeAt: #lineNumber put: anInteger |
|
77 |
||
78 |
"Created: / 09-07-2011 / 22:29:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1532 | 79 |
! ! |
80 |
||
2853 | 81 |
|
82 |
!ParseErrorNode methodsFor:'printing & storing'! |
|
83 |
||
84 |
printOn:aStream indent:indent |
|
85 |
"append a user printed representation of the receiver to aStream. |
|
86 |
The format is suitable for a human - not meant to be read back." |
|
87 |
||
88 |
aStream next: indent put: Character tab. |
|
89 |
errorToken notNil ifTrue:[ |
|
90 |
aStream nextPutAll: errorToken |
|
91 |
] ifFalse: [ |
|
92 |
aStream nextPutAll:'"<< parse error here >>"' |
|
93 |
] |
|
94 |
||
95 |
"Created: / 20-04-2005 / 14:21:46 / cg" |
|
96 |
"Modified: / 08-03-2012 / 20:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
97 |
! ! |
|
98 |
||
1532 | 99 |
!ParseErrorNode methodsFor:'queries'! |
100 |
||
101 |
isErrorNode |
|
102 |
^ true |
|
103 |
! ! |
|
104 |
||
2594 | 105 |
!ParseErrorNode methodsFor:'visiting'! |
106 |
||
107 |
acceptVisitor:aVisitor |
|
108 |
"Double dispatch back to the visitor, passing my type encoded in |
|
109 |
the selector (visitor pattern)" |
|
110 |
||
111 |
"stub code automatically generated - please change if required" |
|
112 |
||
113 |
^ aVisitor visitParseErrorNode:self |
|
114 |
! ! |
|
115 |
||
1532 | 116 |
!ParseErrorNode class methodsFor:'documentation'! |
117 |
||
118 |
version |
|
2853 | 119 |
^ '$Header: /cvs/stx/stx/libcomp/ParseErrorNode.st,v 1.6 2012-03-09 07:48:24 vrany Exp $' |
2549 | 120 |
! |
121 |
||
122 |
version_CVS |
|
2853 | 123 |
^ '$Header: /cvs/stx/stx/libcomp/ParseErrorNode.st,v 1.6 2012-03-09 07:48:24 vrany Exp $' |
1532 | 124 |
! ! |