[TCS] Keywords [message #378502] |
Tue, 17 July 2007 11:34 |
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 #378510 is a reply to message #378506] |
Wed, 18 July 2007 09:28 |
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 #602328 is a reply to message #378506] |
Wed, 18 July 2007 09:28 |
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
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03425 seconds