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