Fixed namespace and class generation
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 22 Jan 2009 18:30:18 +0000
changeset 10 8087158409e4
parent 9 03c7a764d2be
child 11 a77f44d45a27
Fixed namespace and class generation
Cface__CNoNode.st
Cface__CStructuredNode.st
Cface__CWCharNode.st
Cface__GeneratorCommand.st
Cface__SVNMapping.st
Cface__SmalltalkXGenerator.st
cvut_fel_cface.st
extensions.st
--- a/Cface__CNoNode.st	Tue Sep 09 21:17:04 2008 +0000
+++ b/Cface__CNoNode.st	Thu Jan 22 18:30:18 2009 +0000
@@ -9,6 +9,7 @@
 	category:'Cface-C AST'
 !
 
+
 !CNoNode methodsFor:'visiting'!
 
 acceptVisitor:aVisitor 
@@ -22,3 +23,8 @@
     "Created: / 04-07-2008 / 09:12:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
+!CNoNode class methodsFor:'documentation'!
+
+version
+    ^'$Id$'
+! !
--- a/Cface__CStructuredNode.st	Tue Sep 09 21:17:04 2008 +0000
+++ b/Cface__CStructuredNode.st	Thu Jan 22 18:30:18 2009 +0000
@@ -9,6 +9,7 @@
 	category:'Cface-C AST'
 !
 
+
 !CStructuredNode methodsFor:'accessing'!
 
 cByteSize
@@ -42,3 +43,8 @@
     "Created: / 09-09-2008 / 21:32:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
+!CStructuredNode class methodsFor:'documentation'!
+
+version
+    ^'$Id$'
+! !
--- a/Cface__CWCharNode.st	Tue Sep 09 21:17:04 2008 +0000
+++ b/Cface__CWCharNode.st	Thu Jan 22 18:30:18 2009 +0000
@@ -9,6 +9,7 @@
 	category:'Cface-C AST'
 !
 
+
 !CWCharNode methodsFor:'accessing'!
 
 cByteSize
@@ -38,3 +39,8 @@
     "Created: / 04-07-2008 / 12:37:31 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
+!CWCharNode class methodsFor:'documentation'!
+
+version
+    ^'$Id$'
+! !
--- a/Cface__GeneratorCommand.st	Tue Sep 09 21:17:04 2008 +0000
+++ b/Cface__GeneratorCommand.st	Thu Jan 22 18:30:18 2009 +0000
@@ -16,35 +16,43 @@
 
     |cairoDir cairoDefFile |
 
-    cairoDir := '/home/janfrog/Projects/Cface/libcairo/'.
+    cairoDir := '/home/janfrog/Projects/Cface/cface/resources/examples/libcairo/'.
     cairoDefFile := cairoDir ,  'libcairo.def'.  
 
-    (
-    
-    Cface::Platform theInstance generatorCommand
+    ^Cface::Platform theInstance generatorCommand
         definitions: cairoDefFile asFilename;
         mappings: Cface::CairoMapping new;
-        module:'libcairo.so';
-        process
-    
-    ) apply.
+        unixLibraryName:'libcairo.so.2';
+        win32LibraryName:'cairo.dll';
+        process.
+
+    "
+        Cface::GeneratorCommand generateCairo
+    "
 
     "Created: / 03-07-2008 / 23:55:14 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 04-07-2008 / 12:33:56 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 22-01-2009 / 19:10:08 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 generateSubversion
 
     |svnDir svnDefFile|
 
-    svnDir := '/home/janfrog/Projects/Cface/libsvn/'.
-    svnDefFile := svnDir ,  'svn_client.h.def'.  
+    svnDir := '/home/janfrog/Projects/Cface/cface/resources/examples/libsvn/'.
+    svnDefFile := svnDir ,  'libsvn.def'.  
 
-    Cface::Platform theInstance generatorCommand
+    ^Cface::Platform theInstance generatorCommand
         definitions: svnDefFile asFilename;
+        mappings: Cface::SVNMapping new;
+        unixLibraryName:'libsvn.so';
         process
 
+    "
+        Cface::GeneratorCommand generateSubversion
+    "
+
     "Created: / 03-07-2008 / 23:55:54 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 06-01-2009 / 12:16:47 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
 !GeneratorCommand methodsFor:'accessing'!
--- a/Cface__SVNMapping.st	Tue Sep 09 21:17:04 2008 +0000
+++ b/Cface__SVNMapping.st	Thu Jan 22 18:30:18 2009 +0000
@@ -9,22 +9,29 @@
 	category:'Cface-Mappings'
 !
 
+
 !SVNMapping methodsFor:'accessing'!
 
 smalltalkClassNameForDerivedType:cType 
-    |svnName|
+    |cName|
 
-    svnName := cType cName.
-    svnName = 'svn_client_ctx' ifTrue:[
-        ^ #Context
+    cName := cType cName.
+    cName = 'svn_client_ctx_t' ifTrue:[
+        ^ #ClientContext
+    ].
+    cName = 'apr_array_header_t' ifTrue:[
+        ^ #Array
     ].
-    (svnName startsWith:'svn_') ifTrue:[
-        svnName := svnName copyFrom:5
+    (cName startsWith:'svn_') ifTrue:[
+        cName := cName copyFrom:5
     ].
-    (svnName endsWith:'_t') ifTrue:[
-        svnName := svnName copyTo:(svnName size - 2)
+    (cName startsWith:'apr') ifTrue:[
+        cName := cName copyFrom:5
     ].
-    ^ (self smalltalkize:svnName) capitalized asSymbol
+    (cName endsWith:'_t') ifTrue:[
+        cName := cName copyTo:(cName size - 2)
+    ].
+    ^ (self smalltalkize:cName) capitalized asSymbol
 
     "
         Cface::CairoMappings new
@@ -36,6 +43,7 @@
 
     "Modified: / 17-02-2008 / 22:18:24 / janfrog"
     "Created: / 10-07-2008 / 20:26:25 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 06-01-2009 / 12:26:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 smalltalkNamespaceForDerivedType: type
@@ -74,3 +82,8 @@
     "Created: / 10-07-2008 / 20:26:25 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
+!SVNMapping class methodsFor:'documentation'!
+
+version
+    ^'$Id$'
+! !
--- a/Cface__SmalltalkXGenerator.st	Tue Sep 09 21:17:04 2008 +0000
+++ b/Cface__SmalltalkXGenerator.st	Thu Jan 22 18:30:18 2009 +0000
@@ -12,44 +12,10 @@
 
 !SmalltalkXGenerator class methodsFor:'instance creation'!
 
-generate:aStringOrFilename class:aClass namespace:aNameSpace 
-    |temp|
-
-    temp := Generator onFile:aStringOrFilename.
-    temp 
-        startGeneration:aClass
-        nameSpace:aNameSpace
-        toFile:aStringOrFilename , '.st'.
-    ^ temp.
-
-    "Created: / 08-02-2008 / 08:55:08 / janfrog"
-!
-
 new
     ^ self basicNew initialize.
 
     "Created: / 08-02-2008 / 08:55:08 / janfrog"
-!
-
-on: aStream
-
-    |gen|
-
-    gen := self new.
-    gen inputStream: aStream;
-        parseDef;
-        analyse.
-    ^gen
-
-    "Modified: / 24-11-2007 / 12:20:27 / haja"
-    "Created: / 08-02-2008 / 08:55:08 / janfrog"
-!
-
-onFile: aStringOrFilename
-
-    ^self on: aStringOrFilename asFilename readStream
-
-    "Created: / 08-02-2008 / 08:55:08 / janfrog"
 ! !
 
 !SmalltalkXGenerator methodsFor:'processing'!
@@ -193,8 +159,10 @@
     (changeset add: ClassDefinitionChange new)
         superClassName: 
             SharedPool fullName;
+        nameSpaceName: 
+            cEnumNode smalltalkNamespace;
         className: 
-            cEnumNode smalltalkClassNameWithNamespace;
+            cEnumNode smalltalkClassName;
         classVariableNames:
             (String streamContents:
                 [:s|
@@ -242,7 +210,7 @@
                     s tab; nextPut:$^; nextPutAll: cEnumValueNode smalltalkName])]
 
     "Created: / 03-07-2008 / 20:10:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 04-07-2008 / 11:58:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 22-01-2009 / 19:21:45 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 visitCFunctionNode:functionNode 
@@ -294,8 +262,10 @@
             [(changeset add: ClassDefinitionChange new)
                 superClassName: 
                     ExternalStructure fullName;
+                nameSpaceName: 
+                    cStructNode smalltalkNamespace;
                 className: 
-                    cStructNode smalltalkClassNameWithNamespace;
+                    cStructNode smalltalkClassName;
                 category:
                     cStructNode smalltalkCategory;
                 package:
@@ -323,7 +293,7 @@
             [:fieldNode|self visit: fieldNode]
 
     "Created: / 10-07-2008 / 08:46:12 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 09-09-2008 / 20:12:35 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 22-01-2009 / 19:20:47 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 visitCTypedefNode: typedefNode
--- a/cvut_fel_cface.st	Tue Sep 09 21:17:04 2008 +0000
+++ b/cvut_fel_cface.st	Thu Jan 22 18:30:18 2009 +0000
@@ -7,6 +7,7 @@
 	category:'* Projects & Packages *'
 !
 
+
 !cvut_fel_cface class methodsFor:'description'!
 
 preRequisites
@@ -16,7 +17,7 @@
         #'stx:libbasic3'    "MethodDefinitionChange - referenced by Cface::SmalltalkXGenerator>>visitCStructFieldNode: "
     )
 
-    "Modified: / 09-09-2008 / 23:12:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 22-01-2009 / 19:29:20 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
 !cvut_fel_cface class methodsFor:'description - contents'!
@@ -72,14 +73,15 @@
         #'Cface::CUnionNode'
     )
 
-    "Modified: / 09-09-2008 / 23:12:47 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 22-01-2009 / 19:29:19 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 extensionMethodNames
     ^ #(
+        ClassDefinitionChange nameSpaceName:
     )
 
-    "Modified: / 09-09-2008 / 23:12:47 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 22-01-2009 / 19:29:20 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
 !cvut_fel_cface class methodsFor:'description - project information'!
@@ -116,3 +118,8 @@
     "Created: / 08-09-2008 / 23:49:09 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
+!cvut_fel_cface class methodsFor:'documentation'!
+
+version
+    ^'$Id$'
+! !
--- a/extensions.st	Tue Sep 09 21:17:04 2008 +0000
+++ b/extensions.st	Thu Jan 22 18:30:18 2009 +0000
@@ -2,3 +2,10 @@
 
 !
 
+!ClassDefinitionChange methodsFor:'accessing'!
+
+nameSpaceName:aSymbol
+    nameSpaceName := aSymbol.
+
+    "Created: / 22-01-2009 / 19:19:57 / Jan Vrany <vranyj1@fel.cvut.cz>"
+! !