[metaas-dev] patch for additional statements

David Holroyd dave at badgers-in-foil.co.uk
Mon Jan 7 22:14:34 UTC 2008


Hi there!

On Mon, Jan 07, 2008 at 11:09:44AM +0100, R?mi Flament wrote:
> Thanks for MetaAS, it's a great tool.
> 
> I've done a checkout to have the last version but I had some errors 
> while parsing my source code, so I wrote a small patch.
> You can find it attached to this email.
> 
> It's a very simple patch, it just add some statements that 
> statementbuilder was unabled to understand (break, null, true, false, 
> and so on).

Many thanks for taking the time to contribute!

I've just had a quick look at your patch and I can integrate some
bits as they are.

But, I think that in several instances, new types of 'statement'
shouldn't be needed.  If things were functioning correctly, the AST
nodes in question should probably be wrapped within the existing
ASExpressionStatement type.

For instance, within a method body, the following,

  meth();

should cause metaas to produce an ASExpressionStatement who's expression
is an ASInvocationExpression.

This leads me to wonder how you came across errors where the
StatementBuilder encountered nodes like METHOD_CALL, rather than the
expected EXPR_STMNT?  Sounds like you found a bug in the Antlr grammar.


I will see if I can pull out the other usable pieces, add unit tests,
and integrate into the codebase.

For the rest, can you give some example code that causes the additional
entries in StatementBuilder to be needed?


Thank you again for helping!
dave

-- 
http://david.holroyd.me.uk/



More information about the metaas-dev mailing list