Custom language parser autocomplete

I think the solution here is to write a hand-rolled parser that on partial parse returns the next expected token. You might be able to extract this information from parser generator’s error, but that depends on the tool.