|
|
|
Re: What is the syntax to set the antlr k option from the mwe2 file? [message #667847 is a reply to message #667820] |
Mon, 02 May 2011 12:33 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Drew,
that sounds like you should set the 'k' option only for a particular
decision in the grammar. Therefore I'd recommend to use syntactic
predicates if (and only if) your are on Xtext 2.0.
Another approach is to model the qualified names as navigation
expressions with sort of virtual nodes, e.g.
java.lang.String could be [java][lang][String] instead of
[java.lang.String].
More concrete suggestions are imaginablw if someone could review your
language.
Hope that helps,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 02.05.11 12:48, schrieb Drew:
> I am trying to solve a grammar issue that picks the wrong rule in my
> expression grammar.
>
> We allow expression of the type function-call obj.method(arg1, arg2) as
> well as qualified names as an expression obj.attr, the problem is that
> the latter are all recognized as function calls. The grammar is fairly
> complicated (1100 lines) (part of which I inherited from someone that is
> no longer on the project) and I have run out of ideas on how to factor
> the expression section so that I can resolve this issue
>
>
>
> "Sebastian Zarnekow" <Sebastian.Zarnekow@itemis.de> wrote in message
> news:ipm01g$j3t$1@news.eclipse.org...
>> Am 01.05.11 14:38, schrieb Drew:
>>>
>>
>> Why do you need it?
>>
>> It's not possible to that with the default AntlrOptions. In case you
>> really need that, you'll have to extend that class with your own and
>> provide something like
>>
>> setAntlrKAsString(String k) {
>> super.setK(Integer.parseInt(k));
>> }
>>
>> Regards,
>> Sebastian
>> --
>> Need professional support for Eclipse Modeling?
>> Go visit: http://xtext.itemis.com
>
|
|
|
Powered by
FUDForum. Page generated in 0.04261 seconds