The conversion of an expression to a string has been moved to the generator because a function may have been renamed or converted to a property.
However, since that string is language-specific, it should be created in the generator anyway. Therefore we should (over time):
1. Move any string manipulation from the pass for default args to the printer for expressions which is in turn used only by the generator;
2. Remove the Statement.String property (when 1. is entirely complete).
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
We need Driver.TargeInfo in CSharpTypePrinter so that we can find out the
widths of the integer types.
This patch changes CSharpTypePrinter to get the Driver reference in its
constructor. As all the other constructor parameters can be found from the
Driver reference, we can remove all the other parameters.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
Now the whitespace/new line handling is done by the output generator per block, instead of having to be managed manually which could lead to all sorts of messy output without being extra careful.
Also the new system limits the usage of generics since C# was too limited to design it properly, and it ended up being more trouble than it was worth. The blocks kinds were also changed to be const int, since enums are very hard to extend and made it hard to provide a common interface for dealing with blocks.