Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate examples from grammar #6

Open
bennn opened this issue Jan 28, 2016 · 1 comment
Open

Generate examples from grammar #6

bennn opened this issue Jan 28, 2016 · 1 comment
Assignees

Comments

@bennn
Copy link
Contributor

bennn commented Jan 28, 2016

Feature Request!

Skimming the paper, the "CSV rewriting" section looked interesting, so I tried making an input. My first attempt was missing a column:

  a , b , c , d , e

And the error message was:

Match error at input symbol 17!
Match error at input symbol 0!

As a Kleenex user, I have no idea how this message relates to my input.
If I could see the automata I might be able to work it out, but it's probably easier for me to either:

  • re-read the CFG, try another input, repeat
  • or split my grammar into smaller parts, try making inputs for those

(Incidentally, this is how I debug all my regular expressions -- break them into smaller regular expressions and make sure each part works.)

It would be great if I could just give Kleenex a grammar and have it generate example inputs matching the grammar. This would solve my exact problem of seeing how the CSV rewriter would work, and it would also be useful for generating test cases or making sure my grammars disallow the correct inputs.

And so if you have the time or manpower, I would like this feature.
(Maybe it's already implemented and I missed it?)

@ulrikrasmussen
Copy link
Contributor

You can actually see the automata - kexc visualize --visstage transducer file.kex will give you the transducer generated from you program. You can replace transducer by any of oracle, action, oraclesst and actionsst to see, respectively, the oracle transducer, the action machine, the oracle SST and the action SST.

Debugging tools is definitely on the todo list! When I get the time, I will probably make something web-based to assist in debugging. Example input generation is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants