Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » quotation marks
quotation marks [message #882339] Wed, 06 June 2012 09:22 Go to next message
k dot is currently offline k dotFriend
Messages: 4
Registered: February 2012
Junior Member
bundle:
	"\""
			bundle = ID
	"\""
;


This construct isn't working. I want to start with these quoation marks. But when i use them in the editor i get a "index out of bounds" Exception.

!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.text".
!STACK 0
java.lang.IllegalArgumentException: Index out of bounds
	at org.eclipse.swt.SWT.error(SWT.java:4263)
	at org.eclipse.swt.SWT.error(SWT.java:4197)
	at org.eclipse.swt.SWT.error(SWT.java:4168)
	at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:9661)
	at org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:7713)
	at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4811)
	at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4890)
	at org.eclipse.jface.text.presentation.PresentationReconciler.applyTextRegionCollection(PresentationReconciler.java:579)
	at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:568)
	at org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:564)
	at org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.textChanged(PresentationReconciler.java:225)
	at org.eclipse.xtext.ui.editor.XtextSourceViewer.updateTextListeners(XtextSourceViewer.java:112)
	at org.eclipse.jface.text.TextViewer$VisibleDocumentListener.documentChanged(TextViewer.java:403)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721)
	at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.fireDocumentChanged(XtextDocument.java:324)
	at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191)
	at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210)
	at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7180)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7994)
	at org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2456)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5911)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5941)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5635)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	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:1509)
	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:4972)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2531)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)


Don't know what to do to use quoations marks.
Re: quotation marks [message #882404 is a reply to message #882339] Wed, 06 June 2012 11:59 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
I assume your grammar inherits from org.eclipse.xtext.common.Terminals.
Then your bundle rule conflicts with the lexer rule STRING.

Two workarounds:
1) Don't inherit from Terminals but write your own lexer rules
2) Use
bundle:
bundle=STRING;
instead and cover the fact that only ID is supported within the
quotes in a validation rule.


Am 06.06.12 11:22, schrieb k dot:
>
> bundle:
> "\""
> bundle = ID
> "\""
> ;
>
>
> This construct isn't working. I want to start with these quoation marks.
> But when i use them in the editor i get a "index out of bounds" Exception.
>
>
> !MESSAGE Problems occurred when invoking code from plug-in:
> "org.eclipse.text".
> !STACK 0
> java.lang.IllegalArgumentException: Index out of bounds
> at org.eclipse.swt.SWT.error(SWT.java:4263)
> at org.eclipse.swt.SWT.error(SWT.java:4197)
> at org.eclipse.swt.SWT.error(SWT.java:4168)
> at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:9661)
> at
> org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:7713)
> at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4811)
> at
> org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4890)
>
> at
> org.eclipse.jface.text.presentation.PresentationReconciler.applyTextRegionCollection(PresentationReconciler.java:579)
>
> at
> org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:568)
>
> at
> org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:564)
>
> at
> org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.textChanged(PresentationReconciler.java:225)
>
> at
> org.eclipse.xtext.ui.editor.XtextSourceViewer.updateTextListeners(XtextSourceViewer.java:112)
>
> at
> org.eclipse.jface.text.TextViewer$VisibleDocumentListener.documentChanged(TextViewer.java:403)
>
> at
> org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769)
>
> at
> org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736)
>
> at
> org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721)
>
> at
> org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocument.fireDocumentChanged(XtextDocument.java:324)
>
> at
> org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191)
> at
> org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210)
> at
> org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248)
>
> at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7180)
> at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7994)
> at org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2456)
> at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5911)
> at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5941)
> at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5635)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
> 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:1509)
> 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:4972)
> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2531)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
> at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
>
> 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:344)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:601)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
>
>
> Don't know what to do to use quoations marks.


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


---
Get professional support from the Xtext committers at www.typefox.io
Re: quotation marks [message #882410 is a reply to message #882404] Wed, 06 June 2012 12:19 Go to previous message
k dot is currently offline k dotFriend
Messages: 4
Registered: February 2012
Junior Member
Thanks a lot, that works for me.

I copied only the rules i needed ( ID, Int) and it works.

Previous Topic:Outline "within" Project Explorer?
Next Topic:Custom Activator in UI plug-in?
Goto Forum:
  


Current Time: Sun Oct 25 23:41:33 GMT 2020

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

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

Back to the top