|
1 "{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" |
|
2 |
|
3 "{ NameSpace: Smalltalk }" |
|
4 |
|
5 PPCLRPContainedElement subclass:#PPCLRPTransition |
|
6 instanceVariableNames:'name from to eventname arrowRange keywordEnd' |
|
7 classVariableNames:'' |
|
8 poolDictionaries:'' |
|
9 category:'PetitCompiler-Extras-Tests-LRP' |
|
10 ! |
|
11 |
|
12 !PPCLRPTransition class methodsFor:'instance creation'! |
|
13 |
|
14 on: anEvent from: startState to: endState name: aString |
|
15 |retval| |
|
16 retval := self new. |
|
17 retval eventname: anEvent. |
|
18 retval from: startState. |
|
19 retval to: endState. |
|
20 retval name: aString. |
|
21 ^ retval. |
|
22 ! ! |
|
23 |
|
24 !PPCLRPTransition methodsFor:'accessing'! |
|
25 |
|
26 arrowRange |
|
27 arrowRange ifNil: [ self halt: 'Error in setting up range info for styling' ]. |
|
28 ^ arrowRange |
|
29 ! |
|
30 |
|
31 arrowRange: anObject |
|
32 arrowRange := anObject |
|
33 ! |
|
34 |
|
35 eventname |
|
36 ^ eventname |
|
37 ! |
|
38 |
|
39 eventname: anObject |
|
40 eventname := anObject |
|
41 ! |
|
42 |
|
43 from |
|
44 ^ from |
|
45 ! |
|
46 |
|
47 from: anObject |
|
48 from := anObject |
|
49 ! |
|
50 |
|
51 identifier |
|
52 ^self className , self from , self to , self name. |
|
53 ! |
|
54 |
|
55 keywordEnd |
|
56 ^ keywordEnd |
|
57 ! |
|
58 |
|
59 keywordEnd: anObject |
|
60 keywordEnd := anObject |
|
61 ! |
|
62 |
|
63 name |
|
64 ^ name |
|
65 ! |
|
66 |
|
67 name: anObject |
|
68 name := anObject |
|
69 ! |
|
70 |
|
71 to |
|
72 ^ to |
|
73 ! |
|
74 |
|
75 to: anObject |
|
76 to := anObject |
|
77 ! ! |
|
78 |
|
79 !PPCLRPTransition methodsFor:'printing'! |
|
80 |
|
81 printOn: aStream |
|
82 |
|
83 aStream nextPutAll: 'PPCLRPTransition '. |
|
84 aStream nextPutAll: self name. |
|
85 aStream nextPutAll: ' : '. |
|
86 aStream nextPutAll: self from. |
|
87 aStream nextPutAll: '->'. |
|
88 aStream nextPutAll: self to. |
|
89 aStream nextPutAll: ' on '. |
|
90 aStream nextPutAll: self eventname. |
|
91 |
|
92 ! ! |
|
93 |
|
94 !PPCLRPTransition methodsFor:'visiting'! |
|
95 |
|
96 acceptVisitor: aPPCLRPNodeVisitor |
|
97 aPPCLRPNodeVisitor visitTransitionNode: self. |
|
98 ! ! |
|
99 |