Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » infinite loop in DocumentTokenSource(infinite loop in DocumentTokenSource)
infinite loop in DocumentTokenSource [message #1578710] Thu, 22 January 2015 15:19 Go to next message
Luis De Bello is currently offline Luis De BelloFriend
Messages: 95
Registered: January 2015
Member
Hi guys,

I am creating a grammar and I had to created my own lexer with context, so I had splitted the lexer and the parser and modified the .g from lexer in order to include some members to handle the context, it works ok however from the editor I am getting an infinite loop in some cases.

The issue happens because the DocumentTokenSource only repair the entry with changes and in some cases my grammar is not able to be parsed, I want to use the "BacktrackingLexerDocumentTokenSource" to check if that solve my issue.

Do you know how to configure guide to inject this object instead the default one?
Re: infinite loop in DocumentTokenSource [message #1578765 is a reply to message #1578710] Thu, 22 January 2015 16:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hi

does the straight forward binding not work? something like

public class MyDslUiModule extends org.xtext.example.mydsl5.ui.AbstractMyDslUiModule {
	public MyDslUiModule(AbstractUIPlugin plugin) {
		super(plugin);
	}
	
	public Class<? extends DocumentTokenSource> bindDocumentTokenSource() {
		return BacktrackingLexerDocumentTokenSource.class;
	}
}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: infinite loop in DocumentTokenSource [message #1578787 is a reply to message #1578765] Thu, 22 January 2015 16:15 Go to previous message
Luis De Bello is currently offline Luis De BelloFriend
Messages: 95
Registered: January 2015
Member
Christian,

That works great I check the methods but I didn't see any method to override I was not aware of this behaviour of adding methods starting with keywords "bind", "provide", "configure"

Thanks for the tip

Regards,
Luis
Previous Topic:Missing in Xtext 2.7.3 : org.eclipse.xtext.common.types.util.TypeConformanceComputer
Next Topic:Attach a ModifyListener when the XTextEditor gets focus.
Goto Forum:
  


Current Time: Fri Apr 26 08:05:01 GMT 2024

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

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

Back to the top