intellij-plugin-v4
intellij-plugin-v4 copied to clipboard
Show where in the grammar an input phrase can reach.
Sam says: in the IDE extend ProfilingATNSimulator. override getTargetState and computeTargetState (or something like that), along with the corresponding method that's used in LL parsing. look in ProfilingATNSimulator for the comment describing the calculation of the # of DFA states computed during LL parsing that'll show you the method to hook, since it returns a DFASTate. If they click an ambiguous decision, parse again from the top, and when you get to the ambiguous decision keep a log of the DFAState instances traversed, and give them a list of those states. As they click each state in the list, highlight the next token that could match (final ATN states in the closure).