1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
Commit graph

26 commits

Author SHA1 Message Date
Andy Wingo
f152d7cd96 Refactor PEG records
* module/ice-9/peg/using-parsers.scm (prec): Use SRFI-9 to define PEG
  record types.
  (peg:start, peg:end, peg:string, peg:tree, peg:substring): Implement
  in a more efficient way.
2019-10-21 17:21:47 +02:00
Noah Lavine
94027fe6ec Remove 'define-grammar-f'
* module/ice-9/peg.scm: don't re-export 'define-grammar-f'
* module/ice-9/peg/string-peg.scm: don't export 'define-grammar-f'
2013-01-16 10:11:50 +01:00
Noah Lavine
fee87b821f PEG Renames
* module/ice-9/peg.scm: rename 'peg-sexp-compile' to
 'compile-peg-pattern'
* module/ice-9/peg/codegen.scm: same
* module/ice-9/peg/string-peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* doc/ref/api-peg.texi: same
2013-01-16 10:11:50 +01:00
Noah Lavine
3ebd578616 PEG Renames
* module/ice-9/peg.scm: rename 'define-grammar' to
 'define-peg-string-patterns'
* module/ice-9/peg/string-peg.scm: same
* doc/ref/api-peg.texi: same
* test-suite/tests/peg.bench: same
* test-suite/tests/peg.test: same
2013-01-16 10:11:49 +01:00
Noah Lavine
40ebbd64c4 PEG Renames
* module/ice-9/peg.scm: rename 'define-nonterm' to 'define-peg-pattern'
* module/ice-9/peg/using-parsers.scm: same
* module/ice-9/peg/string-peg.scm: same
* test-suite/tests/peg.test: same
* doc/ref/api-peg.texi: same
2013-01-16 10:11:49 +01:00
Noah Lavine
8022f5023e PEG Renames
* module/ice-9/peg.scm: rename 'peg-parse' to 'match-pattern'
* module/ice-9/peg/string-peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* doc/ref/api-peg.texi: same
* test-suite/tests/peg.test: same
* test-suite/tests/peg.bench: same
2013-01-16 10:11:49 +01:00
Noah Lavine
d7e2f5e3c2 PEG Renames
* doc/ref/api-peg.texi: rename 'peg-match' to 'search-for-pattern'
* module/ice-9/peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* test-suite/tests/peg.test: same
2013-01-16 10:11:48 +01:00
Noah Lavine
680f1dee0c Comments in PEG
module/ice-9/peg/string-peg.scm: add comments explaining the format of some
  of the parsed PEG forms.
2013-01-16 10:11:47 +01:00
Noah Lavine
cdeb5a7826 Remove 'body' PEG
module/ice-9/peg/string-peg.scm: update S-expression generators to use the
  new *, +, ?, followed-by, and not-followed-by forms.
module/ice-9/peg/codegen.scm: remove the 'body' form in the PEG s-expression
  representation.
2013-01-16 10:11:47 +01:00
Noah Lavine
72287411e9 Add 'not-followed-by' PEG
The PEG s-expression syntax now uses '(not-followed-by ...)' instead of
'(body ! ... 1)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
66ba3de0a6 Add 'followed-by' PEG
The PEG s-expression syntax now uses '(followed-by ...)' instead of
'(body & ... 1)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
8e97edd5d3 Add '?' PEG
The PEG s-expression syntax now uses '(? ...)' instead of '(body lit ... ?)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
3d19969d74 Add '+' PEG
The PEG s-expression syntax now uses '(+ ...)' instead of '(body lit ... +)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
f310a111de Add '*' PEG
The s-expression representation of PEG grammars now uses a '(* ...)' form
instead of '(body lit ... *)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
5c3f2da81f Clean Up PEG Codegen
* module/ice-9/peg/codegen.scm: remove unnecessary literals in
  peg-sexp-compile.
2013-01-16 10:11:46 +01:00
Noah Lavine
89c3c9ecf0 Make PEG Files
* module/ice-9/peg/using-parsers.scm: remove unnecessary dependency
* module/ice-9/peg.scm: add comment about string-peg dependency
* module/Makefile.scm: add PEG files to makefile
2013-01-16 10:11:45 +01:00
Noah Lavine
0977b03ef1 Rearrange PEG Modules
* module/ice-9/peg.scm: move code out of here
* module/ice-9/peg/match-records.scm: remove this file
* module/ice-9/peg/using-parsers.scm: make a new module with utilities for
  using parsers. It contains the code from both peg.scm and match-records.scm
* module/ice-9/peg/string-peg.scm: update to use new module
2013-01-16 10:11:45 +01:00
Noah Lavine
22d4c9d99a PEG Cache Module
* module/ice-9/peg/cache.scm: add module to hold cache logic for PEG
   parsers
* module/ice-9/peg.scm: move cache logic out of here
2013-01-16 10:11:45 +01:00
Noah Lavine
172ac609c4 Update String PEGs
* module/ice-9/peg/string-peg.scm: use new interface for extending PEG
   syntax
* module/ice-9/peg.scm: remove peg-extended-compile
2013-01-16 10:11:44 +01:00
Noah Lavine
94e8517c16 Extensible PEG Syntax
* module/ice-9/peg/codegen.scm: Make the PEG syntax extensible, and
    move most of the current code generators to the new interface
* doc/ref/api-peg.texi: Document PEG extensions in the PEG Internals
    section of the manual
2013-01-16 10:11:44 +01:00
Noah Lavine
bbc5564c42 Separate PEG Concerns
* module/ice-9/peg/codegen.scm: peg-sexp-compile no longer knows about
   string PEGs
* module/ice-9/peg.scm: add a new function peg-extended-compile that
   calls peg-sexp-compile or peg-string-compile on its argument as
   appropriate
2013-01-16 10:11:44 +01:00
Noah Lavine
0afaf59982 Move define-nonterm
* module/ice-9/peg/string-peg.scm: remove define-nonterm and make a simpler
   macro called `define-sexp-parser' to make the PEG grammar
* module/ice-9/peg.scm: move define-nonterm macro to this file
* module/ice-9/peg/codegen.scm: move code to wrap a parser result nicely to
   this file, under name `wrap-parser-for-users'
2013-01-16 10:11:44 +01:00
Noah Lavine
44bd21ae7b Factor PEG Structure
* modules/ice-9/peg.scm: remove the part that defines a match structure
 * modules/ice-9/peg/match-record.scm: and put it here
2013-01-16 10:11:43 +01:00
Noah Lavine
f3f41b9226 Factor PEG Functions
* module/ice-9/peg.scm: take out the functions for simplifying trees
 * module/ice-9/peg/simplify-tree.scm: and put them here
2013-01-16 10:11:43 +01:00
Noah Lavine
5e16c41703 Separate PEG Strings
* module/ice-9/peg.scm: remove functions dealing with PEGs as strings
 * module/ice-9/peg/string-peg.scm: and put them here
2013-01-16 10:11:43 +01:00
Noah Lavine
bff3ccd957 Split peg.scm
* module/ice-9/peg.scm: move code generators to new module
 * module/ice-9/peg/codegen.scm: new module for PEG code generators
2013-01-16 10:11:42 +01:00