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-01-05 13:45:55 +01:00
|
|
|
IDictionaryEnumerator de = table.GetEnumerator();
|
2002-01-04 03:02:28 +01:00
|
|
|
while (de.MoveNext()) {
|
|
|
|
IGeneratable gen = (IGeneratable) de.Value;
|
2002-01-05 13:45:55 +01:00
|
|
|
gen.Generate (table);
|
2002-01-04 03:02:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|