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

Add debug and instrumentation routines #3

Open
mattbierner opened this issue Jun 26, 2013 · 0 comments
Open

Add debug and instrumentation routines #3

mattbierner opened this issue Jun 26, 2013 · 0 comments

Comments

@mattbierner
Copy link
Owner

Debugging parse.js is currently very difficult, primary for two reasons: parser construction is independent of execution and the implementation uses simulated tail calls to prevent the stack from growing too large. The first is unavoidable, but routines could be added to assist in debugging current parser state and flow.

Explicit debugging routines will be added. These will allow instrumenting and inspecting individual parsers. At least the following will be supported:

  • Logging of parser results and execution state information.
  • Pausing and continuing a parsing (capturing the continuation).
  • Tracking relative performance and other performance metrics of a parser.
  • Tracing the 'call stack' nesting of parsers.

Implementation Goals:

  • Zero performance penalty on normal, non debuggable, parsers.
  • Clean isolation of debug logic. No debug specific changes made to main files.
  • Functional style implementation.
  • Debugged parsers are transparent, i.e. they behave exactly like the original.
  • Unit tests.

A separate feature for safely attaching arbitrary data to the parer state may be required as well to enable passing debug data though parsers.

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

1 participant