|Syntactic predicates and proposal provider execution time [message #1858765]
||Thu, 20 April 2023 11:29
| Rémi Garcia
Registered: April 2023
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,
Powered by FUDForum
. Page generated in 0.02166 seconds