6d30cf0c3e
2002-05-23 Mike Kestner <mkestner@speakeasy.net> * generator/BoxedGen.cs : Update for Static SymbolTable * generator/CallbackGen.cs : Use GenBase and Parameters classes * generator/CodeGenerator.cs : Update for Static SymbolTable * generator/Ctor.cs : code from StructBase using Parameters class * generator/EnumGen.cs : Use GenBase * generator/GenBase.cs : Abstract Stream Writer creation, stream boilerplate, and common *Name properties * generator/IGeneratable.cs : Update for Static SymbolTable * generator/InterfaceGen.cs : Use GenBase * generator/Method.cs : code from StructBase using Parameters class * generator/ObjectGen.cs : Major refactoring. Use GenBase. Build tables of Member generatables at construct time to facilitate future name collision resolution logic. * generator/Parameters.cs : new generatable to abstract duplicated parameter parsing logic. * generator/Parser.cs : Update for Static SymbolTable * generator/Property.cs : code from ObjectGen * generator/Signal.cs : code from ObjectGen * generator/SignalHandler.cs : Update for Static SymbolTable * generator/StructBase.cs : Update for Static SymbolTable * generator/StructGen.cs : Update for Static SymbolTable * generator/SymbolTable.cs : Make all methods and private members static. There is no reason to ever have multiple tables. svn path=/trunk/gtk-sharp/; revision=4895
35 lines
713 B
C#
35 lines
713 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]);
|
|
p.Parse ();
|
|
Console.WriteLine (SymbolTable.Count + " types parsed.");
|
|
|
|
foreach (IGeneratable gen in SymbolTable.Generatables) {
|
|
gen.Generate ();
|
|
}
|
|
|
|
Statistics.Report();
|
|
return 0;
|
|
}
|
|
|
|
}
|
|
}
|