Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » What is the syntax to set the antlr k option from the mwe2 file?
What is the syntax to set the antlr k option from the mwe2 file? [message #667690] Sun, 01 May 2011 12:38 Go to next message
drew frantz is currently offline drew frantzFriend
Messages: 340
Registered: July 2009
Senior Member
No Message Body
Re: What is the syntax to set the antlr k option from the mwe2 file? [message #667811 is a reply to message #667690] Mon, 02 May 2011 10:22 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
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
Re: What is the syntax to set the antlr k option from the mwe2 file? [message #667820 is a reply to message #667811] Mon, 02 May 2011 10:48 Go to previous messageGo to next message
drew frantz is currently offline drew frantzFriend
Messages: 340
Registered: July 2009
Senior Member
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
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 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
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
>
Previous Topic:How to deal with optional commas?
Next Topic:Xpand unexistent validation problem
Goto Forum:
  


Current Time: Fri Apr 26 10:10:06 GMT 2024

Powered by FUDForum. Page generated in 0.04261 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top