Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] LR parser and LPG version

Hi Doug,

>> Xtext is a very interesting technology but its my understanding that they
>> are focused on small domain specific languages, and they certainly don't
>> have support for the C preprocessor.
>>
> Yeah, that was my feeling as well. But it's very similar to ANTLR and
>actually uses ANTLR under the covers. I imagine you could get it to do C
>preprocessing if you had to. But I think there are other things missing,
>like AST node locations, that would make it difficult to do things like
open
>decl and refactoring. I was considering it for Makefile or qmake file
>parsing, but we'll see how far I get before bailing and just handwriting a
>parser.

In fact Xtext manages a fine grained parse tree, containing the offsets and
lengths of each token, as well as a trace to the grammar and the
corresponding AST node. Things like Open Declaration, Find References or
even Open Element are supported out of the box.
Also Xtext is not focused on DSL development specifically, but programming
language development in general. However, Xtext so far doesn't support
semantic predicates, which might be needed for C or C++ to parse. I'm not
sure because I'm not an expert regarding C (or its preprocessor).

Cheers,
Sven
-- 
View this message in context: http://old.nabble.com/LR-parser-and-LPG-version-tp27756675p27818222.html
Sent from the Eclipse CDT - Development mailing list archive at Nabble.com.



Back to the top