From: Tim R. <ti...@us...> - 2004-09-19 18:51:12
|
Update of /cvsroot/csdopenglnet/csdOpenGL/generator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7211/generator Modified Files: define.cs function.cs generator.cs typedef.cs Log Message: n/a Index: typedef.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/typedef.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** typedef.cs 11 Sep 2004 19:36:36 -0000 1.6 --- typedef.cs 19 Sep 2004 18:51:03 -0000 1.7 *************** *** 28,31 **** --- 28,33 ---- protected SortedList dList; + protected bool quiet = false; + protected string delegateAttribute = ""; *************** *** 35,42 **** * @param w StreamWriter instance for output */ ! public TypeDef( StreamWriter w ) { Debug.Indent(); Debug.WriteLine( "Entering TypeDef.Define(StreamWriter)" ); writer = w; tList = new SortedList( System.Collections.Comparer.Default ); --- 37,45 ---- * @param w StreamWriter instance for output */ ! public TypeDef( StreamWriter w, bool _quiet ) { Debug.Indent(); Debug.WriteLine( "Entering TypeDef.Define(StreamWriter)" ); + quiet = _quiet; writer = w; tList = new SortedList( System.Collections.Comparer.Default ); *************** *** 61,65 **** } ! public TypeDef( StreamWriter w, ArrayList typedefs, string delAttr ) : this ( w ) { delegateAttribute = delAttr; IEnumerator e = typedefs.GetEnumerator(); --- 64,68 ---- } ! public TypeDef( StreamWriter w, ArrayList typedefs, string delAttr, bool _quiet ) : this ( w, _quiet ) { delegateAttribute = delAttr; IEnumerator e = typedefs.GetEnumerator(); *************** *** 265,272 **** // print information to console ! Console.Write( "TypeDef: " ); ! Console.Write( n ); ! Console.Write( " -> " ); ! Console.WriteLine( t ); try { --- 268,277 ---- // print information to console ! if (!quiet) { ! Console.Write( "TypeDef: " ); ! Console.Write( n ); ! Console.Write( " -> " ); ! Console.WriteLine( t ); ! } try { Index: function.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/function.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** function.cs 11 Sep 2004 20:48:09 -0000 1.8 --- function.cs 19 Sep 2004 18:51:03 -0000 1.9 *************** *** 25,29 **** */ protected ArrayList list; ! protected ArrayList listWrap; protected SortedList attrList; --- 25,30 ---- */ protected ArrayList list; ! ! protected bool quiet = false; protected ArrayList listWrap; protected SortedList attrList; *************** *** 58,65 **** * @param l the name of the library to be wrapped */ ! public Function( StreamWriter w, TypeDef t, string df, string da, string l, ArrayList _ignoreFunctions ) { Debug.Indent(); Debug.WriteLine( "Entering Function.Function(StreamWriter)" ); dllFlags = df; dllAttr = da; --- 59,67 ---- * @param l the name of the library to be wrapped */ ! public Function( StreamWriter w, TypeDef t, string df, string da, string l, ArrayList _ignoreFunctions, bool _quiet ) { Debug.Indent(); Debug.WriteLine( "Entering Function.Function(StreamWriter)" ); + quiet = _quiet; dllFlags = df; dllAttr = da; *************** *** 186,194 **** if (valid(n)) { list.Add( new FunctionSet( t, n, p ) ); // add function declaration ! Console.Write( "Function: " ); } else { Console.Write( "Ignored function: " ); } - Console.WriteLine( n ); Debug.WriteLine( "Exiting Function.add(string)" ); --- 188,199 ---- if (valid(n)) { list.Add( new FunctionSet( t, n, p ) ); // add function declaration ! if (!quiet) { ! Console.Write( "Function: " ); ! Console.WriteLine( n ); ! } } else { Console.Write( "Ignored function: " ); + Console.WriteLine( n ); } Debug.WriteLine( "Exiting Function.add(string)" ); *************** *** 340,348 **** for ( int i=0; i<fs.parameters.Count; i++ ) { ps = (ParamSet)fs.parameters[i]; ! writer.WriteLine( " " ); ! writer.WriteLine( "par_"+fs.name+i.ToString() ); ! writer.WriteLine( " = " ); ! writer.WriteLine( ps.name ); ! writer.WriteLine( ";\n" ); } writer.Write( " " ); --- 345,353 ---- for ( int i=0; i<fs.parameters.Count; i++ ) { ps = (ParamSet)fs.parameters[i]; ! writer.Write( " " ); ! writer.Write( "par_"+fs.name+i.ToString() ); ! writer.Write( " = " ); ! writer.Write( ps.name ); ! writer.Write( ";\n" ); } writer.Write( " " ); *************** *** 356,360 **** if (i<fs.parameters.Count-1) writer.Write( ", " ); } ! writer.Write( " );" ); writer.WriteLine( " }" ); --- 361,365 ---- if (i<fs.parameters.Count-1) writer.Write( ", " ); } ! writer.WriteLine( " );" ); writer.WriteLine( " }" ); Index: define.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/define.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** define.cs 12 Jul 2004 17:17:56 -0000 1.1.1.1 --- define.cs 19 Sep 2004 18:51:03 -0000 1.2 *************** *** 15,18 **** --- 15,20 ---- public class Define { + protected bool quiet=false; + /** \brief StreamWriter for ouput. * *************** *** 32,39 **** * @param w the StreamWriter instance which is used for output. */ ! public Define( StreamWriter w ) { Debug.Indent(); Debug.WriteLine( "Entering Define.Define(StreamWriter)" ); writer = w; list = new SortedList( System.Collections.Comparer.Default ); --- 34,42 ---- * @param w the StreamWriter instance which is used for output. */ ! public Define( StreamWriter w, bool _quiet ) { Debug.Indent(); Debug.WriteLine( "Entering Define.Define(StreamWriter)" ); + quiet = _quiet; writer = w; list = new SortedList( System.Collections.Comparer.Default ); *************** *** 67,72 **** while (q.Count>0) { s = (string)q.Dequeue(); // get nonrelevant key ! Console.Write( "Remove nonrelevant define: "); ! Console.WriteLine( s ); list.Remove( s ); // remove statement --- 70,77 ---- while (q.Count>0) { s = (string)q.Dequeue(); // get nonrelevant key ! if (!quiet) { ! Console.Write( "Remove nonrelevant define: "); ! Console.WriteLine( s ); ! } list.Remove( s ); // remove statement *************** *** 187,194 **** if (!list.ContainsKey(n)) { list.Add( n, i ); ! Console.Write( "Define: " ); ! Console.Write( n ); ! Console.Write( " := " ); ! Console.WriteLine( i ); } --- 192,201 ---- if (!list.ContainsKey(n)) { list.Add( n, i ); ! if (!quiet) { ! Console.Write( "Define: " ); ! Console.Write( n ); ! Console.Write( " := " ); ! Console.WriteLine( i ); ! } } Index: generator.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/generator.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** generator.cs 11 Sep 2004 19:36:36 -0000 1.9 --- generator.cs 19 Sep 2004 18:51:03 -0000 1.10 *************** *** 43,47 **** protected Configuration config; ! /** \brief The constructor Generator is the main entry point. --- 43,47 ---- protected Configuration config; ! protected bool quiet = false; /** \brief The constructor Generator is the main entry point. *************** *** 64,68 **** createClass(); } ! } Debug.WriteLine( "Exiting Generator.Generator(string[])" ); --- 64,75 ---- createClass(); } ! } else if (args.Length==2) { ! if ( (args[0] == "-q") || (args[0]=="--quiet") ) { ! quiet = true; ! Debug.WriteLine( "Loading Configuration" ); ! loadConfig( args[1] ); ! createClass(); ! } ! } Debug.WriteLine( "Exiting Generator.Generator(string[])" ); *************** *** 80,86 **** FileStream fs = new FileStream( config.outputFile, FileMode.Create, FileAccess.Write ); // Open or create file with write access writer = new StreamWriter( fs ); // bind stream to file ! define = new Define( writer ); // initialize define compiler ! typedef = new TypeDef( writer, config.baseTypes, config.DelegateAttribute ); // initialize typedef compiler ! function = new Function( writer, typedef, config.DllImportFlags, config.DllImportAttributes, config.linkLibrary, config.ignoreFunctions ); // initiaize function compiler writeHeader(); // write file header --- 87,93 ---- FileStream fs = new FileStream( config.outputFile, FileMode.Create, FileAccess.Write ); // Open or create file with write access writer = new StreamWriter( fs ); // bind stream to file ! define = new Define( writer, quiet ); // initialize define compiler ! typedef = new TypeDef( writer, config.baseTypes, config.DelegateAttribute, quiet ); // initialize typedef compiler ! function = new Function( writer, typedef, config.DllImportFlags, config.DllImportAttributes, config.linkLibrary, config.ignoreFunctions, quiet ); // initiaize function compiler writeHeader(); // write file header *************** *** 121,125 **** Debug.WriteLine( "Loading typdef statements" ); ! Console.Write( "Laoding typedef statements in " ); Console.WriteLine( (string)config.typedefFiles[i] ); try { --- 128,132 ---- Debug.WriteLine( "Loading typdef statements" ); ! Console.Write( "Loading typedef statements in " ); Console.WriteLine( (string)config.typedefFiles[i] ); try { |