[metaas-dev] patch for additional statements

Rémi Flament rflament at laposte.net
Sat Jan 12 15:19:58 UTC 2008


Hi,

I can't send you the code that causes the errors, but I've managed to 
isolate different cases.

I've attached 3 files which contains cases that crashes the parser. 
Basically it seems that the parser doesn't support this syntax :

if (bla) doSomething();

but only

if (bla) { doSomething(); }

It seems to be ok for the "else" statement though.

Rémi.

David Holroyd a écrit :
> 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
>
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: case1.as
Type: application/x-applix-spreadsheet
Size: 602 bytes
Desc: not available
Url : http://lists.badgers-in-foil.co.uk/pipermail/metaas-dev/attachments/20080112/ed8b840a/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: case2.as
Type: application/x-applix-spreadsheet
Size: 577 bytes
Desc: not available
Url : http://lists.badgers-in-foil.co.uk/pipermail/metaas-dev/attachments/20080112/ed8b840a/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: case3.as
Type: application/x-applix-spreadsheet
Size: 590 bytes
Desc: not available
Url : http://lists.badgers-in-foil.co.uk/pipermail/metaas-dev/attachments/20080112/ed8b840a/attachment-0002.bin 


More information about the metaas-dev mailing list