silver icon indicating copy to clipboard operation
silver copied to clipboard

IDE Feature: Show derivation of NT

Open remexre opened this issue 3 years ago • 2 comments

When working on ableC's concrete syntax specification (as someone not particularly familiar with the C grammar), it would be really nice if I could point at a nonterminal and ask "what's an example of a DeclarationSpecifiers_c." This probably needs some heuristics to show one that's neither trivial (empty string) nor overwhelming (200 repetitions of typedef), but the details of those are probably a bikeshed. This could probably use Lucas' random tree generation?

remexre avatar Apr 04 '22 17:04 remexre

Yeah random tree generation should make this fairly straightforward to implement, and already supports generating examples of some desired min/max depth.

Although it works as an extension that forwards to a function for generating Silver trees, so an IDE integration would need to generate, compile and run a simple wrapper Silver spec, or we would need to develop some sort of Silver interpreter.

krame505 avatar Apr 04 '22 17:04 krame505

Ah, yeah, right, had a "phase violation" in my head. Perils of having been writing Lisp for the last week :)

remexre avatar Apr 04 '22 17:04 remexre