diff --git a/Source/Bind/Main.cs b/Source/Bind/Main.cs index d1c8dc4b..b59e872d 100644 --- a/Source/Bind/Main.cs +++ b/Source/Bind/Main.cs @@ -36,7 +36,6 @@ namespace Bind static class MainClass { static GeneratorMode mode = GeneratorMode.GL2; - static GeneratorLanguage lang = GeneratorLanguage.CSharp; static internal IBind Generator; static void Main(string[] arguments) @@ -83,10 +82,10 @@ namespace Bind string arg = b[1].ToLower(); if (arg == "cpp" || arg == "c++" || arg == "c") { - lang = GeneratorLanguage.Cpp; + Settings.Language = GeneratorLanguage.Cpp; Settings.DefaultOutputPath = "gl"; - Settings.DefaultOutputNamespace = "gl"; - Settings.EnumsNamespace = "gl"; + Settings.DefaultOutputNamespace = "OpenTK"; + Settings.EnumsNamespace = ""; } break; } @@ -174,7 +173,7 @@ namespace Bind Generator.Process(); ISpecWriter writer = null; - switch (lang) + switch (Settings.Language) { case GeneratorLanguage.Cpp: writer = new CppSpecWriter(); diff --git a/Source/Bind/Settings.cs b/Source/Bind/Settings.cs index 41c53b87..5911c901 100644 --- a/Source/Bind/Settings.cs +++ b/Source/Bind/Settings.cs @@ -178,5 +178,7 @@ namespace Bind } public static string WindowsGDI = "OpenTK.Platform.Windows.API"; + + public static GeneratorLanguage Language { get; set; } } } diff --git a/Source/Bind/Utilities.cs b/Source/Bind/Utilities.cs index 801f9324..e16774ae 100644 --- a/Source/Bind/Utilities.cs +++ b/Source/Bind/Utilities.cs @@ -89,9 +89,22 @@ namespace Bind #endregion - #region C# keywords + #region Keywords - public static readonly List Keywords = new List( + public static List Keywords + { + get + { + switch (Settings.Language) + { + case GeneratorLanguage.CSharp: return CSharpKeywords; + case GeneratorLanguage.Cpp: return CppKeywords; + default: throw new NotImplementedException(); + } + } + } + + static readonly List CSharpKeywords = new List( new string[] { "abstract", "event", "new", "struct", @@ -117,6 +130,8 @@ namespace Bind } ); + static readonly List CppKeywords = new List(); + #endregion #region Merge