Skip to main content



      Home
Home » Modeling » TMF (Xtext) » GraphView style grammar breaks in Xtext 2.4
GraphView style grammar breaks in Xtext 2.4 [message #1036585] Mon, 08 April 2013 11:18 Go to next message
Eclipse UserFriend
I'm using Jan's GraphView feature (nice stuff indeed), but when migrating
to Xtext 2.4 I can no longer generate the style language, the mwe2 prints:
3013 [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.xtext.org/graphview/style/GraphViewStyle' from 'platform:/resource/org.eclipse.xtext.graphview.style/src-gen/org/eclipse/xtext/graphview/style/GraphViewStyle.genmodel'
warning(200): ../org.eclipse.xtext.graphview.style/src-gen/org/eclipse/xtext/graphview/style/parser/antlr/internal/InternalGraphViewStyle.g:5477:1: Decision can match input such as "RULE_ID" using multiple alternatives: 2, 3
As a result, alternative(s) 3 were disabled for that input
error(201): ../org.eclipse.xtext.graphview.style/src-gen/org/eclipse/xtext/graphview/style/parser/antlr/internal/InternalGraphViewStyle.g:5477:1: The following alternatives can never be matched: 3

8640 [main] ERROR enerator.CompositeGeneratorFragment  - java.io.FileNotFoundException: ..\org.eclipse.xtext.graphview.style\src-gen\org\eclipse\xtext\graphview\style\parser\antlr\internal\InternalGraphViewStyleLexer.java (Das System kann die angegebene Datei nicht finden)
org.eclipse.emf.common.util.WrappedException: java.io.FileNotFoundException: ..\org.eclipse.xtext.graphview.style\src-gen\org\eclipse\xtext\graphview\style\parser\antlr\internal\InternalGraphViewStyleLexer.java (Das System kann die angegebene Datei nicht finden)
	at org.eclipse.xtext.util.Files.readFileIntoString(Files.java:129)
	at org.eclipse.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment.suppressWarningsImpl(AbstractAntlrGeneratorFragment.java:132)
	at org.eclipse.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment.suppressWarnings(AbstractAntlrGeneratorFragment.java:142)
	at org.eclipse.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment.suppressWarnings(AbstractAntlrGeneratorFragment.java:138)
	at org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment.generate(XtextAntlrGeneratorFragment.java:49)
	at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:92)
	at org.eclipse.xtext.generator.LanguageConfig.generate(LanguageConfig.java:113)
	at org.eclipse.xtext.generator.Generator.generate(Generator.java:361)
	at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:128)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: java.io.FileNotFoundException: ..\org.eclipse.xtext.graphview.style\src-gen\org\eclipse\xtext\graphview\style\parser\antlr\internal\InternalGraphViewStyleLexer.java (Das System kann die angegebene Datei nicht finden)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(Unknown Source)
	at java.io.FileInputStream.<init>(Unknown Source)
	at org.eclipse.xtext.util.Files.readFileIntoString(Files.java:126)
	... 18 more
...


After that it seems no Internal...Lexer/Parser are generated at all.

The rule in question is XImportDeclaration. Interestingly, when generating with Xtext 2.3 no such rule is generated at all.

Going back to Xtext 2.3 all is good again. Would it be safe to link the bundle as generated using Xtext 2.3 into a Xtext 2.4 based environment?

best,
Stephan
Re: GraphView style grammar breaks in Xtext 2.4 [message #1036660 is a reply to message #1036585] Mon, 08 April 2013 13:09 Go to previous messageGo to next message
Eclipse UserFriend
In answering my own question:
Quote:
Would it be safe to link the bundle as generated using Xtext 2.3 into a Xtext 2.4 based environment?


No, trying to open the graph view causes:
Guice creation errors:

1) No implementation for org.eclipse.xtext.resource.IResourceDescriptions annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.namespaces.DefaultGlobalScopeProvider.BUILDER_SCOPE) was bound.
  while locating com.google.inject.Provider<org.eclipse.xtext.resource.IResourceDescriptions> annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.namespaces.DefaultGlobalScopeProvider.BUILDER_SCOPE)
    for field at org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.builderScopeResourceDescriptions(Unknown Source)
  while locating org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider
    for field at org.eclipse.xtext.common.types.access.jdt.WorkingCopyOwnerProvider.descriptionsProvider(Unknown Source)
  while locating org.eclipse.xtext.common.types.access.jdt.IWorkingCopyOwnerProvider
    for field at org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory.copyOwnerProvider(Unknown Source)
  at org.eclipse.xtext.graphview.GraphViewModule.configure(GraphViewModule.java:35)

