mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-24 12:45:45 +00:00
5b7aaf1c4f
* generator/*.cs : Kill DoGenerate. svn path=/trunk/gtk-sharp/; revision=18572
56 lines
1.2 KiB
C#
56 lines
1.2 KiB
C#
// GtkSharp.Generation.CodeGenerator.cs - The main code generation engine.
|
|
//
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
//
|
|
// (c) 2001-2003 Mike Kestner and Ximian Inc.
|
|
|
|
namespace GtkSharp.Generation {
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using System.Xml;
|
|
|
|
public class CodeGenerator {
|
|
|
|
public static int Main (string[] args)
|
|
{
|
|
if (args.Length < 2) {
|
|
Console.WriteLine ("Usage: codegen --generate <filename1...>");
|
|
return 0;
|
|
}
|
|
|
|
bool generate = false;
|
|
bool include = false;
|
|
|
|
SymbolTable table = SymbolTable.Table;
|
|
ArrayList gens = new ArrayList ();
|
|
foreach (string arg in args) {
|
|
if (arg == "--generate") {
|
|
generate = true;
|
|
include = false;
|
|
continue;
|
|
} else if (arg == "--include") {
|
|
generate = false;
|
|
include = true;
|
|
continue;
|
|
}
|
|
|
|
Parser p = new Parser ();
|
|
IGeneratable[] curr_gens = p.Parse (arg);
|
|
table.AddTypes (curr_gens);
|
|
if (generate)
|
|
gens.AddRange (curr_gens);
|
|
}
|
|
|
|
foreach (IGeneratable gen in gens) {
|
|
gen.Generate ();
|
|
}
|
|
|
|
ObjectGen.GenerateMapper ();
|
|
|
|
Statistics.Report();
|
|
return 0;
|
|
}
|
|
}
|
|
}
|