-
Notifications
You must be signed in to change notification settings - Fork 0
/
VKxmlParser.cs
124 lines (99 loc) · 3.76 KB
/
VKxmlParser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
using System;
using System.Xml;
using System.Windows.Forms;
namespace VulkanParser
{
/// <summary>
/// Description of VKxmlParser.
/// </summary>
public static class VKxmlParser
{
private static float f_value;
private static string s_namespace;
private static string s_destination;
private static XmlDocument xdoc;
public static void Parse(string rutaxml, string @namespace, string destination)
{
f_value = 0;
s_namespace = @namespace;
s_destination = destination;
xdoc = new XmlDocument();
xdoc.Load(rutaxml);
((MainForm)Application.OpenForms[0]).toolStripStatusLabel2.Text = "Parseando Archivo xml de Vulkan.";
//EL MEOLLO YA AQUÍ
#region Lectura
Tools.DefineTypes(xdoc);
HandleParser.Parse(xdoc);
APIConstantsParser.Parse(xdoc);
IntPtrsParser.Parse(xdoc);
EnumParser.Parse(xdoc);
EnumParser.ExtParse(xdoc);
ExtensionsParser.ParseExtendedEnumValues(xdoc); //EXTENSIONES
FuncPointerParser.Parse(xdoc);
StructParser2.Parse(xdoc);
UnionParser.Parse(xdoc);
CommandParser.Parse(xdoc);
VersionParser.Parse(xdoc);
#endregion
#region Escritura
CreaterConstCS.CreateConstCS();
//CreaterIntPtrsCS.CreateIntPtrsCS(); //IntPtrs & Handles
CreaterEnumCS.CreateEnumCS();
CreaterStructsCS.CreateStructsCS();
CreaterUnionCS.CreateUnionCS();
//CreaterMethodsCS.CreateMethodsCS();
//CreaterMethodsCS2.CreateMethodsCS();
CreaterMethodsCS3.CreateMethodsCS();
//CreaterMethodsICS.CreateMethodsICS();
//CreaterMethodsDCS.CreateMethodsDCS();
if (((MainForm)Application.OpenForms[0]).checkvkdevices.Checked)
{
VKDeviceMaker.VKDeviceMake();
VKDelegatesMaker.VKDelegatesMake();
VKDelegatorMaker.VKDelegatorMake();
}
#endregion
#region Compile DLL
if (((MainForm)Application.OpenForms[0]).checkBox1.Checked)
{
string nombrearchivo = ((MainForm)Application.OpenForms[0]).textBox1.Text;
string[] files = System.IO.Directory.GetFiles(s_destination, "*.cs");
//delegate delmethod = new dele
string retornado = DLLCompiler.CompileDLL(files, s_destination+nombrearchivo);
FormUpdater.UpdateCompilerText(retornado);
}
#endregion
//EL MEOLLO YA AQUÍ
if (((MainForm)Application.OpenForms[0]).checkBox2.Checked)
{
string[] archivos = System.IO.Directory.GetFiles(s_destination, "*.cs");
for (int i=0;i<archivos.Length;i++)
{
System.IO.File.Delete(archivos[i]);
}
}
//((MainForm)Application.OpenForms[0]).SetValue((int)100); //Casca sin un invoke por ejecutarse desde otro hilo.
((MainForm)Application.OpenForms[0]).toolStripStatusLabel2.Text = "Archivo xml de Vulkan Parseado.";
if (System.Windows.Forms.MessageBox.Show("El Archivo XML de Vulkan ha sido Parseado correctamente", "Trabajo Terminado!") == DialogResult.OK)
{
}
((MainForm)Application.OpenForms[0]).Invoke(finish);
//((MainForm)Application.OpenForms[0]).Habilitar(true, true);
System.Threading.Thread.CurrentThread.Abort();
}
static FinishDel finish = ((MainForm)Application.OpenForms[0]).SetFinish;
public static void Increment(float valor)
{
f_value += valor;
((MainForm)Application.OpenForms[0]).SetValue((int)f_value);
}
public static string GetNamespace()
{
return s_namespace;
}
public static string GetDestination()
{
return s_destination;
}
}
}