Conditional parsing [message #769139] |
Wed, 21 December 2011 13:18 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
Hi,
I have a DSL, i.e. an Ecore model and Xtext grammar, that includes
features and rules that refer to JvmTypes. The code generator for the
DSL can have different targets, so in some cases some of the references
will not link because the corresponding JvmType isn't available. To
avoid processing elements that don't belong to the target (and hence
cannot be linked), the model include simple flags that turn elements
off, depending on some flags I can set. The problem is that I anyhow get
a validation error in the workflow that prevents the generator from
being executed:
299: Couldn't resolve reference to JvmGenericType 'viewers.Viewer'.
java.lang.RuntimeException: Problems running workflow
org.eclipse.gmt.generator.EmfacadeRwtGenerator: Validation problems:
1 error:
swt.xef -
/Users/hal/java/workspaces/emfacade/org.eclipse.gmt.emfacade.rwt.builder.dev/model/swt.xef
299: Couldn't resolve reference to JvmGenericType 'viewers.Viewer'.
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:99)
I essentially want to ignore linking errors for elements that are turned
off, but how can I hook into the validator, to implement this?
Hallvard
|
|
|
Re: Conditional parsing [message #769154 is a reply to message #769139] |
Wed, 21 December 2011 13:44 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hallvard,
please bind a custom
org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 21.12.11 14:18, schrieb Hallvard Trætteberg:
> Hi,
>
> I have a DSL, i.e. an Ecore model and Xtext grammar, that includes
> features and rules that refer to JvmTypes. The code generator for the
> DSL can have different targets, so in some cases some of the references
> will not link because the corresponding JvmType isn't available. To
> avoid processing elements that don't belong to the target (and hence
> cannot be linked), the model include simple flags that turn elements
> off, depending on some flags I can set. The problem is that I anyhow get
> a validation error in the workflow that prevents the generator from
> being executed:
> 299: Couldn't resolve reference to JvmGenericType 'viewers.Viewer'.
> java.lang.RuntimeException: Problems running workflow
> org.eclipse.gmt.generator.EmfacadeRwtGenerator: Validation problems:
> 1 error:
> swt.xef -
> /Users/hal/java/workspaces/emfacade/org.eclipse.gmt.emfacade.rwt.builder.dev/model/swt.xef
>
> 299: Couldn't resolve reference to JvmGenericType 'viewers.Viewer'.
> at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:99)
>
> I essentially want to ignore linking errors for elements that are turned
> off, but how can I hook into the validator, to implement this?
>
> Hallvard
|
|
|
|
Powered by
FUDForum. Page generated in 0.04943 seconds