Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
e64661d8
Commit
e64661d8
authored
Jan 09, 2018
by
eckhart
Browse files
- general TODO-List extended
parent
7a65086b
Changes
1
Show whitespace changes
Inline
Side-by-side
TODO.md
View file @
e64661d8
General TODO-Lis
t
Ideas for further developmen
t
=================
=================
============
Readability of Code
Readability of Code
...
@@ -50,3 +50,29 @@ Challenges:
...
@@ -50,3 +50,29 @@ Challenges:
Some parsers cannot profit from the optimization. For example variable
Some parsers cannot profit from the optimization. For example variable
delimiters, otherwise as all delimiters a good candidate for discarding
delimiters, otherwise as all delimiters a good candidate for discarding
cannot be discarded any more.
cannot be discarded any more.
Debugging
---------
Supplement the History-Recording functionality of DHParser with a tracing
debugger, i.e. a debugger that allows to trace particular parsers:
-
Add a tracing parser class that - like the Forward-Parser-class - "contains"
another parser without its calls being run through the parser guard, but
that records every call of the parser and its results, e.g. to trace the
`option`
-parser from the ebnf-parser (see DHParser/ebnf.py) you'd write:
`option = Trace(Series(Token("["), expression, Token("]"), mandatory=1))`
-
For the ebnf-representation a tracing-prefix could be added, say
`?`
, e.g.
`option = ?("[" §expression "]")`
or, alternatively,
`?option = "[" §expression "]"`
-
Another Alternative would be to add an EBNF-compiler directive, say
`@ trace`
,
so one could write
`@ trace = option`
at the beginning of the EBNF-code.
*
disadvantage: only parsers represented by symobols can be traced
(can always be circumvented by introducing further symbols.)
*
advantages: less clutter in the EBNF-code and easier to swith between
debugging and production code by simply commenting out the
trace-statements at the beginning.
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment