From ba8f5889535e3cebce7da0c4327877d88c7022b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?LAVAL=20J=C3=A9r=C3=A9mie?= Date: Mon, 11 Jun 2007 13:19:14 +0200 Subject: [PATCH] * Added stub of CodeScheme which will replace CodeDOM (more specialized for P/Invoke) --- CodeScheme/AssemblyInfo.cs | 36 ++++++++++++++++++++++++++++++ CodeScheme/CodeScheme.mdp | 38 ++++++++++++++++++++++++++++++++ CodeScheme/Common/ISymbol.cs | 13 +++++++++++ CodeScheme/Common/RootObject.cs | 16 ++++++++++++++ CodeScheme/Function/Argument.cs | 14 ++++++++++++ CodeScheme/Function/Function.cs | 16 ++++++++++++++ CodeScheme/Function/PInvokeFunction.cs | 15 +++++++++++++ CodeScheme/Function/WrapperFunction.cs | 14 ++++++++++++ CodeScheme/Provider/IFunctionFactory.cs | 15 +++++++++++++ CodeScheme/Provider/ISourceProvider.cs | 14 ++++++++++++ CodeScheme/Provider/ITypeFactory.cs | 15 +++++++++++++ CodeScheme/Type/ArrayType.cs | 17 ++++++++++++++ CodeScheme/Type/PointerType.cs | 17 ++++++++++++++ CodeScheme/Type/Type.cs | 14 ++++++++++++ GccXmlTranslator.cs | 2 ++ NGenerator.mdp | 1 + NGenerator.mds | 4 ++++ bin/Debug/NGenerator.exe | Bin 15360 -> 15360 bytes bin/Debug/NGenerator.exe.mdb | Bin 6755 -> 6775 bytes 19 files changed, 261 insertions(+) create mode 100644 CodeScheme/AssemblyInfo.cs create mode 100644 CodeScheme/CodeScheme.mdp create mode 100644 CodeScheme/Common/ISymbol.cs create mode 100644 CodeScheme/Common/RootObject.cs create mode 100644 CodeScheme/Function/Argument.cs create mode 100644 CodeScheme/Function/Function.cs create mode 100644 CodeScheme/Function/PInvokeFunction.cs create mode 100644 CodeScheme/Function/WrapperFunction.cs create mode 100644 CodeScheme/Provider/IFunctionFactory.cs create mode 100644 CodeScheme/Provider/ISourceProvider.cs create mode 100644 CodeScheme/Provider/ITypeFactory.cs create mode 100644 CodeScheme/Type/ArrayType.cs create mode 100644 CodeScheme/Type/PointerType.cs create mode 100644 CodeScheme/Type/Type.cs diff --git a/CodeScheme/AssemblyInfo.cs b/CodeScheme/AssemblyInfo.cs new file mode 100644 index 0000000..900ff08 --- /dev/null +++ b/CodeScheme/AssemblyInfo.cs @@ -0,0 +1,36 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/AssemblyInfo.cs +// Writtent by jeremie at 19:13 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes specify the key for the sign of your assembly. See the +// .NET Framework documentation for more information about signing. +// This is not required, if you don't want signing let these attributes like they're. +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] diff --git a/CodeScheme/CodeScheme.mdp b/CodeScheme/CodeScheme.mdp new file mode 100644 index 0000000..7c44fa8 --- /dev/null +++ b/CodeScheme/CodeScheme.mdp @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CodeScheme/Common/ISymbol.cs b/CodeScheme/Common/ISymbol.cs new file mode 100644 index 0000000..c48b2ac --- /dev/null +++ b/CodeScheme/Common/ISymbol.cs @@ -0,0 +1,13 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/ISymbol.cs +// Writtent by jeremie at 19:27 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + public interface ISymbol + { + } +} diff --git a/CodeScheme/Common/RootObject.cs b/CodeScheme/Common/RootObject.cs new file mode 100644 index 0000000..1d3ce69 --- /dev/null +++ b/CodeScheme/Common/RootObject.cs @@ -0,0 +1,16 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/RootObject.cs +// Writtent by jeremie at 19:19 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; +using System.Collections.Generic; + +namespace CodeScheme +{ + public sealed class RootObject + { + List typeList = new List(); + List functionList = new List(); + } +} diff --git a/CodeScheme/Function/Argument.cs b/CodeScheme/Function/Argument.cs new file mode 100644 index 0000000..810e2ad --- /dev/null +++ b/CodeScheme/Function/Argument.cs @@ -0,0 +1,14 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/Argument.cs +// Writtent by jeremie at 19:26 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + public class Argument + { + + } +} diff --git a/CodeScheme/Function/Function.cs b/CodeScheme/Function/Function.cs new file mode 100644 index 0000000..038dcca --- /dev/null +++ b/CodeScheme/Function/Function.cs @@ -0,0 +1,16 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/Function.cs +// Writtent by jeremie at 19:22 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + public abstract class Function: ISymbol + { + Argument[] args; + string name; + Type returnType; + } +} diff --git a/CodeScheme/Function/PInvokeFunction.cs b/CodeScheme/Function/PInvokeFunction.cs new file mode 100644 index 0000000..f495f30 --- /dev/null +++ b/CodeScheme/Function/PInvokeFunction.cs @@ -0,0 +1,15 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/PInvokeFunction.cs +// Writtent by jeremie at 19:23 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + public class PInvokeFunction: Function + { + string callingPoint; + + } +} diff --git a/CodeScheme/Function/WrapperFunction.cs b/CodeScheme/Function/WrapperFunction.cs new file mode 100644 index 0000000..1ceedaf --- /dev/null +++ b/CodeScheme/Function/WrapperFunction.cs @@ -0,0 +1,14 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/WrapperFunction.cs +// Writtent by jeremie at 19:24 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + public class WrapperFunction + { + + } +} diff --git a/CodeScheme/Provider/IFunctionFactory.cs b/CodeScheme/Provider/IFunctionFactory.cs new file mode 100644 index 0000000..4938324 --- /dev/null +++ b/CodeScheme/Provider/IFunctionFactory.cs @@ -0,0 +1,15 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/IFunctionFactory.cs +// Writtent by jeremie at 19:19 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + public interface IFunctionFactory + { + WrapperFunction GetWrapperFunction(PInvokeFunction func); + PInvokeFunction GetPInvokeFunction(string name, Type returnType, Argument[] args); + } +} diff --git a/CodeScheme/Provider/ISourceProvider.cs b/CodeScheme/Provider/ISourceProvider.cs new file mode 100644 index 0000000..282b501 --- /dev/null +++ b/CodeScheme/Provider/ISourceProvider.cs @@ -0,0 +1,14 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/ISourceProvider.cs +// Writtent by jeremie at 19:19 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + public interface ISourceProvider + { + + } +} diff --git a/CodeScheme/Provider/ITypeFactory.cs b/CodeScheme/Provider/ITypeFactory.cs new file mode 100644 index 0000000..5500648 --- /dev/null +++ b/CodeScheme/Provider/ITypeFactory.cs @@ -0,0 +1,15 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/ITypeFactory.cs +// Writtent by jeremie at 19:19 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + + + public interface ITypeFactory + { + } +} diff --git a/CodeScheme/Type/ArrayType.cs b/CodeScheme/Type/ArrayType.cs new file mode 100644 index 0000000..ce59af4 --- /dev/null +++ b/CodeScheme/Type/ArrayType.cs @@ -0,0 +1,17 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/ArrayType.cs +// Writtent by jeremie at 19:15 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + + + public class ArrayType + { + int dimension; + Type type; + } +} diff --git a/CodeScheme/Type/PointerType.cs b/CodeScheme/Type/PointerType.cs new file mode 100644 index 0000000..9ab1669 --- /dev/null +++ b/CodeScheme/Type/PointerType.cs @@ -0,0 +1,17 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/PointerType.cs +// Writtent by jeremie at 19:16 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + public class PointerType + { + // Represent the amount of * of the Pointer (usually just one) + int deepLevel; + Type type; + + } +} diff --git a/CodeScheme/Type/Type.cs b/CodeScheme/Type/Type.cs new file mode 100644 index 0000000..fe5076e --- /dev/null +++ b/CodeScheme/Type/Type.cs @@ -0,0 +1,14 @@ +// /home/jeremie/TaoParser/NGenerator/CodeScheme/IType.cs +// Writtent by jeremie at 19:13 10/06/2007 +// +// This file is licensed under the LGPL licence as described in the COPYING file + +using System; + +namespace CodeScheme +{ + public abstract class Type + { + + } +} diff --git a/GccXmlTranslator.cs b/GccXmlTranslator.cs index f393978..6674ea9 100644 --- a/GccXmlTranslator.cs +++ b/GccXmlTranslator.cs @@ -5,9 +5,11 @@ using System; using System.IO; +using System.Collections.Generic; // TODO: Drop CodeDOM and use a cooler replacement (maybe add an option to autogenerate with Cecil too) using System.CodeDom; using System.Xml; +using Cs = CodeScheme; namespace NGenerator { diff --git a/NGenerator.mdp b/NGenerator.mdp index 1f4bbef..4741a12 100644 --- a/NGenerator.mdp +++ b/NGenerator.mdp @@ -27,5 +27,6 @@ + \ No newline at end of file diff --git a/NGenerator.mds b/NGenerator.mds index ce87fa0..4c3eb8e 100644 --- a/NGenerator.mds +++ b/NGenerator.mds @@ -3,18 +3,22 @@ + + + + \ No newline at end of file diff --git a/bin/Debug/NGenerator.exe b/bin/Debug/NGenerator.exe index 3cc838f03044707169de27f0cb5fb074390b3652..c907e6dd7b1abc43db775b8fd3b575ddcdd37212 100755 GIT binary patch delta 78 zcwPZc0I~mocz}42hyyJzZLy0h8w8#TW?i$o8+I5F?jME;R7%24ixXKJIhf4Kvk^MZ k0h10kegkG*p0kfOj{*%i04@MB05bqN05JeCvnx5(0$Fq!od5s; delta 78 zcwTF$XsDRb!7TPLYh$;zG|L>W+wGfoNta0o)Q6SVE8gGjuqL)KqK8ZO-DW|nbBvSu i%<7nLx6j$!Z`RMmYsR3*V9a2`U=DWq*0h{i{^k2cN>nT{iB;w$Y)P!u1nMq;A2_*gZl z2*bD;Y8E353?Ud7DvqwijWCQZB)Suy;6gzcQDz}zp#y%WsuuUa$A3@VTUDn{)v5a? zJD$xYN6P=tYI(nQu2SmbjEhx;4gYli8ud=i{W1FR^c1B!Y0oq&RfYc5q|`HX4xGM~ zt4Wmkz}Zx&hiT9T(_t;lfIaXHoQ0WSVHRA5*)nPv@d`*3*I*vp1`R1B9oobaurA@S z4-z}e3q$)N6E?wJ*aD+LUj%&( zTj2w2gUJ7;U^hEccbYEes7x5eeyk8M0?PK=w9>?dJH{` zoo-UF!T$c@{*!%!1Escg#ew39 zzWp`fZGP}Tv2)Nqt~+j889a_yyDilBEHB~35gSG)hxMd_FVRvK%DA4d>Yp}s&?Kyf zJq`Zrn`pw`N=5c{L$i5@7e{Q|)F8lyFiSi;yAv&?j| z{y1UId*X@0iF>mqWh<&ovsk~W8cH@Y3*s6agUP*FFn-VExmmdkuV{Q!Zm)OES`Hn}dMI+; zv}_gQYS}{O)3UY1p=HY%QYVayTg$MlN6U0vvpU3~B|ffOEpZc*9`o^PS?2;&)=%l# qb4^#)e4+MUGXH0oL}-=3ZJ?6OnIn#0lKux#725CN|4aV@XX-1%-OOkJ delta 1581 zcwSAEOKgon6vwBM4yyXN-<^9~N?+P~q)oZ4XuYmfi58XAqd`Me5s|0`YQgnLY!Hh{ zgdifK7A&x8SXp3$NJLyB(WDFAwCRqG#P57F;XBDM|2gx0Gjrz5nfcW;*3=Ro&itva z9dEBwN@aGQ&Q$(*nSRoHq33E|{bc_frPkA5UZT`Y^h&8xS+oZFpS2X^XZR2rA5<~S zg$5{tc9;kIU_P9I3b0TKx1b8{K{Y(|Ge3q}cn%s8i1B@5`LHoR#J!?d2e4&f-N8yJkNGodd7&qKHiduFS>c zO0@?rEmA*oWVM(pQ%Q?lz1uNYXHwE7e!TR{wM&L8or@1AvT?3&1hL<7+iI4XM)n;= zENw5CHZz15MeL^iYEtGSUKFuWTbXDxC1f><*a~|lkurmLQN+&MSBx3Kiz1e_rOA{j zVh2&gDr{e}Ez^S+MQjKya80$q`*PjnipeWefxik}qg=|e375(h%DqbG@s}$18dOMs z;{PjB4x`3Z-$Lpn%lAA8)soxQR(;UA$WM$;+r^|GbR$M(M*< l<6NP)tp5{c5LzxwlSHv*4eOkYyLW!3?|+Q{l<{e5>Mx@rw@v^6 -- 2.11.4.GIT