instaparse 2017-12-15

is there some way in instaparse to ask for all possible grammar elements at certain point of the parse tree?

meaning, I have parse result, I take a specific point in that parse tree and the would get a list of parse elements that could go there

I could theoretically write an EBNF analyzer to do just this but don’t feel like it unless I have to

since I think instaparse already does this somewhere under the hood and has the necessary information

hmm, there is instaparse.cfg/ebnf, need look at it and if it would provide the necessary information

actually it looks like it just might

@niklas.collin not sure what you're asking. what would be an example of using this functionality?

Autocomplete suggestions for code editor

And the result from cfg/ebnf looks ok usable

There have been a few discussions about generating data for a parser, or listing possible inputs to a parser

Not sure the best path to exposing that

are you sure ebnf is what you want? That just creates a combinator based on an EBNF spec, it doesn't generate a list of things that could go there