Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [TCS] Keywords
[TCS] Keywords [message #378502] Tue, 17 July 2007 11:34 Go to next message
Eclipse User
Originally posted by: remi.viaux.mbda-systems.com

Hi,

My problem is that I want to identify two distincts entities which begin
with the same identifier.
Here is the code I want to parse :

typedef type name;
typedef struct { ... } name;

(it's the C declaration of type of course)

Is it possible to use a keyword composed by 2 words in the template ?
because something like this doesn't work :

template Typedef
: "typedef" type name
;

template Struct
: "typedef struct" -- or "typedef" "struct"
type name
;

Those templates always recognize a single typedef element.

Thanks for the help.

Remi Viaux
Re: [TCS] Keywords [message #378506 is a reply to message #378502] Wed, 18 July 2007 09:05 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric Jouault
Messages: 572
Registered: July 2009
Senior Member
Hello,

"typedef struct" is not valid, but "typedef" "struct" is.

If you get no ambiguity warning from ANTLR then it should work.

Can you please check whether you have such messages or not?


Regards,

Frédéric Jouault


Remi Viaux wrote:
> Hi,
>
> My problem is that I want to identify two distincts entities which begin
> with the same identifier. Here is the code I want to parse :
>
> typedef type name;
> typedef struct { ... } name;
>
> (it's the C declaration of type of course)
>
> Is it possible to use a keyword composed by 2 words in the template ?
> because something like this doesn't work :
>
> template Typedef
> : "typedef" type name
> ;
>
> template Struct
> : "typedef struct" -- or "typedef" "struct"
> type name
> ;
>
> Those templates always recognize a single typedef element.
>
> Thanks for the help.
>
> Remi Viaux
>
>
Re: [TCS] Keywords [message #378510 is a reply to message #378506] Wed, 18 July 2007 09:28 Go to previous message
Eclipse User
Originally posted by: remi.viaux.mbda-systems.com

Hi Frédéric,

"typedef" "struct" works !
I don't have any ambiguity warning from ANTLR.
Thanks.

Regards,

Remi Viaux

Frédéric Jouault wrote:

> Hello,

> "typedef struct" is not valid, but "typedef" "struct" is.

> If you get no ambiguity warning from ANTLR then it should work.

> Can you please check whether you have such messages or not?


> Regards,

> Frédéric Jouault


> Remi Viaux wrote:
>> Hi,
>>
>> My problem is that I want to identify two distincts entities which begin
>> with the same identifier. Here is the code I want to parse :
>>
>> typedef type name;
>> typedef struct { ... } name;
>>
>> (it's the C declaration of type of course)
>>
>> Is it possible to use a keyword composed by 2 words in the template ?
>> because something like this doesn't work :
>>
>> template Typedef
>> : "typedef" type name
>> ;
>>
>> template Struct
>> : "typedef struct" -- or "typedef" "struct"
>> type name
>> ;
>>
>> Those templates always recognize a single typedef element.
>>
>> Thanks for the help.
>>
>> Remi Viaux
>>
>>
Re: [TCS] Keywords [message #602311 is a reply to message #378502] Wed, 18 July 2007 09:05 Go to previous message
Frédéric Jouault is currently offline Frédéric Jouault
Messages: 572
Registered: July 2009
Senior Member
Hello,

"typedef struct" is not valid, but "typedef" "struct" is.

If you get no ambiguity warning from ANTLR then it should work.

Can you please check whether you have such messages or not?


Regards,

Frédéric Jouault


Remi Viaux wrote:
> Hi,
>
> My problem is that I want to identify two distincts entities which begin
> with the same identifier. Here is the code I want to parse :
>
> typedef type name;
> typedef struct { ... } name;
>
> (it's the C declaration of type of course)
>
> Is it possible to use a keyword composed by 2 words in the template ?
> because something like this doesn't work :
>
> template Typedef
> : "typedef" type name
> ;
>
> template Struct
> : "typedef struct" -- or "typedef" "struct"
> type name
> ;
>
> Those templates always recognize a single typedef element.
>
> Thanks for the help.
>
> Remi Viaux
>
>
Re: [TCS] Keywords [message #602328 is a reply to message #378506] Wed, 18 July 2007 09:28 Go to previous message
Eclipse User
Originally posted by: remi.viaux.mbda-systems.com

Hi Frédéric,

"typedef" "struct" works !
I don't have any ambiguity warning from ANTLR.
Thanks.

Regards,

Remi Viaux

Frédéric Jouault wrote:

> Hello,

> "typedef struct" is not valid, but "typedef" "struct" is.

> If you get no ambiguity warning from ANTLR then it should work.

> Can you please check whether you have such messages or not?


> Regards,

> Frédéric Jouault


> Remi Viaux wrote:
>> Hi,
>>
>> My problem is that I want to identify two distincts entities which begin
>> with the same identifier. Here is the code I want to parse :
>>
>> typedef type name;
>> typedef struct { ... } name;
>>
>> (it's the C declaration of type of course)
>>
>> Is it possible to use a keyword composed by 2 words in the template ?
>> because something like this doesn't work :
>>
>> template Typedef
>> : "typedef" type name
>> ;
>>
>> template Struct
>> : "typedef struct" -- or "typedef" "struct"
>> type name
>> ;
>>
>> Those templates always recognize a single typedef element.
>>
>> Thanks for the help.
>>
>> Remi Viaux
>>
>>
Previous Topic:[AM3] Exception on startup
Next Topic:[TCS]About NullPointerException
Goto Forum:
  


Current Time: Fri Sep 19 01:53:02 GMT 2014

Powered by FUDForum. Page generated in 0.01791 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software