Cface__CStructuredNode.st
changeset 28 6a2e82ddbca1
parent 24 e7afa531abcf
child 32 d7464405cbda
--- a/Cface__CStructuredNode.st	Fri Sep 07 23:35:53 2012 +0000
+++ b/Cface__CStructuredNode.st	Mon Sep 10 10:23:27 2012 +0000
@@ -3,7 +3,7 @@
 "{ NameSpace: Cface }"
 
 CDerivedTypeNode subclass:#CStructuredNode
-	instanceVariableNames:'cByteSize fields'
+	instanceVariableNames:'cBitSize fields ffiPointerTypeSymbol'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Cface-C AST'
@@ -12,20 +12,38 @@
 
 !CStructuredNode methodsFor:'accessing'!
 
+cBitSize
+    ^ cBitSize
+
+    "Created: / 10-09-2012 / 10:02:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+cBitSize:anInteger
+    cBitSize := anInteger
+
+    "Created: / 10-09-2012 / 10:01:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 cByteSize
-    ^ cByteSize
+    ^ cBitSize // 8
 
     "Created: / 09-09-2008 / 16:49:58 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 10-09-2012 / 10:02:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 cByteSize:anInteger
-    cByteSize := anInteger.
+    cBitSize := anInteger * 8
 
     "Created: / 09-09-2008 / 16:49:58 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 10-09-2012 / 10:02:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 ffiPointerTypeSymbol
 
+    ffiPointerTypeSymbol notNil ifTrue:[
+        ^ffiPointerTypeSymbol
+    ].
+
     ^smalltalkName notNil ifTrue:[
         self smalltalkClassNameWithNamespace
     ] ifFalse:[
@@ -35,6 +53,10 @@
     "Created: / 18-07-2011 / 16:44:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+ffiPointerTypeSymbol:aSymbol
+    ffiPointerTypeSymbol := aSymbol.
+!
+
 ffiTypeSymbol
 
     ^ self shouldNotImplement