|Re: Xtext C grammar [message #878599 is a reply to message #878579]
||Tue, 29 May 2012 15:28
| Ed Willink
Registered: July 2009
IMHO C/C++ is two languages, a preprocessor language with #directives
and non-trivial recursive properties, and a real language thereafter.
Attempting to process both languages at once is an almost guarantee of
failure on corner cases.
If you preprocess, or borrow an existing preprocessor, #line directives
are conventionally implanted to allow the context of errors from the
second language to be reported in the line numbers of the first.
On 29/05/2012 15:53, Henrik Lindberg wrote:
> On 2012-29-05 15:30, Oleg Bolshakov wrote:
>> Hello, is there any xtext grammar for C language?
> Don't think so, at least not a complete implementation. C is a
> language that is known to be difficult to parse due to macros,
> includes etc. (And by "difficult" I mean "you have to be an expert and
> be willing to add support for macros and includes to Xtext").
> If you want to link to elements defined in C, maybe there is some way
> to link to a model maintained by something like CDT (don't know if it
> is backed by a model though).
> - henrik
Powered by FUDForum
. Page generated in 0.01491 seconds