BUGS ---- * Implenment Array Initialization * FindMembers Move our utility FindMembers from TypeContainer to Decl, because interfaces are also scanned with it. * Visibility I am not reporting errors on visibility yet. * Enumerations They currently can not be defined in terms of other enumerations or constants. * Known problems: Cast expressions They should should use: OPEN_PARENS type CLOSE_PARENS instead of the current production which is wrong, because it only handles a few cases. Complex casts like: Array r = (string []) object Wont be parsed. * Interfaces For indexers, the output of ix2.cs is different from our compiler and theirs. They use a DefaultMemberAttribute, which I have yet to figure out: .class interface private abstract auto ansi INTERFACE { .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. ... } * Interface indexers I have not figured out why the Microsoft version puts an `instance' attribute, and I am not generating this `instance' attribute. Explanation: The reason for the `instance' attribute on indexers is that indexers only apply to instances * In class.cs: Method.Define Need to use FindMembers to lookup the member for reporting whether a new is needed or not. * Foreach on structure returns does not work I am generating invalid code instead of calling ldarga for the structure, I am calling ldarg: struct X { public IEnumerator GetEnumerator (); } X x; foreach (object a in x){ ... } I need to get the address of that bad boy * Handle destructors specially Turn ~X () { a () } into: void Finalize () { try { a (); } finally { base.Finalize (); } } * Method Names Method names could be; `IFACE.NAME' in the method declaration, stating that they implement a specific interface method. We currently fail to parse it. * Namespaces Apparently: namespace X { } namespace X { } Is failing to create a single namespace * Arrays We need to make sure at *compile time* that the arguments in the expression list of an array creation are always positive. * Fix access to variables of type ref/out * Implement dead code elimination in statement.cs It is pretty simple to implement dead code elimination in if/do/while * Implement short circuit evaluation. Currently our and/or operations do not implement short circuit evaluation. * Foreach and arrays Support foreach (T t in Array) And optimize to deal with the array rather than getting the enumerator out of it. * Indexer bugs: the following wont work: x [0] = x [1] = N if x has indexers, the value of x [N] set is set to void. This needs to be fixed. * Array declarations Multi-dim arrays are declared as [,] instead of [0..,0..] * Variables Things like: for (int i = 0; ...; i++){ } for (int i = 0; i < 10; i++){ } Currently defines `i' for the rest of the execution after the first loop, so the second loop generates an error. I think we should pop all the blocks until this point. PENDING TASKS ------------- * Implement Using. * Implement Goto. * Implement Switch. * Unsafe code. * Using Alias Need to reset the aliases for each compilation unit, so an alias defined in a file does not have any effect on another one: File.cs ======= namespace A { using X = Blah; class Z : X { <-- This X is `Blah' } File2.cs namespace { class Y : X { <-- This X Is not `Blah' } } I think we can implement Aliases by having an `Alias' context in all the toplevel TypeContainers of a compilation unit. The children typecontainers just chain to the parents to resolve the information. The driver advances the Alias for each file compiled, so that each file has its own alias set. * Handle volatile * Support Re-Throw exceptions: try { X (); } catch (SomeException e){ LogIt (); throw; } * Static flow analysis Required to warn about reachability of code and definite assignemt as well as missing returns on functions. OPTIMIZATIONS ------------- * Emitcontext Do we really need to instanciate this variable all the time? It could be static for all we care, and just use it for making sure that there are no recursive invocations on it. * Static-ization Since AppDomain exists, maybe we can get rid of all the stuff that is part of the `compiler instance' and just use globals everywhere. * Constructors Currently it calls the parent constructor before initializing fields. It should do it the other way around. * Reducer and -Literal Maybe we should never handle -Literal in Unary expressions and let the reducer take care of it always? * Use of EmitBranchable Currently I use brfalse/brtrue in the code for statements, instead of using the EmitBranchable function that lives in Binary * Create an UnimplementedExpcetion And use that instead of plain Exceptions to flag compiler errors. * ConvertImplicit Currently ConvertImplicit will not catch things like: - IntLiteral in a float context to generate a -FloatLiteral. Instead it will perform an integer load followed by a conversion. * Tests Write tests for the various reference conversions. We have test for all the numeric conversions. * Remove the tree dumper And make all the stuff which is `public readonly' be private unless required. * Optimizations In Indexers and Properties, probably support an EmitWithDup That emits the code to call Get and then leaves a this pointer in the stack, so that later a Store can be emitted using that this pointer (consider Property++ or Indexer++) RECOMMENDATIONS --------------- * Use of lexer.Location in the parser Currently we do: TOKEN nt TERMINAL nt TERMINAL nt3 { $$ = new Blah ($2, $4, $6, lexer.Location); } This is bad, because the lexer.Location is for the last item in `nt3' We need to change that to use this pattern: TOKEN { $$ = lexer.Location } nt TERMINAL nt TERMINAL nt3 { $$ = new Blah ($3, $5, $7, (Location) $2); } Notice how numbering of the arguments changes, as the { $$ = lexer.Location } takes up a number * local_variable_declaration Not sure that this grammar is correct, we might have to resolve this during semantic analysis.