|
From: | Noah Lavine |
Subject: | PEG Patches |
Date: | Sun, 6 Mar 2011 00:25:13 -0500 |
Hello all, Attached is a series of patches I've made for the wip-mlucy branch. It splits the PEG code into several little modules which go in module/ice-9/peg/. The original peg source file becomes very little. At the end it finally loses its big eval-when wrapper. There's one part of this that I'm not satisfied with, which is that define-nonterminal goes into module/ice-9/peg/string-peg.scm, which is supposed to be solely for pegs-as-strings. The reason for this is that I got compiler errors if I didn't do this, and I couldn't figure out how to stop them. I would appreciate it if someone would take a look and try to find what I missed. Also, a note about future ideas - the current PEG code can only parse strings. However, there is almost nothing string-specific about the parsing code - just a few calls to string-ref and substring in codegen.scm. I'd like to see this extended to parse vectors filled with arbitrary objects. This would let you use a tokenizer with it, which is the easiest way to implement C correctly, and also probably the easiest way to store line number information with tokens, which is necessary for ultimately giving good error messages from PEG parsers. Thanks, Noah
0001-Split-peg.scm.patch
Description: Binary data
0002-Rename-in-peg.scm.patch
Description: Binary data
0003-Make-Macros-Hygienic.patch
Description: Binary data
0004-Separate-PEG-Strings.patch
Description: Binary data
0005-Factor-PEG-Functions.patch
Description: Binary data
0006-Factor-PEG-Structure.patch
Description: Binary data
0007-Remove-eval-when.patch
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |