author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 06 Jul 2015 08:03:53 +0100 | |
changeset 38 | 7654e5bd9818 |
parent 33 | f87d54770abe |
child 40 | 7d1e77b6115e |
permissions | -rw-r--r-- |
32
d7464405cbda
Package renamed from cvut:fel/cface to jv:cface
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
1 |
"{ Package: 'jv:cface' }" |
1 | 2 |
|
3 |
"{ NameSpace: Cface }" |
|
4 |
||
5 |
CNodeVisitor subclass:#TypeResolver |
|
6 |
instanceVariableNames:'typeMap' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'Cface-Visitors' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!TypeResolver methodsFor:'accessing'! |
|
14 |
||
15 |
typeMap |
|
16 |
^ typeMap |
|
17 |
||
18 |
"Created: / 12-02-2008 / 23:44:35 / janfrog" |
|
19 |
! |
|
20 |
||
21 |
typeMap:something |
|
22 |
typeMap := something. |
|
23 |
||
24 |
"Created: / 12-02-2008 / 23:44:35 / janfrog" |
|
25 |
! ! |
|
26 |
||
27 |
!TypeResolver methodsFor:'processing'! |
|
28 |
||
29 |
process: aCNode |
|
30 |
||
31 |
typeMap := TypeCollector new |
|
32 |
process: aCNode; |
|
33 |
typeMap. |
|
34 |
^super process: aCNode |
|
35 |
||
36 |
"Created: / 12-02-2008 / 23:48:03 / janfrog" |
|
37 |
! ! |
|
38 |
||
39 |
!TypeResolver methodsFor:'visiting'! |
|
40 |
||
24 | 41 |
visitCTypedefNode: anObject |
42 |
||
43 |
anObject type isCUserDefinedTypeNode ifTrue:[ |
|
44 |
| realType | |
|
45 |
||
46 |
realType := typeMap at: anObject type cName ifAbsent:[nil]. |
|
47 |
realType notNil ifTrue:[ |
|
48 |
self visit: realType. |
|
49 |
anObject type: realType. |
|
50 |
]. |
|
51 |
] |
|
52 |
||
53 |
"Created: / 05-09-2012 / 11:37:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
54 |
! |
|
55 |
||
1 | 56 |
visitCUserDefinedTypeNode: anObject |
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
57 |
"/thisContext isRecursive ifTrue:[^self]. |
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
58 |
|
38
7654e5bd9818
During type resolution, do not REPLACE the type with it's resolved type.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
33
diff
changeset
|
59 |
anObject type isNil ifTrue:[ |
7654e5bd9818
During type resolution, do not REPLACE the type with it's resolved type.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
33
diff
changeset
|
60 |
|type| |
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
61 |
|
38
7654e5bd9818
During type resolution, do not REPLACE the type with it's resolved type.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
33
diff
changeset
|
62 |
type := (typeMap at: anObject cName ifAbsent:[CPointerNode new type: CVoidNode new]). |
7654e5bd9818
During type resolution, do not REPLACE the type with it's resolved type.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
33
diff
changeset
|
63 |
self visit: type. |
7654e5bd9818
During type resolution, do not REPLACE the type with it's resolved type.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
33
diff
changeset
|
64 |
anObject type: type |
7654e5bd9818
During type resolution, do not REPLACE the type with it's resolved type.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
33
diff
changeset
|
65 |
] |
1 | 66 |
|
67 |
"Created: / 12-02-2008 / 23:45:17 / janfrog" |
|
68 |
"Modified: / 17-02-2008 / 18:30:56 / janfrog" |
|
5
c110eef5b9ef
- externalization of libraryName (now supports unix & win32 simultaneously)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4
diff
changeset
|
69 |
"Modified: / 09-07-2008 / 20:53:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
38
7654e5bd9818
During type resolution, do not REPLACE the type with it's resolved type.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
33
diff
changeset
|
70 |
"Modified: / 06-07-2015 / 08:01:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1 | 71 |
! ! |
72 |
||
73 |
!TypeResolver class methodsFor:'documentation'! |
|
74 |
||
75 |
version |
|
19
1297bf936bfb
Some fixes for modern GCC XML
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
76 |
^ '$Id$' |
14 | 77 |
! |
78 |
||
33
f87d54770abe
Minor fixes for recent Smalltalk/X
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
79 |
version_HG |
f87d54770abe
Minor fixes for recent Smalltalk/X
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
80 |
|
f87d54770abe
Minor fixes for recent Smalltalk/X
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
81 |
^ '$Changeset: <not expanded> $' |
f87d54770abe
Minor fixes for recent Smalltalk/X
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
82 |
! |
f87d54770abe
Minor fixes for recent Smalltalk/X
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
83 |
|
14 | 84 |
version_SVN |
85 |
^ '$Id$' |
|
1 | 86 |
! ! |
33
f87d54770abe
Minor fixes for recent Smalltalk/X
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
32
diff
changeset
|
87 |