Community
Participate
Working Groups
Build Identifier: 2.0.0 2.1.0 Having following (largely simplified) grammar Model: elements+=Element+ ; Element: Entity | Test ; Entity: "entity" name=ID ; Test: "test" name=ID "(" ans=NavStatement ")" ; NavStatement returns Statement : '(' NavStatement ')' | {IFElseStatement} 'if' cond=Expr 'then' if=NavStatement (=> 'else' else=NavStatement)? | {URLNavigation} 'url' url=Expr | {BackStatement} 'back' | {RefStatement} '#' uebergang=[Entity|ID] ; enum Expr: YES | NO ; and following dummy example model: entity Uebergang_1 test x ( if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 else if YES then #Uebergang_1 ) the editor hangs up on invocation of content assist at the end of the file Reproducible: Always
The handling of syntactic predicates leads to duplicate parsing. In the generated Parser is a method like this: rule__NavStatement__Group_1__5__Impl() ... if ( (LA5_0==19) ) { if ( (synpred6_InternalMyDsl()) ) { alt5=1; } } switch (alt5) { case 1 : ... rule__NavStatement__Group_1_5__0(); Where synpred6_InternalMyDsl also calls the rule rule__NavStatement__Group_1_5__0. Because the result is not cached you get a O^2 runtime for each recursive/hierarchical usage of syntactic predicates. Workaround: If possible remove the syntactic predicate and ignore the warning while generating.
Please try to enable memoization for the ui parser.
(In reply to comment #2) > Please try to enable memoization for the ui parser. For the given example it works like a charm. Thanks for the hint.