Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

System.Reflection.Emit 'side streams'?

I have a need for a very stripped-down script compiler. For simplicity's sake, I'd like to do this with a recursive descent parser that spits out code in its single pass. I have an issue with implicit type conversion - you don't know that you need to emit lexpr type conversion code until you have generated the rexpr code.

A simple solution would be to open a 'side stream' for the rexpr, and then potentially add type conversion code to the lexpr on the 'main stream' before concatenating the side stream. Is there any way to do this with the Emit namespace? I've been over and over it, and can't seem to locate any such functionality.

Failing that, how can a one-pass compiler handle lexpr type conversions?

Jon Shemitz
Friday, December 20, 2002

*  Recent Topics

*  Fog Creek Home