Introduced a CBoolNode to model C99's _bool and map it to FFI's #bool type.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 14 Aug 2015 11:27:03 +0100
changeset 45 86de1611e013
parent 44 e698efa3708b
child 46 cc6b765ad420
Introduced a CBoolNode to model C99's _bool and map it to FFI's #bool type. This would allow to pass true and false directly to FFI callouts without need to convert it to 0 / 1 smallints.
Cface__CBoolNode.st
Cface__CDerivedTypeNode.st
Make.proto
Make.spec
abbrev.stc
bc.mak
jv_cface.st
libInit.cc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Cface__CBoolNode.st	Fri Aug 14 11:27:03 2015 +0100
@@ -0,0 +1,29 @@
+"{ Package: 'jv:cface' }"
+
+"{ NameSpace: Cface }"
+
+CIntNode subclass:#CBoolNode
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Cface-C AST'
+!
+
+!CBoolNode methodsFor:'accessing'!
+
+cName
+    "superclass Cface::CBuiltinNode says that I am responsible to implement this method"
+
+    ^ '_bool'
+
+    "Created: / 14-08-2015 / 11:17:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+ffiTypeSymbol
+    "superclass Cface::CTypeNode says that I am responsible to implement this method"
+
+    ^ #bool
+
+    "Created: / 14-08-2015 / 11:16:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- a/Cface__CDerivedTypeNode.st	Thu Aug 13 06:01:15 2015 +0100
+++ b/Cface__CDerivedTypeNode.st	Fri Aug 14 11:27:03 2015 +0100
@@ -166,6 +166,11 @@
     ^ '$Id$'
 !
 
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+!
+
 version_SVN
     ^ '$Id$'
 ! !
--- a/Make.proto	Thu Aug 13 06:01:15 2015 +0100
+++ b/Make.proto	Fri Aug 14 11:27:03 2015 +0100
@@ -195,6 +195,7 @@
 $(OUTDIR)Cface__CTypedefNode.$(O) Cface__CTypedefNode.$(H): Cface__CTypedefNode.st $(INCLUDE_TOP)/jv/cface/Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CDerivedTypeNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CTypeNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Cface__CVoidNode.$(O) Cface__CVoidNode.$(H): Cface__CVoidNode.st $(INCLUDE_TOP)/jv/cface/Cface__CBuiltinNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CTypeNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Cface__CWCharNode.$(O) Cface__CWCharNode.$(H): Cface__CWCharNode.st $(INCLUDE_TOP)/jv/cface/Cface__CBuiltinNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CTypeNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Cface__CBoolNode.$(O) Cface__CBoolNode.$(H): Cface__CBoolNode.st $(INCLUDE_TOP)/jv/cface/Cface__CBuiltinNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CIntNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CTypeNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Cface__CStructNode.$(O) Cface__CStructNode.$(H): Cface__CStructNode.st $(INCLUDE_TOP)/jv/cface/Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CDerivedTypeNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CStructuredNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CTypeNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Cface__CUnionNode.$(O) Cface__CUnionNode.$(H): Cface__CUnionNode.st $(INCLUDE_TOP)/jv/cface/Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CDerivedTypeNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CStructuredNode.$(H) $(INCLUDE_TOP)/jv/cface/Cface__CTypeNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Stream.$(H) $(STCHDR)
--- a/Make.spec	Thu Aug 13 06:01:15 2015 +0100
+++ b/Make.spec	Fri Aug 14 11:27:03 2015 +0100
@@ -99,6 +99,7 @@
 	Cface::CTypedefNode \
 	Cface::CVoidNode \
 	Cface::CWCharNode \
+	Cface::CBoolNode \
 	Cface::CStructNode \
 	Cface::CUnionNode \
 
@@ -154,6 +155,7 @@
     $(OUTDIR_SLASH)Cface__CTypedefNode.$(O) \
     $(OUTDIR_SLASH)Cface__CVoidNode.$(O) \
     $(OUTDIR_SLASH)Cface__CWCharNode.$(O) \
