* Main.cs:
* Settings.cs: * Utilities.cs: Use separate keyword lists for each language.
This commit is contained in:
parent
4e9edea02b
commit
bb4d969dad
3 changed files with 23 additions and 7 deletions
|
@ -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();
|
||||
|
|
|
@ -178,5 +178,7 @@ namespace Bind
|
|||
}
|
||||
|
||||
public static string WindowsGDI = "OpenTK.Platform.Windows.API";
|
||||
|
||||
public static GeneratorLanguage Language { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue