|
|
|
|
Re: grammar with implicit variable declarations [message #652524 is a reply to message #651514] |
Fri, 04 February 2011 11:39 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Marco,
yes, all objects are instantiated prior to the linking. The next step is
the installation of proxies instead of actual references. This allows to
leverage EMF's proxy semantics that is a reference will be transparently
resolved when someone navigates along its path.
Cyclic resolution can happen when your scope provider implementation
contains a bug.
Consider the following artificial example:
entity A extends B {}
entity B {}
The parser would instantiate two entities, one name A, another B.
The LazyLinker would install a proxy for the extends B. When this proxy
is going to be resolved, the call chain will finally end up in your
scope provider e.g. in
scope_Entity_extends(Entity a, EReference extendsRef) {
..
}
Now comes the tricky part (which is not that tricky in this stupid
example. You have to resolve the extends relationship without invoking
a.getExtends() because this would be a reentrant call to the proxy
resolution mechanism and thereby lead to cyclic resolution errors. That
is the only restriction that Xtext has with respect to cyclic resolutions.
Does that clarifiy things?
To conclude: I'd expect that your code or your "specification" has a bug
that does not allow resolve the scenario that you mentionend in your
first post.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 31.01.11 14:58, schrieb Marco:
> Hi Sebastian,
>
> I do not blame at all. I ask for help.
>
> Sven made a suggestion about creating objects for unresolveable
> references, which I guess was followed by others too.
>
> My use case combines this with another requirement which might not be
> that uncommon: cyclic references.
>
> I do not know the process of linking in that detail, and hope that
> somebody can give me hints about what could cause the described issue.
>
> I simply do not understand what makes the resolution of a cyclic
> reference different from the resolution of other references?
>
> What mechanism allows to make forward references? All objects are
> instantiated before the references are resolved, right? So what can then
> make the difference between forward, backward, and cyclic references?
>
> Thanks,
> Marco
|
|
|
Powered by
FUDForum. Page generated in 0.07432 seconds