Skip to main content



      Home
Home » Archived » GMT (Generative Modeling Technologies) » [TCS] Keywords
[TCS] Keywords [message #378502] Tue, 17 July 2007 07:34 Go to next message
Eclipse UserFriend
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 05:05 Go to previous messageGo to next message
Eclipse UserFriend
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 05:28 Go to previous message
Eclipse UserFriend
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 05:05 Go to previous message
Eclipse UserFriend
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 05:28 Go to previous message
Eclipse UserFriend
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: Wed May 07 14:17:33 EDT 2025

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

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

Back to the top