Fork me on GitHub
#instaparse
<
2017-12-15
>
Empperi09:12:03

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

Empperi09:12:37

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

Empperi09:12:59

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

Empperi09:12:12

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

Empperi09:12:54

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

Empperi09:12:44

actually it looks like it just might

aengelberg16:12:38

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

Empperi17:12:11

Autocomplete suggestions for code editor

Empperi17:12:54

And the result from cfg/ebnf looks ok usable

aengelberg21:12:13

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

aengelberg21:12:19

Not sure the best path to exposing that

aengelberg21:12:01

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