2) No implementation for org.eclipse.xtext.resource.IResourceDescriptions annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.LIVE_SCOPE) was bound.
  while locating com.google.inject.Provider<org.eclipse.xtext.resource.IResourceDescriptions> annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.LIVE_SCOPE)
    for field at org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.liveScopeResourceDescriptions(Unknown Source)
  while locating org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider
    for field at org.eclipse.xtext.common.types.access.jdt.WorkingCopyOwnerProvider.descriptionsProvider(Unknown Source)
  while locating org.eclipse.xtext.common.types.access.jdt.IWorkingCopyOwnerProvider
    for field at org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory.copyOwnerProvider(Unknown Source)
  at org.eclipse.xtext.graphview.GraphViewModule.configure(GraphViewModule.java:35)

2 errors ExtensionFactory: org.eclipse.xtext.graphview.GraphViewExecutableExtensionFactory


there seem to be some incompatible changes in Xtext 2.4 (or is it Xtext 3.0? ;-P )
cheers,
Stephan
Re: GraphView style grammar breaks in Xtext 2.4 [message #1036843 is a reply to message #1036660] Mon, 08 April 2013 18:18 Go to previous messageGo to next message
Eclipse UserFriend
Never mind, I dropped using those two DSLs (gvmap & gvstyle), retaining only the graph view connected to the main Xtext editor.

Using the DSLs was great for prototyping, but now that neither mapping nor styling is going to change much, maintaining those in Java seems far easier, considering the fragile dependencies reported above.

cheers,
Stephan
Re: GraphView style grammar breaks in Xtext 2.4 [message #1037034 is a reply to message #1036843] Tue, 09 April 2013 01:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

simply fix the problems doesnt work?

StyleSheet:
	importSection=XImportSection?
	'stylesheet' name=QualifiedName 'for' diagramMapping=[gvmapping::DiagramMapping|QualifiedName]
	styles+=Style*;
	 
Style:
	'style' mappings+=[gvmapping::AbstractMapping|QualifiedName] (',' mappings+=[gvmapping::AbstractMapping|QualifiedName])* 
	('as' javaClass=JvmTypeReference)?
	expression=XBlockExpression?;

XLiteral returns xbase::XExpression:
	XClosure |
	XBooleanLiteral |
	XNumberLiteral |
	XNullLiteral |
	XStringLiteral |
	XTypeLiteral |
	XColorLiteral;

XColorLiteral:
	color=COLOR;

terminal COLOR:
	'#' ('0'..'9'|'a'..'f'|'A'..'F')
	('0'..'9'|'a'..'f'|'A'..'F')
	('0'..'9'|'a'..'f'|'A'..'F')
	('0'..'9'|'a'..'f'|'A'..'F')
	('0'..'9'|'a'..'f'|'A'..'F')
	('0'..'9'|'a'..'f'|'A'..'F');

Re: GraphView style grammar breaks in Xtext 2.4 [message #1037202 is a reply to message #1037034] Tue, 09 April 2013 05:29 Go to previous message
Eclipse UserFriend
Christian Dietrich wrote on Tue, 09 April 2013 07:26
Hi,

simply fix the problems doesnt work?


Thanks for your answer, maybe Jan is interested. As mentioned it comes too late for me.

Let me explain my experiment: while developing a zoo of DSL based tools, I thought, maybe I can use Jan's graph view plug-ins just as a 3rd party library. Sure it says it's just a prototype but for me it worked - in Xtext 2.3.

When I tried to migrate to Xtext 2.4 (in extreme a hurry due to bug 403888) I saw:
- the existing and tested binary plug-ins don't work in xtext 2.4
- the source plug-ins cannot be built with xtext 2.4
- the error message points to a grammar rule that doesn't even exist in the source

At this point the experiment was abandoned, marked unsuccessful. Does this surprise you?

I'm not sure, is the idea of 3rd party black-box xtext modules feasible?

The release version "2.4" for me raised the expectation that this comes with no breaking changes, which doesn't match my painful experience while migrating my tools.

I would strongly suggest that future releases are not published before a good migration guide is published. Doing a release before the much needed migration guide (and even without a release announcement) causes more harm than the delay ever could.

my 2c,
Stephan

PS: keep up the good work.
Previous Topic:Guava dependency and compatibility
Next Topic:Get and modify elements marked in outline
Goto Forum:
  


Current Time: Sat Jul 12 23:53:46 EDT 2025

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

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

Back to the top