A warning on the performance of syntactic predicates in Xtexthttps://www.eclipse.org/forums/index.php/mv/msg/390032/929620/#msg_929620
The traditional example for syntactic predicates in Xtext is the dangling else-problem shown by the following ambiguous grammar:

This tells Xtext that if it can parse an 'else' followed by an expression it should do so without considering any other alternatives. The problem is that Xtext then parses the expression to the right of the 'else' twice, once for the syntactic predicate and once for the true parse. This results in an exponential blowup in run-time for nested if-then-else expressions.

It may seem trivial to avoid this pitfall, but it's less obvious when there is an action. This is where I got caught. Consider if the following was ambiguous:

Correct. The scope of the syntactic predicate is limited by the inner parenthesis.

From this I've learned that it's very important to consider what exactly a syntactic predicate applies to in order to avoid any limit double parsing. Fixing this issue dropped the parse time on one of our models from 150 seconds down to 4 seconds.