[antlr-interest] Can "returns" return an aggregate?

Jim Idle jimi at temporal-wave.com
Sat May 29 15:18:52 PDT 2010


You might have more success if you said what target you were using :-) Also remember antlr.markmail.com.

The generated routines already return a struct, so you cannot put a struct in that struct. You need to return a pointer to a struct.

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Bob
> Sent: Friday, May 28, 2010 5:06 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Can "returns" return an aggregate?
> 
> Is there a way to return an aggregate ?
> 
> 
> 
> struct A { int m; double n; };
> 
> extern struct A foo(void);
> 
> 
> 
> myrule returns [struct A a]
> 
>     : X
> 
>      { $a = foo(); }
> 
>   ;
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address





More information about the antlr-interest mailing list