|
Re: IJvmModelInferrer invoked for invalid model [message #1000169 is a reply to message #999270] |
Mon, 14 January 2013 07:08 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Artur,
yes, this is intentional. Your model inferrer should check your model
first before you derive invalid JVM models. It is called by the
framework since otherwise you'd end up with a great number of follow up
errors, e.g. only one label text may be missing but all other views
would not be inferred. So that's what you have to take care of by yourself.
Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 11.01.13 20:14, schrieb Artur S:
> Hi,
>
> I have a problem in my DSL with certain invalid models that are passed
> to the invoke method of my IJvmModelInferrer implementation.
> The concrete exception I'm getting is: "An internal error occurred
> during XtextReconcilerJob"
> The reason is that my model inferrer can't handle invalid models and
> thus throws exceptions.
> Is this just a bug, or do do I have to deal with invalid models in the
> inferrer?
>
> The (stripped down) concrete grammar is the following:
>
> grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.xbase.Xbase
> generate myDsl "links restricted in the forum...http
> //www.xtext.org/example/mydsl/MyDsl"
> View:
> 'view' '{'
> components+=Label+
> '}';
> Label:
> 'label' text=STRING;
>
> The rest is generated code.
>
> The inferrer is invoked for the following example:
>
> view {
> label
> }
>
> Clearly, the "text" attribute is missing. This is reflected in the
> problems view and also indicated in the editor. Nevertheless, the
> inferrer is invoked for the invalid model.
>
> Is this the intended behaviour?
>
> I'm using Xtext 2.4.0M4 (provisional API), but do also get this
> behaviour with version 2.3.1.
> When I don't use the provisional API and Xbase, the IGenerator is not
> passed invalid models.
>
> Thanks and cheers, Artur
|
|
|
|
Powered by
FUDForum. Page generated in 0.03257 seconds