2002-01-05 13:45:55 +01:00
|
|
|
// GtkSharp.Generation.CodeGenerator.cs - The main code generation engine.
|
2002-01-04 03:02:28 +01:00
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
|
|
|
// (c) 2001 Mike Kestner
|
|
|
|
|
2002-01-05 13:45:55 +01:00
|
|
|
namespace GtkSharp.Generation {
|
2002-01-04 03:02:28 +01:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Xml;
|
|
|
|
|
|
|
|
public class CodeGenerator {
|
|
|
|
|
|
|
|
public static int Main (string[] args)
|
|
|
|
{
|
2002-01-05 13:45:55 +01:00
|
|
|
if (args.Length != 1) {
|
|
|
|
Console.WriteLine ("Usage: codegen <filename>");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-01-04 03:02:28 +01:00
|
|
|
Parser p = new Parser (args[0]);
|
2002-01-05 13:45:55 +01:00
|
|
|
SymbolTable table = p.Parse ();
|
|
|
|
Console.WriteLine (table.Count + " types parsed.");
|
2002-01-04 03:02:28 +01:00
|
|
|
|
2002-03-08 23:40:00 +01:00
|
|
|
foreach (IGeneratable gen in table.Generatables) {
|
2002-01-05 13:45:55 +01:00
|
|
|
gen.Generate (table);
|
2002-01-04 03:02:28 +01:00
|
|
|
}
|
|
|
|
|
2002-02-19 04:12:47 +01:00
|
|
|
Statistics.Report();
|
2002-01-04 03:02:28 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|