mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-24 14:05:32 +00:00
ede9016e25
* generator/Statistics.cs : New. Gathers stats about generation. * generator/*.cs : Hook in the stat counters. svn path=/trunk/gtk-sharp/; revision=2491
38 lines
805 B
C#
38 lines
805 B
C#
// GtkSharp.Generation.CodeGenerator.cs - The main code generation engine.
|
|
//
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
//
|
|
// (c) 2001 Mike Kestner
|
|
|
|
namespace GtkSharp.Generation {
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using System.Xml;
|
|
|
|
public class CodeGenerator {
|
|
|
|
public static int Main (string[] args)
|
|
{
|
|
if (args.Length != 1) {
|
|
Console.WriteLine ("Usage: codegen <filename>");
|
|
return 0;
|
|
}
|
|
|
|
Parser p = new Parser (args[0]);
|
|
SymbolTable table = p.Parse ();
|
|
Console.WriteLine (table.Count + " types parsed.");
|
|
|
|
IDictionaryEnumerator de = table.GetEnumerator();
|
|
while (de.MoveNext()) {
|
|
IGeneratable gen = (IGeneratable) de.Value;
|
|
gen.Generate (table);
|
|
}
|
|
|
|
Statistics.Report();
|
|
return 0;
|
|
}
|
|
|
|
}
|
|
}
|