Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Extending GCC parser

Hi Alex,

Thanks for the reply. If you are already making good progress with the DOM parser then you are better off just sticking with it. Trying to make sense of two very different parsers at the same time will probably be overwhelming. Besides, the LR parser is a bit of a moving target because I am still actively developing it, and I still make architecture changes from time to time. That's why there's not much documentation yet. (Actually there is a page on the CDT wiki but its way out of date now). You're right that without a proper tutorial its difficult to know where to begin. I probably won't have time to write one until some point after the release.

Mike Kucera
Software Developer
IBM Eclipse CDT Team
mkucera@xxxxxxxxxx

Inactive hide details for Alex Blewitt ---04/07/2009 04:44:54 PM---On 7 Apr 2009, at 17:05, Mike Kucera wrote:Alex Blewitt ---04/07/2009 04:44:54 PM---On 7 Apr 2009, at 17:05, Mike Kucera wrote:


From:

Alex Blewitt <alex.blewitt@xxxxxxxxx>

To:

"CDT General developers list." <cdt-dev@xxxxxxxxxxx>

Date:

04/07/2009 04:44 PM

Subject:

Re: [cdt-dev] Extending GCC parser




On 7 Apr 2009, at 17:05, Mike Kucera wrote:

> Hi Alex,
>
> I'm curious to know why you have chosen to extend the DOM parser  
> instead of the LR parser. The LR parser is new but it was designed  
> specifically to be easily extended to add support for new C-based  
> languages like ObjectiveC. If you have run into problems or concerns  
> with the LR parser I would like to know what they are.
>
> Plus with the LR parser all the API you need to create the parser is  
> public (although all the API is "provisional" meaning we can change  
> it anytime if needed).
>
Hi Mike,

I'm still finding (stumbling?) my way through CDT at the moment, and  
I'm still confused by the array of parsers (for different variants of  
C, like C99 and GNUC and .... not to mention the whole DOM vs LR  
issue :-)

I spent a bit of time at EclipseCon talking with Markus Schorn about  
the Objective C support, and how the whole CDT was put together. In  
the course of a quick run-through of how it fits together, we stepped  
through the DOM parser and thought that e.g. the parseDeclaration and  
_expression_() would be good injection points for the Objective-C  
syntax. As it happens, I've got a bit of code that detects Objective-C  
calls in a C _expression_ now, although it  constructs a placeholder  
ASTNode rather than anything specific at the moment.

I'm not sure how to get started with the LRParser or how to extend it.  
The RuleAction code looks like it's being automatically generated from  
something, but I don't know where the rule number or rules are being  
defined. I also don't have a grammar for objective c files :-) In  
fact, I don't think there is a standard grammar - it's mostly defined  
by its implementation.

So, if you have any pointers on how to get started with the LR parser  
then I could take a look; but the reason I've not run into problems is  
I can't find the starting line :-)

Alex
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


GIF image

GIF image


Back to the top