On 9/18/07, Jon Pierce <[EMAIL PROTECTED]> wrote:
> Reflection could be used to look up and invoke the constructor with
> appropriately-typed arguments.  If we assume only "primitive" types
> and ValueSources are used, I don't think it would be too hard to craft
> a drop-in replacement that works with existing implementations.  In
> any case, the more flexible alternative would probably be to do as
> you're suggesting (if I understand you correctly) -- let the function
> handle the parsing,

The parser is a quick hack I threw together, and any value source
factories should not be exposed to it.  It seems like either
1) a value source factory would expose the types it expects
or
2) a value source factory would take a List<ValueSource> and throw a
ParseException if it didn't get what it expected

Reflection might be fine if the cost of construction via reflection
ends up being small compared to the parsing itself.

-Yonik

Reply via email to