Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Dealing with EMF model and parser error
Dealing with EMF model and parser error [message #719252] Fri, 26 August 2011 13:55 Go to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Hi,
when there is a parser error in a resource, the EMF model is incomplete.
What is the preferred way to avoid NPEs? Check everything for being not
null, although it should not be null when it is required? Or get to know
that there are parser errors in that resource and cancel the operation?
Is there an easy way to get this information from a Resource?

--
Best regards,
Sebastian Paul
Re: Dealing with EMF model and parser error [message #719289 is a reply to message #719252] Fri, 26 August 2011 15:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you find the answer here
http://wiki.eclipse.org/Xtext/FAQ#How_do_I_load_my_model_in_a_standalone_Java_application.C2.A0.3F

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Dealing with EMF model and parser error [message #719870 is a reply to message #719289] Mon, 29 August 2011 09:15 Go to previous messageGo to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Hi,
thanks for the link, but I cannot find the answer.
My question was not around loading models. My model is already loaded in
an Eclipse environment, and I want to know how to deal with parser
errors respectivily incomplete models.

Am 2011-08-26 17:44, schrieb Christian Dietrich:
> Hi,
>
> you find the answer here
> http://wiki.eclipse.org/Xtext/FAQ#How_do_I_load_my_model_in_a_standalone_Java_application.C2.A0.3F
>
>
> ~Christian


--
Best regards,
Sebastian Paul
Re: Dealing with EMF model and parser error [message #719871 is a reply to message #719289] Mon, 29 August 2011 09:15 Go to previous messageGo to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Hi,
thanks for the link, but I cannot find the answer.
My question was not around loading models. My model is already loaded in
an Eclipse environment, and I want to know how to deal with parser
errors respectivily incomplete models.

Am 2011-08-26 17:44, schrieb Christian Dietrich:
> Hi,
>
> you find the answer here
> http://wiki.eclipse.org/Xtext/FAQ#How_do_I_load_my_model_in_a_standalone_Java_application.C2.A0.3F
>
>
> ~Christian


--
Best regards,
Sebastian Paul
Re: Dealing with EMF model and parser error [message #719872 is a reply to message #719870] Mon, 29 August 2011 09:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i actually meant this

Quote:

Potential parse errors are available as resource.getErrors().


~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Dealing with EMF model and parser error [message #719894 is a reply to message #719872] Mon, 29 August 2011 11:05 Go to previous messageGo to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Ah ok, thanks!

Am 2011-08-29 11:26, schrieb Christian Dietrich:
> Hi,
>
> i actually meant this
>
> Quote:
>> Potential parse errors are available as resource.getErrors().
>
>
> ~Christian


--
Best regards,
Sebastian Paul
Re: Dealing with EMF model and parser error [message #721253 is a reply to message #719252] Thu, 01 September 2011 09:06 Go to previous messageGo to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Hi,
is there also a way to get validation errors (e.g. parser errors or
constraint violation) from a given IEObjectDescription or
IResourceDescription without loading the resource? The information is
already there, as it is shown in Problems View and Markers...
I get the mentioned objects from the injected IResourceDescriptions,
which is provided by the builder fragment.

--
Best regards,
Sebastian Paul
Re: Dealing with EMF model and parser error [message #722453 is a reply to message #721253] Mon, 05 September 2011 20:08 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Sebastian,

you could try to obtain them from the markers on the IFile that
corresponds to the EMF resource / IResourceDescription.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

On 01.09.11 11:06, Sebastian Paul wrote:
> Hi,
> is there also a way to get validation errors (e.g. parser errors or
> constraint violation) from a given IEObjectDescription or
> IResourceDescription without loading the resource? The information is
> already there, as it is shown in Problems View and Markers...
> I get the mentioned objects from the injected IResourceDescriptions,
> which is provided by the builder fragment.
>
Re: Dealing with EMF model and parser error [message #722638 is a reply to message #722453] Tue, 06 September 2011 11:47 Go to previous message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Thanks, I'm going to try that. I can imagine that it is difficult to
determine if a particular model element is affected. I guess, the text
position can be used somehow.

Am 2011-09-05 22:08, schrieb Sebastian Zarnekow:
> Hi Sebastian,
>
> you could try to obtain them from the markers on the IFile that
> corresponds to the EMF resource / IResourceDescription.
>
> Regards,
> Sebastian


--
Best regards,
Sebastian Paul
Previous Topic:What tool chain is better for generating C# and XML code
Next Topic:Difference between References
Goto Forum:
  


Current Time: Thu Apr 25 14:43:23 GMT 2024

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

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

Back to the top