Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Inter grammar communication issue
Inter grammar communication issue [message #906711] Sun, 02 September 2012 09:47 Go to next message
attila Mising name is currently offline attila Mising nameFriend
Messages: 45
Registered: April 2010
Member
Hello ,

i'm splitting a larger grammar and i'm facing the following issue.

Highlighting the concept, the grammar deals with some master-detail "source" definitions and some master-detail "target" definitions which use the sources.

I'd like to move the "source" and "target" related stuff in different grammars.

The first grammar contains something like this:

Source1:
	name=ID
	elements+=Element1;

Source2:
	name=ID
	elements+=Element2;

Element1:
	name=ID;

Element2:
	name=ID;



I use these "sources" in a "target" so initially i had the following construct:

Source:
	Source1 | Source2;

Element:
	Element1 | Element2;

Target:
	name=ID source=[Source]
	features+=TargetElement;

TargetElement:
	name=ID source=[Element];



Now, when i reach a certain size in the second grammar, the impl/xxx.ecore gives "unresolved proxy exception" for the "Source" / "Element" constructs

For smaller size works as expected.

I use classSplitting = true in the mwe2 file

The initial grammars were built on xtext 1, i just upgraded to xtext 2.3.1

Any ideas about this ?


Thank you


[Updated on: Sun, 02 September 2012 11:11]

Report message to a moderator

Re: Inter grammar communication issue [message #907009 is a reply to message #906711] Mon, 03 September 2012 06:17 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Not sure I unerstood.
Assuming you rely on generated ecore models in both grammars, you would
have to introduce a common super type in sources for Soruce1 & Source2
as well as Element1 & Element2. You can do so by adding the following
two rules to your source grammar:

> Source:
> Source1 | Source2;
>
> Element:
> Element1 | Element2;

Now in the target grammar you need to import the gnerated ecore file and
setup the mwe file accordingly (see the documentation for details).

You should be able to have references to Source and Element now.

Sven


Am 9/2/12 11:47 AM, schrieb attila Mising name:
> Hello ,
> i'm splitting a larger grammar and i'm facing the following issue.
> Highlighting the concept, the grammar deals with some master-detail
> "source" definitions and some master-detail "target" definitions which
> use the sources.
>
> I'd like to move the "source" and "target" related stuff in different
> grammars, however seems i'm missing something.
>
> The first grammar contains something like this:
>
>
> Source1:
> name=ID
> elements+=Element1;
>
> Source2:
> name=ID
> elements+=Element2;
>
> Element1:
> name=ID;
>
> Element2:
> name=ID;
>
>
>
> I use these "sources" in a "target" so initially i had the following
> construct:
>
>
> Source:
> Source1 | Source2;
>
> Element:
> Element1 | Element2;
>
> Target:
> name=ID source=[Source]
> features+=TargetElement;
>
> TargetElement:
> name=ID source=[Element];
>
>
>
> Now i want to move the target related stuff in a new grammar but the
> "Source" / "Element" constructs do not work in this scenario [ contains
> an unresolved proxy error ].
> Using a generic super type [as far as i know] is not really an option as
> i still need to deal separately with the Elements [ each Element(i) is
> quite different from Element(j) ]:
>
>
> Element1 returns Element:
> name=ID;
>
> Element2 returns Element:
> name=ID;
>
>
> Any suggestion on how to make this work ? ...
>
> Thank you


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Inter grammar communication issue [message #907488 is a reply to message #907009] Tue, 04 September 2012 05:21 Go to previous message
attila Mising name is currently offline attila Mising nameFriend
Messages: 45
Registered: April 2010
Member
Thank you Sven, but the point of the message [ maybe shadowed by the details] was that after the second grammar grows over a certain size the Source/Element constructs are not visible due to " contains an unresolved proxy error " in the target ecore.
The weird part is that if i use Source1/Element1 [ the assigned calls ] in the second grammar it works

so: there are two grammars

g1 declares the sources, g2 declares the targets

everything works fine using the sources in targets

if g2 > certain_size the second ecore throws " contains an unresolved proxy error " for each of the unassigned calls from g1 used [i.e. Source /Element ]
However in this situation if i use in g2 the assigned calls [ any of the Source(n)/Element(n) instead of the Source/Element] it works

Luckily g2 could be further split into g2-1, g2-2 so i'm not blocked, but i still can't figure out the reason.

[Updated on: Tue, 04 September 2012 06:30]

Report message to a moderator

Previous Topic:Xtext Crossreference shadowing ID
Next Topic:Unique names validation - Builder required?
Goto Forum:
  


Current Time: Sat Dec 05 03:20:44 GMT 2020

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

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

Back to the top