-
Notifications
You must be signed in to change notification settings - Fork 116
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
Understanding and customizing --trace #200
Comments
Also including in the README a small description of the elements that appear on the trace would be nice like it was requested here #88 (comment) . |
After writing this I went back to peg/leg https://github.com/mingodad/peg because it's simpler and straightforward (although with less features) and with it's trace I found the main problem with my converted grammar that was a missing So replacing:
by:
Got it to parse the example input, but the questions about how to customize/understand |
Could |
@mingodad, I think it's possible. Could you explain more fully each field?
|
Yes of course ! For each definition/rule in the grammar used to parse an input we have: id <- is an internal unique number that maps to one grammar definition/rule total <- is the total number of times the definition/rule was invoked % <- percentage relative to the total execution, after summing all times each definition/rule was invoked apply this formula (total/sum_total_all_as_double)*100.0 success <- is the number of times when the definition/rule was invoked and succeded fail <- is the number of times when the definition/rule was invoked and failed definition <- is the definition/rule name |
peglint now supports |
Thank you !
My propose:
|
Also if somehow we could have the last 2 lines shown by default on the online playground it would help fine tune a grammar. |
Here is the output shown above but now with
|
Is this result is good or bad?
|
Neither comparing it with and without
|
See this comment ChrisHixon/chpeg#4 (comment) for a performance comparison between
|
I'm getting trouble fully understanding the trace output, I'm trying to find why this grammar http://ingmarschlecht.de/gamsToLatex/ that I converted to
peg
understood bypeglib
(see bellow) and it's not matching the input like the original, using the--trace
option give a long list that's not easy to grasp (I would like something like https://github.com/fasterthanlime/pegviz) but then trying to make the trace output in a way that can help me like I did a bit here #194 I looked at the code to try to trim down it's output by not showing the definitions marked with igonore~
but looking through the code inpeglib.h
I couldn't find how to check ifpeg::Ope &ope
is marked as ignore to skip it.Can someone give any hint/help here ?
Converted grammar:
The text was updated successfully, but these errors were encountered: