thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Geyer" <>
Subject Re: Using struct types in typedef
Date Tue, 26 Nov 2013 20:19:53 GMT
Hi Taras,

you may be right regarding the grammar definition. A few days ago I tried to 
use the Thrift grammar for some other purpose but ended up comparing 
Lexx/Yacc code/grammar against the web site grammar, correcting and changing 
to get it useable for what I planned to do with it. The reason may be that a 
good part of that formal grammar is not really existing as a grammar, 
instead only exist as logic cast into C++ code. So there are differences, 
and there are things that are not expressed in the gramar (especially 
annotations are missing at a number of places in the grammar).

If you should open a JIRA ... I'd say yes, simply because it is not 
completely correct as it is today.

Regarding your original question: Yes, it works and things like the 
following are possible (and thanks to your question I've spotted a minor bug 
in the Delphi codegenerator):

struct Details
    1: optional double   a
    2: optional byte       b
    3: optional string     c

typedef Details  Details2

typedef list<Details>  Detlist

service foobar {
     void DoIt( 1 : Details2 somedata; 2: Detlist somelist)

Can't tell anything about the IntelliJ IDEA plugin. Chances are, that there 
are some incompatibilities, especially if they use a modified grammar.

Have fun,

-----Urspr√ľngliche Nachricht----- 
From: Taras Tielkes
Sent: Tuesday, November 26, 2013 7:26 PM
Subject: Re: Using struct types in typedef

In that case, is the grammar definition [1] incomplete, and should I file a
JIRA bug for that? Or am I misinterpreting the definition of DefinitionType?
I'm asking since the IntelliJ Thrift plugin [2], which is based on an
adapted version of that grammar, marks such constructs as invalid.



On Tue, Nov 26, 2013 at 6:47 PM, Jens Geyer <> wrote:

> Yes.
> ________________________________
> Von: Taras Tielkes
> Gesendet: 26.11.2013 15:24
> An:
> Betreff: Using struct types in typedef
> Hi,
> Can I refer to a struct type in a typedef?
> The grammar at does not seem to clear
> on
> this.
> Thanks,
> -tt

View raw message