mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-03-08 10:10:00 +00:00
* Main.cs:
* Settings.cs: * Utilities.cs: Use separate keyword lists for each language.
This commit is contained in:
parent
4e9edea02b
commit
bb4d969dad
|
@ -36,7 +36,6 @@ namespace Bind
|
||||||
static class MainClass
|
static class MainClass
|
||||||
{
|
{
|
||||||
static GeneratorMode mode = GeneratorMode.GL2;
|
static GeneratorMode mode = GeneratorMode.GL2;
|
||||||
static GeneratorLanguage lang = GeneratorLanguage.CSharp;
|
|
||||||
static internal IBind Generator;
|
static internal IBind Generator;
|
||||||
|
|
||||||
static void Main(string[] arguments)
|
static void Main(string[] arguments)
|
||||||
|
@ -83,10 +82,10 @@ namespace Bind
|
||||||
string arg = b[1].ToLower();
|
string arg = b[1].ToLower();
|
||||||
if (arg == "cpp" || arg == "c++" || arg == "c")
|
if (arg == "cpp" || arg == "c++" || arg == "c")
|
||||||
{
|
{
|
||||||
lang = GeneratorLanguage.Cpp;
|
Settings.Language = GeneratorLanguage.Cpp;
|
||||||
Settings.DefaultOutputPath = "gl";
|
Settings.DefaultOutputPath = "gl";
|
||||||
Settings.DefaultOutputNamespace = "gl";
|
Settings.DefaultOutputNamespace = "OpenTK";
|
||||||
Settings.EnumsNamespace = "gl";
|
Settings.EnumsNamespace = "";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -174,7 +173,7 @@ namespace Bind
|
||||||
|
|
||||||
Generator.Process();
|
Generator.Process();
|
||||||
ISpecWriter writer = null;
|
ISpecWriter writer = null;
|
||||||
switch (lang)
|
switch (Settings.Language)
|
||||||
{
|
{
|
||||||
case GeneratorLanguage.Cpp:
|
case GeneratorLanguage.Cpp:
|
||||||
writer = new CppSpecWriter();
|
writer = new CppSpecWriter();
|
||||||
|
|
|
@ -178,5 +178,7 @@ namespace Bind
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string WindowsGDI = "OpenTK.Platform.Windows.API";
|
public static string WindowsGDI = "OpenTK.Platform.Windows.API";
|
||||||
|
|
||||||
|
public static GeneratorLanguage Language { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,9 +89,22 @@ namespace Bind
|
||||||
|
|
||||||
#endregion
|
#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[]
|
new string[]
|
||||||
{
|
{
|
||||||
"abstract", "event", "new", "struct",
|
"abstract", "event", "new", "struct",
|
||||||
|
@ -117,6 +130,8 @@ namespace Bind
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
static readonly List<string> CppKeywords = new List<string>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Merge
|
#region Merge
|
||||||
|
|
Loading…
Reference in a new issue