Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jnthn/grammar-debugger
Grammar::Debugger and Grammer::Tracer Perl 6 modules
https://github.com/jnthn/grammar-debugger
Last synced: 5 days ago
JSON representation
Grammar::Debugger and Grammer::Tracer Perl 6 modules
- Host: GitHub
- URL: https://github.com/jnthn/grammar-debugger
- Owner: jnthn
- Created: 2011-08-17T09:48:37.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2019-03-02T06:54:04.000Z (over 5 years ago)
- Last Synced: 2023-08-16T08:57:02.012Z (about 1 year ago)
- Language: Perl 6
- Homepage:
- Size: 36.1 KB
- Stars: 36
- Watchers: 8
- Forks: 18
- Open Issues: 17
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# Grammar::Debugger [![Build Status](https://travis-ci.org/jnthn/grammar-debugger.svg?branch=master)](https://travis-ci.org/jnthn/grammar-debugger)
This module provides a simple debugger for grammars. Just `use` it:use Grammar::Debugger;
And any grammar in the lexical scope of the `use` statement will
automatically have debugging enabled. The debugger will break
execution when you first enter the grammar, and provide a prompt.
Type "h" for a list of commands.If you are debugging a grammar and want to set up breakpoints in
code rather than entering them manually at the debug prompt, you
can apply the breakpoint trait to any rule:token name is breakpoint { \w+ [\h+ \w+]* }
If you want to conditionally break, you can also do something like:
token name will break { $^m eq 'Russia' } { \w+ [\h+ \w+]* }
Which will only break after the name rule has matched "Russia".
# Grammar::Tracer
This gives similar output to Grammar::Debugger, but just runs through
the whole grammar without stopping until it is successful or fails.
Once again, after a use:use Grammar::Tracer;
It will apply to any grammars in the lexical scope of the use statement.
# Bugs? Ideas?
Please file them in [GitHub issues](https://github.com/jnthn/grammar-debugger/issues).