left-recursive grammar rules and ASTs

howdy. I think I have tracked down an incredibly maddening GUI spinning ball of death.  Imagine a left-recursive grammar rule in my ANTLR grammar:

script : expr EOF ;
expr : expr '*' expr
        | INT

with input 3*4. ANTLR will create a parse tree as the enclosed image shows (well almost; i'm simplifying here).

Q: If I create an AST (jetbrains terminology) that has such a structure, will it be a problem for jetbrains? condition might be a composite node whose first child is composite with same IElementType (expr).

Can anyone at jetbrains confirm my suspicion that such trees are a problem?


Screen Shot 2015-12-23 at 12.58.23 PM.png
1 comment

OMFG! The spinning ball of death has NOTHING to do with intellij. I finally found a completely reproducible test. Turn on Dragon speech recognition and do a rename. GUI deadlocks.  Every time. Turn off dragon. No problem ever.  I can't believe I found the issue. I've wasted DAYS on this mysterious random problem.

WARNING: do not use dragon when testing your plugins. holy shit. early xmas gift.

A new debugging story to add to my list.



Please sign in to leave a comment.