Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » resolve EClass from base grammar during post processing
resolve EClass from base grammar during post processing [message #1410713] Thu, 21 August 2014 12:45 Go to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 251
Registered: July 2009
Senior Member
Hi,

I have a very special kind of problem.

My grammar derives from another grammar (also written by me).
I have a post processor in place which does some tweaks to the generated model.
This works excellent for various cases with one exception.

If I access a type which is inferred from the base grammar (using the generated BasePackage.eINSTANCE) then I can use it e.g. as a
return type of an operation.
In the debugger I verified that the EClass object is correctly resolved.
But the serialized ecore model then contains proxy URLs for those types.

On the other hand if I use e.g. ECorePackage.eINSTANCE.getEClassifier("EBoolean") then all works fine.

How can I resolve this issue?

Thanks,
Henrik
Re: resolve EClass from base grammar during post processing [message #1410720 is a reply to message #1410713] Thu, 21 August 2014 13:01 Go to previous messageGo to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 251
Registered: July 2009
Senior Member
PS: during my further tries I introduced a bug in the post processor which rendered the folder for the generated EMF classes
empty. After I fixed the bug and re-generated the issue below was resolved.
I have no idea though why it works now since I basically didn't change anything :-/

Am 21.08.2014 um 14:45 schrieb Henrik Rentz-Reichert:
> Hi,
>
> I have a very special kind of problem.
>
> My grammar derives from another grammar (also written by me).
> I have a post processor in place which does some tweaks to the generated model.
> This works excellent for various cases with one exception.
>
> If I access a type which is inferred from the base grammar (using the generated BasePackage.eINSTANCE) then I can use it e.g. as a
> return type of an operation.
> In the debugger I verified that the EClass object is correctly resolved.
> But the serialized ecore model then contains proxy URLs for those types.
>
> On the other hand if I use e.g. ECorePackage.eINSTANCE.getEClassifier("EBoolean") then all works fine.
>
> How can I resolve this issue?
>
> Thanks,
> Henrik
>
Re: resolve EClass from base grammar during post processing [message #1411014 is a reply to message #1410720] Fri, 22 August 2014 07:05 Go to previous messageGo to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 251
Registered: July 2009
Senior Member
I again got stuck and am not able to resolve this issue.

Any help is appreciated.

Thanks,
Henrik

Am 21.08.2014 um 15:01 schrieb Henrik Rentz-Reichert:
> PS: during my further tries I introduced a bug in the post processor which rendered the folder for the generated EMF classes
> empty. After I fixed the bug and re-generated the issue below was resolved.
> I have no idea though why it works now since I basically didn't change anything :-/
>
> Am 21.08.2014 um 14:45 schrieb Henrik Rentz-Reichert:
>> Hi,
>>
>> I have a very special kind of problem.
>>
>> My grammar derives from another grammar (also written by me).
>> I have a post processor in place which does some tweaks to the generated model.
>> This works excellent for various cases with one exception.
>>
>> If I access a type which is inferred from the base grammar (using the generated BasePackage.eINSTANCE) then I can use it e.g. as a
>> return type of an operation.
>> In the debugger I verified that the EClass object is correctly resolved.
>> But the serialized ecore model then contains proxy URLs for those types.
>>
>> On the other hand if I use e.g. ECorePackage.eINSTANCE.getEClassifier("EBoolean") then all works fine.
>>
>> How can I resolve this issue?
>>
>> Thanks,
>> Henrik
>>
Re: resolve EClass from base grammar during post processing [message #1412631 is a reply to message #1411014] Tue, 26 August 2014 16:46 Go to previous message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 251
Registered: July 2009
Senior Member
here is a line of the ecore model that is produced by Xtext

<eClassifiers xsi:type="ecore:EClass" name="ActorClass" eSuperTypes="#//ActorContainerClass
platform:/resource/org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//ModelComponent">

after I correct it manually it reads

<eClassifiers xsi:type="ecore:EClass" name="ActorClass" eSuperTypes="#//ActorContainerClass
.../../../../../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//ModelComponent">

So it looks like the platform:/ scheme isn't working


Am 22.08.2014 um 09:05 schrieb Henrik Rentz-Reichert:
> I again got stuck and am not able to resolve this issue.
>
> Any help is appreciated.
>
> Thanks,
> Henrik
>
> Am 21.08.2014 um 15:01 schrieb Henrik Rentz-Reichert:
>> PS: during my further tries I introduced a bug in the post processor which rendered the folder for the generated EMF classes
>> empty. After I fixed the bug and re-generated the issue below was resolved.
>> I have no idea though why it works now since I basically didn't change anything :-/
>>
>> Am 21.08.2014 um 14:45 schrieb Henrik Rentz-Reichert:
>>> Hi,
>>>
>>> I have a very special kind of problem.
>>>
>>> My grammar derives from another grammar (also written by me).
>>> I have a post processor in place which does some tweaks to the generated model.
>>> This works excellent for various cases with one exception.
>>>
>>> If I access a type which is inferred from the base grammar (using the generated BasePackage.eINSTANCE) then I can use it e.g. as a
>>> return type of an operation.
>>> In the debugger I verified that the EClass object is correctly resolved.
>>> But the serialized ecore model then contains proxy URLs for those types.
>>>
>>> On the other hand if I use e.g. ECorePackage.eINSTANCE.getEClassifier("EBoolean") then all works fine.
>>>
>>> How can I resolve this issue?
>>>
>>> Thanks,
>>> Henrik
>>>
Previous Topic:Slow typing of dsl language, only at the bottom of the document in the dsl editor.
Next Topic:References across files
Goto Forum:
  


Current Time: Sat Dec 14 15:31:27 GMT 2019

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

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

Back to the top