Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Syntactic predicates and proposal provider execution time
Syntactic predicates and proposal provider execution time [message #1858765] Thu, 20 April 2023 11:29 Go to next message
Rémi Garcia is currently offline Rémi GarciaFriend
Messages: 3
Registered: April 2023
Junior Member
I am currently trying to figure out why the proposal provider is taking seemingly exponential time. The grammar I have to implement is of this form:

'(' inner=TProcess ')'
| 'in' '('...')'
| 'let' ... (->'in' in=TProcess)?

The optional 'in' for the let would lead to clear ambiguities: the parser would have to decide between the two 'in' alternatives, and the possibility to have a TProcess between parentheses is only adding to those ambiguities, as it could correspond to a parameterised 'in', or the 'in' of the 'let' with a TProcess between parentheses.

To resolve it, I added a syntactic predicate for the 'in' keyword associated to the 'let' clause. This works perfectly fine, but while the parser takes fast and correct decisions without having to backtrack, as soon as I hit Ctrl+Space in a file with lots of imbricated let clauses, it takes ages to complete the proposal providing. Changing the second alternative 'in' to 'input' resolves this issue completely, indicating an ambiguity-related problem.

Does the proposal provider not take into account syntactic predicates and resorts to backtracking, is it a bug, or am I missing something?

I am using XText 2.30, but I can reproduce the issue in old builds with XText 2.25.

Thank you in advance,
Best regards.
Re: Syntactic predicates and proposal provider execution time [message #1858811 is a reply to message #1858765] Mon, 24 April 2023 09:05 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member

Thank you for posting the example snippet. This clearly looks like a bug to me. Could you provide a self-contained example and make a new ticket[1] for it?


Previous Topic:Design question: resolving dependency between Ecore and builtin types
Next Topic:Keyword clashing with terminal rule
Goto Forum:

Current Time: Mon Apr 22 23:45:33 GMT 2024

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

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

Back to the top