* Main.cs:

* Settings.cs:
* Utilities.cs: Use separate keyword lists for each language.
This commit is contained in:
the_fiddler 2010-12-05 11:24:05 +00:00
parent 4e9edea02b
commit bb4d969dad
3 changed files with 23 additions and 7 deletions

View file

@ -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();

View file

@ -178,5 +178,7 @@ namespace Bind
}
public static string WindowsGDI = "OpenTK.Platform.Windows.API";
public static GeneratorLanguage Language { get; set; }
}
}

View file

@ -89,9 +89,22 @@ namespace Bind
#endregion
#region C# keywords
#region Keywords
public static readonly List<string> Keywords = new List<string>(
public static List<string> Keywords
{
get
{
switch (Settings.Language)
{
case GeneratorLanguage.CSharp: return CSharpKeywords;
case GeneratorLanguage.Cpp: return CppKeywords;
default: throw new NotImplementedException();
}
}
}
static readonly List<string> CSharpKeywords = new List<string>(
new string[]
{
"abstract", "event", "new", "struct",
@ -117,6 +130,8 @@ namespace Bind
}
);
static readonly List<string> CppKeywords = new List<string>();
#endregion
#region Merge