Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » I can do this on my grammar?
I can do this on my grammar? [message #949736] Fri, 19 October 2012 04:37 Go to next message
Vil Lpz is currently offline Vil Lpz
Messages: 24
Registered: April 2012
Junior Member
Hello.

I have a problem when I try to create a disorderly group of attributes, exactly this:

SectionAttributes:
	( // CommonAttrAndReId
	( 'id=' name = ID)
	& ('class=' class = string)? 
	& ('role=' role = string)?
	& ('display=' display = string)?
	& ('expr=' expr = string)?
	& ('mode=' mode = string)?
	& ('repeat-nodeset=' repeatnodeset = string)?
	// Fin - CommonAttrAndReId
	& ('newcontext=' newcontext = boolean)? 
	& ('resourceid=' resourceid = string)? 
	& ('title=' title = string)?
	& ('cooluri=' cooluri = string)? ) 	
;

.
.
.

SectionType:
	'<section'
		attributes = SectionAttributes
	'>'
	
		(content = SectionContent)?
		
	'</section>'
;


The problem is that, when I use the content assistant for the first time, operating correctly, but, when I use it again to add another attribute to the tag, this exception appears...

!ENTRY org.eclipse.e4.ui.workbench 4 0 2012-10-19 10:36:24.729
!MESSAGE 
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:210)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:276)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:494)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:545)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:366)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:313)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:82)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1521)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4640)
	at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4528)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4976)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2546)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3756)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.NullPointerException
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser1$DFA311.specialStateTransition(InternalIdeal2DslParser.java:11390)
	at org.antlr.runtime.DFA.predict(DFA.java:80)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA.predict(DFA.java:25)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser23.rule__SectionAttributes__UnorderedGroup__Impl(InternalIdeal2DslParser.java:55850)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser23.rule__SectionAttributes__UnorderedGroup__0(InternalIdeal2DslParser.java:56392)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser23.rule__SectionAttributes__UnorderedGroup(InternalIdeal2DslParser.java:55811)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser2.ruleSectionAttributes(InternalIdeal2DslParser.java:8428)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser27.rule__SectionType__AttributesAssignment_1(InternalIdeal2DslParser.java:50673)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser7.rule__SectionType__Group__1__Impl(InternalIdeal2DslParser.java:58989)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser7.rule__SectionType__Group__1(InternalIdeal2DslParser.java:58944)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser7.rule__SectionType__Group__0(InternalIdeal2DslParser.java:58874)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser2.ruleSectionType(InternalIdeal2DslParser.java:8813)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser26.rule__BodyType__SectionAssignment_6(InternalIdeal2DslParser.java:47422)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__BodyType__Group__6__Impl(InternalIdeal2DslParser.java:47592)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__BodyType__Group__6(InternalIdeal2DslParser.java:47547)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__BodyType__Group__5(InternalIdeal2DslParser.java:47456)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__BodyType__Group__4(InternalIdeal2DslParser.java:47353)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__BodyType__Group__3(InternalIdeal2DslParser.java:47278)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__BodyType__Group__2(InternalIdeal2DslParser.java:47193)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__BodyType__Group__1(InternalIdeal2DslParser.java:47118)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__BodyType__Group__0(InternalIdeal2DslParser.java:47043)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser2.ruleBodyType(InternalIdeal2DslParser.java:7427)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser26.rule__UiType__BodyAssignment_2(InternalIdeal2DslParser.java:47217)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__UiType__Group__2__Impl(InternalIdeal2DslParser.java:46925)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__UiType__Group__2(InternalIdeal2DslParser.java:46872)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__UiType__Group__1(InternalIdeal2DslParser.java:46802)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser6.rule__UiType__Group__0(InternalIdeal2DslParser.java:46727)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser2.ruleUiType(InternalIdeal2DslParser.java:7350)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser26.rule__IdealType__UiAssignment_8(InternalIdeal2DslParser.java:43978)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__IdealType__Group__8__Impl(InternalIdeal2DslParser.java:30852)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__IdealType__Group__8(InternalIdeal2DslParser.java:30807)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__IdealType__Group__7(InternalIdeal2DslParser.java:30716)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__IdealType__Group__6(InternalIdeal2DslParser.java:30620)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__IdealType__Group__5(InternalIdeal2DslParser.java:30524)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__IdealType__Group__4(InternalIdeal2DslParser.java:30428)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__IdealType__Group__3(InternalIdeal2DslParser.java:30332)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__IdealType__Group__2(InternalIdeal2DslParser.java:30257)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__IdealType__Group__1(InternalIdeal2DslParser.java:30172)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__IdealType__Group__0(InternalIdeal2DslParser.java:30097)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser2.ruleIdealType(InternalIdeal2DslParser.java:5887)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser26.rule__Xml__IdealAssignment_5(InternalIdeal2DslParser.java:43474)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__Xml__Group__5__Impl(InternalIdeal2DslParser.java:29057)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__Xml__Group__5(InternalIdeal2DslParser.java:29017)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser4.rule__Xml__Group__4(InternalIdeal2DslParser.java:28937)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser3.rule__Xml__Group__3(InternalIdeal2DslParser.java:28829)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser3.rule__Xml__Group__2(InternalIdeal2DslParser.java:28754)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser3.rule__Xml__Group__1(InternalIdeal2DslParser.java:28669)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser3.rule__Xml__Group__0(InternalIdeal2DslParser.java:28594)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser2.ruleXml(InternalIdeal2DslParser.java:5655)
	at mymw.ideal2dsl.ui.contentassist.antlr.internal.InternalIdeal2DslParser2.entryRuleXml(InternalIdeal2DslParser.java:5612)
	at mymw.ideal2dsl.ui.contentassist.antlr.Ideal2DslParser.getFollowElements(Ideal2DslParser.java:1860)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.AbstractContentAssistParser.getFollowElements(AbstractContentAssistParser.java:324)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory$StatefulFactory.handleLastCompleteNodeAsPartOfDatatypeNode(ParserBasedContentAssistContextFactory.java:230)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory$StatefulFactory.doCreateContexts(ParserBasedContentAssistContextFactory.java:155)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory$StatefulFactory.create(ParserBasedContentAssistContextFactory.java:148)
	at org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.create(ParserBasedContentAssistContextFactory.java:577)
	at org.eclipse.xtext.ui.editor.contentassist.CompletionProposalComputer.exec(CompletionProposalComputer.java:48)
	at org.eclipse.xtext.ui.editor.contentassist.CompletionProposalComputer.exec(CompletionProposalComputer.java:1)
	at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:78)
	at org.eclipse.xtext.ui.editor.contentassist.XtextContentAssistProcessor.computeCompletionProposals(XtextContentAssistProcessor.java:68)
	at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1839)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:566)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:563)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:498)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:492)
	at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1665)
	at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:932)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1507)
	at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:80)
	at org.eclipse.xtext.ui.editor.handler.ContentAssistHandler.execute(ContentAssistHandler.java:32)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	... 48 more


