summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Document PEG Internalswip-pegNoah Lavine2011-03-241-0/+71
| | | | * doc/ref/api-peg.texi: add a manual section about the PEG internals.
* Remove eval-whenNoah Lavine2011-03-241-5/+0
| | | | * module/ice-9/peg.scm: remove the eval-when statement
* Factor PEG StructureNoah Lavine2011-03-243-29/+53
| | | | | | | * modules/ice-9/peg.scm: remove the part that defines a match structure * modules/ice-9/peg/match-record.scm: and put it here * module/Makefile.am (ICE_9_SOURCES): Add match-record.scm.
* Factor PEG FunctionsNoah Lavine2011-03-243-81/+104
| | | | | | | * module/ice-9/peg.scm: take out the functions for simplifying trees * module/ice-9/peg/simplify-tree.scm: and put them here * module/Makefile.am: Add simplify-tree.scm.
* Separate PEG StringsNoah Lavine2011-03-244-282/+316
| | | | | | | * module/ice-9/peg.scm: remove functions dealing with PEGs as strings * module/ice-9/peg/string-peg.scm: and put them here * module/Makefile.am: Add string-peg.scm.
* Make Macros HygienicNoah Lavine2011-03-241-56/+73
| | | | | * modules/ice-9/peg.scm: convert the unhygienic macros that generate code for string PEGs to use hygiene.
* Rename in peg.scmNoah Lavine2011-03-241-18/+18
| | | | | * module/ice-9/peg.scm: rename peg-parse-* functions to avoid confusion with what PEGs do.
* Split peg.scmNoah Lavine2011-03-243-218/+251
| | | | | | | * module/ice-9/peg.scm: move code generators to new module * module/ice-9/peg/codegen.scm: new module for PEG code generators * module/Makefile.am (ICE_9_SOURCES): Add codegen.scm.
* reformat and reflow api-peg.texiAndy Wingo2011-03-241-142/+366
| | | | * doc/ref/api-peg.texi: Reformat and reflow.
* peg: remove error-valAndy Wingo2011-03-241-7/+0
| | | | * module/ice-9/peg.scm (error-val): Remove needless definition.
* peg: refactor peg-sexp-compile to operate on syntax directlyAndy Wingo2011-03-241-132/+100
| | | | | | | | | | | | | | * module/ice-9/peg.scm (cg-generic-ret): Remove unused for-syntax argument. (peg-sexp-compile): Take the pattern as syntax directly, and use syntax-case to destructure it and dispatch to the code generators. (cg-and, cg-and-int, cg-or, cg-or-int): Refactor to operate on syntax instead of on s-expressions. (cg-body): Likewise; though this was a larger refactor. (define-nonterm, peg-match): Adapt to peg-sexp-compile calling convention change. (peg-string-compile): Likewise, and just take the grammar as a syntax object.
* peg: cg-string, cg-peg-any, cg-range: remove needless for-syntax argAndy Wingo2011-03-241-6/+6
| | | | | | * module/ice-9/peg.scm (cg-string, cg-peg-any, cg-range): Remove unnecessary for-syntax arg. (peg-sexp-compile): Adapt.
* peg: change some instances of "match" to "pat"Andy Wingo2011-03-241-38/+38
| | | | | * module/ice-9/peg.scm (cg-string): Rename "match" to "pat". (peg-sexp-compile, cg-body-test, cg-body, define-nonterm): Likewise.
* remove cggl, cg-generic-lambdaAndy Wingo2011-03-241-23/+4
| | | | | | | * module/ice-9/peg.scm (cg-generic-lambda, cggl): Remove these helpers, they are no longer needed. (cg-generic-ret): Remove optimization for particular cg- routines, as it's no longer needed.
* peg: more cggl / cggr excisionsAndy Wingo2011-03-241-11/+18
| | | | | * module/ice-9/peg.scm (cg-peg-any): Don't use cggr. (cg-range): Don't use cggl or cggr.
* peg: cg-string does not use cggrAndy Wingo2011-03-241-4/+9
| | | | | * module/ice-9/peg.scm (cg-string): Don't use cggr. Interesting to see what it actually generates.
* peg: cg-peg-any does not use cgglAndy Wingo2011-03-241-4/+5
| | | | * module/ice-9/peg.scm (cg-peg-any): Don't use cggl.
* peg: cg-string without cgglAndy Wingo2011-03-241-6/+6
| | | | * module/ice-9/peg.scm (cg-string): Refactor to not use cggl.
* peg: cg-string improvementAndy Wingo2011-03-241-2/+1
| | | | | * module/ice-9/peg.scm (cg-string): Use the more efficient string= with range args, rather than string=? and substring.
* peg: helper macro docstringsAndy Wingo2011-03-241-14/+10
| | | | | * module/ice-9/peg.scm: Convert the helper macro comments into docstrings.
* peg: module-ref cleanupAndy Wingo2011-03-241-4/+4
| | | | | * module/ice-9/peg.scm (cg-generic-ret, cg-and-int, cg-body-test): Remove a few needless @ or @@ forms.
* peg: remove get-code debugging fooAndy Wingo2011-03-241-14/+1
| | | | | | * module/ice-9/peg.scm (define-nonterm): Don't stash the code in a symbol property. (get-code): Remove.
* peg: more syntax helper cleanupAndy Wingo2011-03-241-15/+16
| | | | | * module/ice-9/peg.scm (single-filter, push-not-null!): Use syntax-rules, and move outside the eval-when.
* peg: else for default cond clauses, not #tAndy Wingo2011-03-241-16/+16
| | | | | * module/ice-9/peg.scm: Change default cases of `cond' to use `else' instead of #t.
* peg; syntax helper cleanupsAndy Wingo2011-03-241-11/+12
| | | | | * module/ice-9/peg.scm (until, single?, push!): Move outside the eval-when. Use syntax-rules, and single? is faster now.
* peg: cleanupsAndy Wingo2011-03-241-14/+10
| | | | | | * module/ice-9/peg.scm (until): Rename from until-works, and be functional (and faster). (peg-match): Adapt.
* peg: define-module cleanupAndy Wingo2011-03-241-5/+18
| | | | * module/ice-9/peg.scm: Fix up define-module block.
* peg: let cleanupsNoah Lavine2011-03-241-95/+64
| | | | | * module/ice-9/peg.scm (cg-string, cg-peg-any, cg-range): Remove some unnecessary lets.
* peg: remove unhygienic safe-bind, safe-bind-fNoah Lavine2011-03-241-40/+0
| | | | * module/ice-9/peg.scm (safe-bind, safe-bind-f): Remove.
* peg: remove unused nonhygienic expander helpersNoah Lavine2011-03-241-62/+29
| | | | | * module/ice-9/peg.scm (cggl, cggr): Remove, and rename the cggl-syn and cggr-syn to take their place.
* peg: more helpers returning syntaxNoah Lavine2011-03-241-33/+38
| | | | | * module/ice-9/peg.scm (cg-body, cg-body-success, cg-body-more) (cg-body-ret): Return syntax instead of s-expressions.
* peg: cg-or, cg-or-int return syntaxNoah Lavine2011-03-241-14/+13
| | | | | | * module/ice-9/peg.scm (cg-or, cg-or-int): Return syntax instead of s-expressions. (peg-sexp-compile): Adapt.
* peg: hygiene in cg-and, cg-and-intNoah Lavine2011-03-241-21/+21
| | | | | * module/ice-9/peg.scm (cg-and, cg-and-int): Use cggr-syn instead of cggr, and also return syntax now instead of s-expressions.
* peg: hygiene in cg-rangeNoah Lavine2011-03-241-8/+8
| | | | * module/ice-9/peg.scm (cg-range): Use cggl-syn and cggr-syn.
* peg: hygiene in cg-peg-anyNoah Lavine2011-03-241-4/+4
| | | | * module/ice-9/peg.scm (cg-peg-any): Use cggl-syn and cggr-syn.
* peg: more hygiene in cg-stringNoah Lavine2011-03-241-6/+42
| | | | | | | * module/ice-9/peg.scm (cggl-syn, cggr-syn): New functions, equivalent to cggl and cggr except that they operate on syntax instead of s-expressions. (cg-string): Use them here.
* peg: lower datum->syntax in cg-range caseNoah Lavine2011-03-241-11/+13
| | | | | * module/ice-9/peg.scm (cg-range): Datum->syntax here... (peg-sexp-compile): ...instead of here.
* peg: lower datum->syntax in cg-peg-any caseNoah Lavine2011-03-241-7/+8
| | | | | * module/ice-9/peg.scm (cg-peg-any): Datum->syntax here... (peg-sexp-compile): ...instead of here.
* peg: lower datum->syntax in cg-string caseNoah Lavine2011-03-241-5/+6
| | | | | | * module/ice-9/peg.scm (cg-string): Return syntax instead of s-expressions. (peg-sexp-compile): No need for datum->string in cg-string case.
* peg: peg-sexp-compile datum->syntax refactorNoah Lavine2011-03-241-27/+37
| | | | | | | * module/ice-9/peg.scm (peg-sexp-compile): Push datum->syntax call through cond expression in peg-sexp-compile. This is a preliminary move so that I can convert the code-generating functions into syntax-generating functions one by one.
* peg: compilers return syntax instead of s-expressionsNoah Lavine2011-03-241-11/+15
| | | | | * module/ice-9/peg.scm (peg-sexp-compile, peg-string-compile): Return syntax instead of s-expressions.
* peg: beginnings of hygieneNoah Lavine2011-03-241-56/+60
| | | | | * module/ice-9/peg.scm: Pass for-syntax argument to all of the code-generating functions.
* peg: more syntax-for-non-cache-case cleanupsNoah Lavine2011-03-241-7/+4
| | | | * module/ice-9/peg.scm (syntax-for-non-cache-case): More cleanups.
* peg: clean up syntax-for-non-cache-caseNoah Lavine2011-03-241-21/+16
| | | | * module/ice-9/peg.scm (syntax-for-non-cache-case): Cleanups.
* peg: use quasisyntax instead of safe-bindNoah Lavine2011-03-241-22/+28
| | | | | * module/ice-9/peg.scm (syntax-for-non-cache-case): Use quasisyntax instead of safe-bind.
* peg: define-nonterm returns syntax instead of s-expressionNoah Lavine2011-03-241-6/+6
| | | | | * module/ice-9/peg.scm (define-nonterm, syntax-for-non-cache-case): Returns syntax instead of an s-expression.
* peg: split define-nonterm into two functions for better readability.Noah Lavine2011-03-241-27/+29
| | | | * module/ice-9/peg.scm (define-nonterm): Split for readability.
* peg: add copyright headerAndy Wingo2011-03-241-0/+19
| | | | * module/ice-9/peg.scm: Add copyright header.
* add PEG parser generatorMichael Lucy2011-03-248-0/+1895
| | | | | | | | | | | | | * module/ice-9/peg.scm: New file. * module/Makefile.am: Add to build. * doc/ref/Makefile.am: * doc/ref/api-peg.texi: * doc/ref/guile.texi: Add documentation for PEG parser. * test-suite/Makefile.am: * test-suite/tests/peg.bench: * test-suite/tests/peg.test: Add tests, and a benchmark.
* bdw-gc 6.8 compatibility (hopefully)Andy Wingo2011-03-242-0/+38
| | | | | | | | * configure.ac (HAVE_GC_STACK_BASE): New check. * libguile/threads.c (GC_UNIMPLEMENTED, GC_SUCCESS): Define if needed. (GC_register_my_thread, GC_unregister_my_thread) (GC_call_with_stack_base): Define shims if needed.