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,
JensG


-----Ursprüngliche Nachricht----- From: Taras Tielkes
Sent: Tuesday, November 26, 2013 7:26 PM
To: [email protected]
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.

Cheers,
-tt

[1] http://thrift.apache.org/docs/idl/
[2] http://plugins.jetbrains.com/plugin/7331?pr=idea



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

Yes.
________________________________
Von: Taras Tielkes
Gesendet: 26.11.2013 15:24
An: [email protected]
Betreff: Using struct types in typedef

Hi,

Can I refer to a struct type in a typedef?
The grammar at http://thrift.apache.org/docs/idl/ does not seem to clear
on
this.

Thanks,
-tt


Reply via email to