Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Path expressions with dot and imports/packages
Path expressions with dot and imports/packages [message #1036572] Mon, 08 April 2013 14:57 Go to next message
Mariusz Mariusz is currently offline Mariusz MariuszFriend
Messages: 17
Registered: April 2012
Junior Member
I am trying to implement path expressions with dot (e.g. 'myClassInstance.attribute.anotherAttribute') in a language which already has import/packages support. The problem is that whatever I try, Xtext always recognizes it as an "unknown" package reference. In fact they look pretty much the same: as texts separated by a dot.

The closest example I have found was the post: Path expressions in entity models, but it uses '/' instead of the '.' And does not support packages. Thus this is not so similar to my problem.

Any ideas how to solve the problem?

[Updated on: Mon, 08 April 2013 14:57]

Report message to a moderator

Re: Path expressions with dot and imports/packages [message #1036787 is a reply to message #1036572] Mon, 08 April 2013 20:24 Go to previous messageGo to next message
Mariusz Mariusz is currently offline Mariusz MariuszFriend
Messages: 17
Registered: April 2012
Junior Member
I tried to use the syntactic predicate (=>) and looks better: after writing dot (e.g. instanceClass.) there is a correct hint from the IDE. Unfortunately after completing it (e.g. instanceClass.attribute) it is interpreted as an unknown package rather than an instance and its property.

Any hints/directions?
Re: Path expressions with dot and imports/packages [message #1036790 is a reply to message #1036787] Mon, 08 April 2013 20:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i guess there is no chance unless you do something yourself e.g. handling (nested) packages itself as elements.
(each thing between two dots a own reference)

depending on how your imports work this might be more or less easy


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Path expressions with dot and imports/packages [message #1037054 is a reply to message #1036790] Tue, 09 April 2013 06:05 Go to previous message
Mariusz Mariusz is currently offline Mariusz MariuszFriend
Messages: 17
Registered: April 2012
Junior Member
Christian Dietrich wrote on Mon, 08 April 2013 16:27
Hi,

i guess there is no chance unless you do something yourself e.g. handling (nested) packages itself as elements.
(each thing between two dots a own reference)

depending on how your imports work this might be more or less easy


Thanks - I will try this approach.
Previous Topic:Use Tab and Enter for Scobe
Next Topic:Code completion following ambiguous operator
Goto Forum:
  


Current Time: Thu Apr 25 12:02:58 GMT 2024

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

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

Back to the top