-
Notifications
You must be signed in to change notification settings - Fork 2
Debugging Grammars
coonsta edited this page Sep 13, 2010
·
4 revisions
Tip 1
Guruguru doesn’t have a grammar debugger yet. The following function is useful when debugging a grammar by hand; use this in an action and it prints the rule and the yield (the text that was parsed.)
(defun gg-debug () (message "%s: %s" rule (buffer-substring-no-properties gg-start gg-end)))
Tip 2
M-x regexp-builder is useful for writing regular expressions.
Tip 3
Emacs’ default stack limit is low. Non-trivial grammars typically exceed this limit. You can set a higher limit, for example:
(setq max-lisp-eval-depth 15000) (setq max-specpdl-size 45000)