[metaas-dev] Expression Subinterfaces?
David Holroyd
dave at badgers-in-foil.co.uk
Thu Dec 20 08:49:23 UTC 2007
On Wed, Dec 19, 2007 at 09:58:08PM -0500, Matthew J Tretter wrote:
> what I was really trying to get at (and again, sorry for being unclear) was
> whether there's any way to retrieve an ASNewExpression,
> ASInvocationExpression, or any other Expression subinterface from the AST
> (as opposed to just a statement). I know you've said that Expression
> support is a relatively recent addition so it seems pretty likely this
> isn't yet possible but I wanted to make sure before I dove in and started
> messing with your source.
Oops, ok; There are only a few places where the API exposes
expressions, currently,
ASSwitchStatement#getCondition()
ASIfStatement#getCondition()
ASField#getInitializer()
so lots of the Statatement interfaces need extending.
FYI, I suspect that not all kinds of expression have a representative
interface yet (most of my own use of the API is for generating new code,
and I've just been extending the API when I want to generate a new
construct). I'm thinking of conditional-expressions 'a?b:c', and
'dot'-expressions 'a.b', which might be a property access or a class name
(but we can't tell without doing a bit more semantic analysys).
What changes would you like to make to the code? I'd be very happy to
help!
ta,
dave
--
http://david.holroyd.me.uk/
More information about the metaas-dev
mailing list