+    $(OUTDIR_SLASH)Cface__CBoolNode.$(O) \
     $(OUTDIR_SLASH)Cface__CStructNode.$(O) \
     $(OUTDIR_SLASH)Cface__CUnionNode.$(O) \
     $(OUTDIR_SLASH)extensions.$(O) \
--- a/abbrev.stc	Thu Aug 13 06:01:15 2015 +0100
+++ b/abbrev.stc	Fri Aug 14 11:27:03 2015 +0100
@@ -49,5 +49,6 @@
 Cface::CTypedefNode Cface__CTypedefNode jv:cface 'Cface-C AST' 0
 Cface::CVoidNode Cface__CVoidNode jv:cface 'Cface-C AST' 0
 Cface::CWCharNode Cface__CWCharNode jv:cface 'Cface-C AST' 0
+Cface::CBoolNode Cface__CBoolNode jv:cface 'Cface-C AST' 0
 Cface::CStructNode Cface__CStructNode jv:cface 'Cface-C AST' 0
 Cface::CUnionNode Cface__CUnionNode jv:cface 'Cface-C AST' 0
--- a/bc.mak	Thu Aug 13 06:01:15 2015 +0100
+++ b/bc.mak	Fri Aug 14 11:27:03 2015 +0100
@@ -120,6 +120,7 @@
 $(OUTDIR)Cface__CTypedefNode.$(O) Cface__CTypedefNode.$(H): Cface__CTypedefNode.st $(INCLUDE_TOP)\jv\cface\Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CDerivedTypeNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CTypeNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Cface__CVoidNode.$(O) Cface__CVoidNode.$(H): Cface__CVoidNode.st $(INCLUDE_TOP)\jv\cface\Cface__CBuiltinNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CTypeNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Cface__CWCharNode.$(O) Cface__CWCharNode.$(H): Cface__CWCharNode.st $(INCLUDE_TOP)\jv\cface\Cface__CBuiltinNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CTypeNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Cface__CBoolNode.$(O) Cface__CBoolNode.$(H): Cface__CBoolNode.st $(INCLUDE_TOP)\jv\cface\Cface__CBuiltinNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CIntNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CTypeNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Cface__CStructNode.$(O) Cface__CStructNode.$(H): Cface__CStructNode.st $(INCLUDE_TOP)\jv\cface\Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CDerivedTypeNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CStructuredNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CTypeNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Cface__CUnionNode.$(O) Cface__CUnionNode.$(H): Cface__CUnionNode.st $(INCLUDE_TOP)\jv\cface\Cface__CDefinitionNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CDerivedTypeNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CStructuredNode.$(H) $(INCLUDE_TOP)\jv\cface\Cface__CTypeNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Stream.$(H) $(STCHDR)
--- a/jv_cface.st	Thu Aug 13 06:01:15 2015 +0100
+++ b/jv_cface.st	Fri Aug 14 11:27:03 2015 +0100
@@ -124,6 +124,7 @@
         #'Cface::CTypedefNode'
         #'Cface::CVoidNode'
         #'Cface::CWCharNode'
+        #'Cface::CBoolNode'
         #'Cface::CStructNode'
         #'Cface::CUnionNode'
     )
--- a/libInit.cc	Thu Aug 13 06:01:15 2015 +0100
+++ b/libInit.cc	Fri Aug 14 11:27:03 2015 +0100
@@ -75,6 +75,7 @@
 _Cface__CTypedefNode_Init(pass,__pRT__,snd);
 _Cface__CVoidNode_Init(pass,__pRT__,snd);
 _Cface__CWCharNode_Init(pass,__pRT__,snd);
+_Cface__CBoolNode_Init(pass,__pRT__,snd);
 _Cface__CStructNode_Init(pass,__pRT__,snd);
 _Cface__CUnionNode_Init(pass,__pRT__,snd);