author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 06 Jul 2015 22:28:52 +0100 | |
changeset 40 | 7d1e77b6115e |
parent 39 | 5ff8fcdb5228 |
permissions | -rw-r--r-- |
32
d7464405cbda
Package renamed from cvut:fel/cface to jv:cface
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
1 |
"{ Package: 'jv:cface' }" |
1 | 2 |
|
3 |
"{ NameSpace: Cface }" |
|
4 |
||
5 |
CNodeVisitor subclass:#TypeMapper |
|
6 |
instanceVariableNames:'mappings' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'Cface-Visitors' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!TypeMapper class methodsFor:'processing'! |
|
14 |
||
15 |
process: cNode |
|
16 |
||
17 |
self error:'Use #process:using: instead' |
|
18 |
||
19 |
"Created: / 17-02-2008 / 20:56:59 / janfrog" |
|
20 |
! |
|
21 |
||
22 |
process: cNode using: mappings |
|
23 |
||
24 |
self new mappings: mappings process: cNode |
|
25 |
||
26 |
"Created: / 17-02-2008 / 20:57:22 / janfrog" |
|
27 |
"Modified: / 18-02-2008 / 15:32:31 / janfrog" |
|
28 |
! ! |
|
29 |
||
30 |
!TypeMapper methodsFor:'accessing'! |
|
31 |
||
32 |
mappings |
|
33 |
^ mappings |
|
34 |
||
35 |
"Created: / 17-02-2008 / 20:58:30 / janfrog" |
|
36 |
! |
|
37 |
||
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
38 |
mappings:aTypeMapping |
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
39 |
mappings := aTypeMapping. |
1 | 40 |
|
41 |
"Created: / 17-02-2008 / 20:58:30 / janfrog" |
|
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
42 |
"Modified: / 10-07-2008 / 08:01:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 43 |
! ! |
44 |
||
45 |
!TypeMapper methodsFor:'processing'! |
|
46 |
||
47 |
process: definitions |
|
48 |
||
49 |
mappings ifNil:[^self error:'No mappings provided!!']. |
|
11 | 50 |
mappings definitions: definitions. |
1 | 51 |
super process: definitions |
52 |
||
53 |
"Created: / 18-02-2008 / 15:33:19 / janfrog" |
|
11 | 54 |
"Modified: / 22-02-2009 / 22:16:45 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 55 |
! |
56 |
||
57 |
process: definitions using: givenMappings |
|
58 |
||
59 |
self mappings: givenMappings. |
|
60 |
self process: definitions |
|
61 |
||
62 |
"Created: / 18-02-2008 / 15:34:07 / janfrog" |
|
63 |
! ! |
|
64 |
||
65 |
!TypeMapper methodsFor:'visiting'! |
|
66 |
||
11 | 67 |
visitCEnumNode:cEnum |
68 |
||
69 |
cEnum shouldBeIgnored ifFalse:[ |
|
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
70 |
cEnum |
6
ae25dce94003
Added SVNMapping. Now it is able to parse libsvn.def
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
71 |
smalltalkNamespace:(mappings smalltalkNamespaceForEnum: cEnum); |
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
72 |
smalltalkPackage:(mappings smalltalkPackage); |
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
73 |
smalltalkClassName:(mappings smalltalkClassNameForEnum:cEnum); |
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
74 |
smalltalkCategory: (mappings smalltalkCategoryForEnum: cEnum) |
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
75 |
]. |
11 | 76 |
super visitCEnumNode:cEnum. |
77 |
cEnum shouldBeIgnored ifFalse: |
|
78 |
[cEnum ignore: (mappings shouldIgnoreEnum: cEnum)]. |
|
1 | 79 |
|
80 |
"Created: / 17-02-2008 / 20:58:53 / janfrog" |
|
81 |
"Modified: / 17-02-2008 / 22:24:58 / janfrog" |
|
11 | 82 |
"Modified: / 22-02-2009 / 22:14:09 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 83 |
! |
84 |
||
4
fc74bd43a3eb
Minor parser fixes to parse Cairo Xlib stuff
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
85 |
visitCEnumValueNode:cEnum |
1 | 86 |
cEnum |
4
fc74bd43a3eb
Minor parser fixes to parse Cairo Xlib stuff
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
87 |
smalltalkName:(mappings smalltalkNameForEnumValue:cEnum). |
fc74bd43a3eb
Minor parser fixes to parse Cairo Xlib stuff
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
88 |
super visitCEnumValueNode:cEnum |
1 | 89 |
|
90 |
"Created: / 17-02-2008 / 21:02:21 / janfrog" |
|
4
fc74bd43a3eb
Minor parser fixes to parse Cairo Xlib stuff
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
91 |
"Modified: / 04-07-2008 / 11:33:06 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 92 |
! |
93 |
||
11 | 94 |
visitCFunctionNode:cFunction |
95 |
||
1 | 96 |
cFunction |
11 | 97 |
kind:(mappings kindForFunction:cFunction); |
98 |
smalltalkNamespace:(mappings smalltalkNamespaceForFunction: cFunction); |
|
99 |
smalltalkClassName:(mappings smalltalkClassNameForFunction:cFunction); |
|
100 |
smalltalkSelector:(mappings smalltalkSelectorForFunction:cFunction). |
|
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
101 |
super visitCFunctionNode:cFunction |
1 | 102 |
|
103 |
"Created: / 17-02-2008 / 22:10:44 / janfrog" |
|
11 | 104 |
"Modified: / 22-02-2009 / 22:14:23 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 105 |
! |
106 |
||
107 |
visitCStructFieldNode: cEnum |
|
108 |
||
109 |
cEnum |
|
110 |
smalltalkName: (mappings smalltalkNameForStructField: cEnum). |
|
111 |
super visitCStructFieldNode: cEnum |
|
112 |
||
113 |
"Created: / 17-02-2008 / 21:22:53 / janfrog" |
|
114 |
! |
|
115 |
||
11 | 116 |
visitCStructNode:cStruct |
117 |
||
118 |
||
119 |
cStruct shouldBeIgnored ifFalse:[ |
|
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
120 |
cStruct |
6
ae25dce94003
Added SVNMapping. Now it is able to parse libsvn.def
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
121 |
smalltalkNamespace:(mappings smalltalkNamespaceForStruct: cStruct); |
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
122 |
smalltalkPackage:(mappings smalltalkPackage); |
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
123 |
smalltalkClassName:(mappings smalltalkClassNameForStruct:cStruct); |
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
124 |
smalltalkCategory: (mappings smalltalkCategoryForStruct: cStruct) |
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
125 |
]. |
11 | 126 |
super visitCStructNode:cStruct. |
127 |
cStruct shouldBeIgnored ifFalse: |
|
128 |
[cStruct ignore: (mappings shouldIgnoreStruct: cStruct)]. |
|
1 | 129 |
|
130 |
"Created: / 17-02-2008 / 21:12:55 / janfrog" |
|
131 |
"Modified: / 17-02-2008 / 22:24:51 / janfrog" |
|
11 | 132 |
"Modified: / 22-02-2009 / 22:14:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 133 |
! |
134 |
||
39
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
135 |
visitCTypedefNode:cTypedefNode |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
136 |
|
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
137 |
cTypedefNode shouldBeIgnored ifFalse:[ |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
138 |
cTypedefNode |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
139 |
smalltalkNamespace:(mappings smalltalkNamespaceForTypedef: cTypedefNode); |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
140 |
smalltalkPackage:(mappings smalltalkPackage); |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
141 |
smalltalkClassName:(mappings smalltalkClassNameForTypedef:cTypedefNode); |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
142 |
smalltalkCategory: (mappings smalltalkCategoryForTypedef: cTypedefNode) |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
143 |
]. |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
144 |
super visitCTypedefNode:cTypedefNode. |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
145 |
cTypedefNode shouldBeIgnored ifFalse: |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
146 |
[cTypedefNode ignore: (mappings shouldIgnoreTypedef: cTypedefNode)]. |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
147 |
|
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
148 |
"Created: / 06-07-2015 / 11:35:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
149 |
! |
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
150 |
|
11 | 151 |
visitCUnionNode:cUnion |
152 |
||
153 |
||
154 |
cUnion shouldBeIgnored ifFalse:[ |
|
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
155 |
cUnion |
6
ae25dce94003
Added SVNMapping. Now it is able to parse libsvn.def
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
156 |
smalltalkNamespace:(mappings smalltalkNamespaceForUnion: cUnion); |
11 | 157 |
smalltalkPackage: (mappings smalltalkPackage); |
158 |
smalltalkClassName:(mappings smalltalkClassNameForUnion:cUnion); |
|
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
159 |
smalltalkCategory: (mappings smalltalkCategoryForUnion: cUnion) |
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
160 |
]. |
11 | 161 |
super visitCUnionNode:cUnion. |
162 |
cUnion shouldBeIgnored ifFalse: |
|
163 |
[cUnion ignore: (mappings shouldIgnoreUnion: cUnion)]. |
|
1 | 164 |
|
165 |
"Created: / 17-02-2008 / 22:25:27 / janfrog" |
|
11 | 166 |
"Modified: / 22-02-2009 / 22:14:52 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 167 |
! ! |
168 |
||
169 |
!TypeMapper class methodsFor:'documentation'! |
|
170 |
||
171 |
version |
|
19
1297bf936bfb
Some fixes for modern GCC XML
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
172 |
^ '$Id$' |
14 | 173 |
! |
174 |
||
175 |
version_SVN |
|
176 |
^ '$Id$' |
|
1 | 177 |
! ! |
39
5ff8fcdb5228
Added support for generating classes for typedef'd types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
178 |