I have disordered groups in other places of my grammar and didn't cause this problem... anyone know whats is happening?

Any help is welcome.

Thanks for reading.

Greetings!
Re: I can do this on my grammar? [message #949912 is a reply to message #949736] Fri, 19 October 2012 08:35 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2809
Registered: July 2009
Senior Member
Am 19.10.12 10:37, schrieb Vil Lpz:
> Hello.
>
> I have a problem when I try to create a disorderly group of attributes,
> exactly this:
>
> SectionAttributes:
> ( // CommonAttrAndReId
> ( 'id=' name = ID)
> & ('class=' class = string)? & ('role=' role = string)?
> & ('display=' display = string)?
> & ('expr=' expr = string)?
> & ('mode=' mode = string)?
> & ('repeat-nodeset=' repeatnodeset = string)?
> // Fin - CommonAttrAndReId
> & ('newcontext=' newcontext = boolean)? & ('resourceid='
> resourceid = string)? & ('title=' title = string)?
> & ('cooluri=' cooluri = string)? )
> ;
>

What is your question? What problem do you have?
Re: I can do this on my grammar? [message #953804 is a reply to message #949912] Mon, 22 October 2012 10:46 Go to previous messageGo to next message
Vil Lpz is currently offline Vil Lpz
Messages: 24
Registered: April 2012
Junior Member
Hello Sebastian, and thanks for the reply.

The problem is that the content assistant fails in the "section" tag. It only works for the first attribute of the tag "section", if I try to add another attribute to the label with the assistant (Ctrl + Space) does not work and shows me the exception I mentioned in the first post.

If I don't use a disorderly group working properly. But I need a disorderly group there ...

I've been doing test and this error only happens when I make the changes to the parser file, that you indicated me here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=388684

If I reduce the grammar until error "65535 bytes limit" disapear (I comment few lines from the DivMix rule) and left the parser unmodified works correctly. So I suspect the failure may be caused to changes in the parser file...

I hope now you understand the problem, I'm not very good at expressing in English.

Many thanks again for the help Sebastian

A greeting.
Re: I can do this on my grammar? [message #986685 is a reply to message #949736] Wed, 21 November 2012 06:15 Go to previous message
Vil Lpz is currently offline Vil Lpz
Messages: 24
Registered: April 2012
Junior Member

Someone could help me with this? I'm stuck and no idea how to fix it... Crying or Very Sad

https://bugs.eclipse.org/bugs/show_bug.cgi?id=388684

Any help is very welcome.

Thanks!

Greetings
Previous Topic:large project vs several small projects
Next Topic:[Xtext] Default values for optional assignments?
Goto Forum:
  


Current Time: Fri Aug 22 13:58:24 EDT 2014

Powered by FUDForum. Page generated in 0.07128 seconds