diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88e9e64..6351330 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,11 +37,11 @@ jobs: variant: ${{ matrix.racket-variant }} - name: Install packages - run: raco pkg install --auto ./br-parser-tools-lib - run: raco pkg install --auto ./br-parser-tools-doc - run: raco pkg install --auto ./br-parser-tools - run: raco pkg install --auto ./brag-lib - run: raco pkg install --auto ./brag + run: raco pkg install --auto ./yaragg-parser-tools-lib + run: raco pkg install --auto ./yaragg-parser-tools-doc + run: raco pkg install --auto ./yaragg-parser-tools + run: raco pkg install --auto ./yaragg-lib + run: raco pkg install --auto ./yaragg - - name: Run the br-parser-tools tests - run: xvfb-run raco test --drdr -p br-parser-tools-lib br-parser-tools-doc br-parser-tools brag-lib brag + - name: Run the yaragg-parser-tools tests + run: xvfb-run raco test --drdr -p yaragg-parser-tools-lib yaragg-parser-tools-doc yaragg-parser-tools yaragg-lib yaragg diff --git a/.gitignore b/.gitignore index 8881ec1..53c5dc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,2 @@ -# for Racket compiled/ -*~ - -# for Mac OS X -.DS_Store -.AppleDouble -.LSOverride -Icon - -# Thumbnails -._* - -# Files that might appear on external disk -.Spotlight-V100 -.Trashes -brag/*.html -brag/*.css -brag/*.js \ No newline at end of file +doc/ diff --git a/LICENSE.md b/LICENSE.md index 19b4c1b..1d5b8fd 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,9 +1,7 @@ -MIT License for `brag` (code only) +Copyright 2022 Jack Firth -© 2017-2020 Matthew Butterick - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 3467190..67f3eee 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,11 @@ -## brag ![Build Status](https://github.com/jackfirth/brag/workflows/CI/badge.svg) - -Racket DSL for generating parsers from BNF grammars. +## yaragg ![Build Status](https://github.com/jackfirth/yaragg/workflows/CI/badge.svg) +Yet Another Racket AST-Generator Generator. Racket DSL for generating parsers from BNF grammars. Fork of [`brag`](https://pkgs.racket-lang.org/package/brag), which is itself a fork of [`ragg`](https://pkgs.racket-lang.org/package/ragg). ## Install -`raco pkg install brag` - - -## Documentation - -http://docs.racket-lang.org/brag/ - +`raco pkg install --auto yaragg` ## License diff --git a/SUBLICENSE-brag.md b/SUBLICENSE-brag.md new file mode 100644 index 0000000..7a96652 --- /dev/null +++ b/SUBLICENSE-brag.md @@ -0,0 +1,11 @@ +`yaragg` contains substantial portions of the software [`brag`](https://github.com/mbutterick/brag) + +MIT License for `brag` (code only) + +© 2017-2020 Matthew Butterick + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/SUBLICENSE.md b/SUBLICENSE-ragg.md similarity index 91% rename from SUBLICENSE.md rename to SUBLICENSE-ragg.md index f3398ce..0000686 100644 --- a/SUBLICENSE.md +++ b/SUBLICENSE-ragg.md @@ -1,4 +1,4 @@ -`brag` contains substantial portions of the software [`ragg`](https://github.com/jbclements/ragg) +`yaragg` contains substantial portions of the software [`ragg`](https://github.com/jbclements/ragg) MIT License for `ragg` diff --git a/br-parser-tools-doc/br-parser-tools/info.rkt b/br-parser-tools-doc/br-parser-tools/info.rkt deleted file mode 100644 index f219d03..0000000 --- a/br-parser-tools-doc/br-parser-tools/info.rkt +++ /dev/null @@ -1,3 +0,0 @@ -#lang info - -(define scribblings '(("br-parser-tools.scrbl" (multi-page) (parsing-library)))) diff --git a/br-parser-tools/info.rkt b/br-parser-tools/info.rkt deleted file mode 100644 index 6a692a8..0000000 --- a/br-parser-tools/info.rkt +++ /dev/null @@ -1,12 +0,0 @@ -#lang info - -(define collection 'multi) - -(define deps '("br-parser-tools-lib" - "br-parser-tools-doc")) -(define implies '("br-parser-tools-lib" - "br-parser-tools-doc")) - -(define pkg-desc "Lex- and Yacc-style parsing tools") - -(define pkg-authors '(mflatt)) diff --git a/brag-lib/brag/examples/simple-line-drawing/examples/letter-i.rkt b/brag-lib/brag/examples/simple-line-drawing/examples/letter-i.rkt deleted file mode 100755 index 41f6570..0000000 --- a/brag-lib/brag/examples/simple-line-drawing/examples/letter-i.rkt +++ /dev/null @@ -1,4 +0,0 @@ -#lang brag/examples/simple-line-drawing -3 9 X; -6 3 b 3 X 3 b; -3 9 X; diff --git a/brag-lib/brag/test/test-all.rkt b/brag-lib/brag/test/test-all.rkt deleted file mode 100755 index 948e544..0000000 --- a/brag-lib/brag/test/test-all.rkt +++ /dev/null @@ -1,26 +0,0 @@ -#lang racket/base - -(require brag/test/test-0n1 - brag/test/test-0n1n - brag/test/test-01-equal - brag/test/test-baby-json - brag/test/test-baby-json-hider - brag/test/test-curly-quantifier - brag/test/test-cutter - brag/test/test-empty-symbol - brag/test/test-errors - brag/test/test-flatten - brag/test/test-hide-and-splice - brag/test/test-lexer - brag/test/test-nested-repeats - brag/test/test-old-token - brag/test/test-parser - brag/test/test-quotation-marks-and-backslashes - brag/test/test-simple-arithmetic-grammar - brag/test/test-simple-line-drawing - brag/test/test-start-and-atok - brag/test/test-top-level-cut - brag/test/test-weird-grammar - brag/test/test-whitespace - brag/test/test-wordy - (submod brag/codegen/satisfaction test)) diff --git a/brag-lib/brag/test/test-top-level-cut.rkt b/brag-lib/brag/test/test-top-level-cut.rkt deleted file mode 100755 index 2483999..0000000 --- a/brag-lib/brag/test/test-top-level-cut.rkt +++ /dev/null @@ -1,11 +0,0 @@ -#lang racket/base -(require (prefix-in 1: brag/examples/top-level-cut-1) - (prefix-in 2: brag/examples/top-level-cut-2) - (prefix-in 3: brag/examples/top-level-cut-3) - brag/support - rackunit) - -(check-equal? (1:parse-to-datum "x") '((sub "x"))) -(check-equal? (2:parse-to-datum "x") '(("x"))) -(check-equal? (3:parse-to-datum "x") '("x")) - diff --git a/brag/brag/info.rkt b/brag/brag/info.rkt deleted file mode 100755 index 343a490..0000000 --- a/brag/brag/info.rkt +++ /dev/null @@ -1,4 +0,0 @@ -#lang info - -(define scribblings '(("brag.scrbl"))) - diff --git a/brag-lib/info.rkt b/yaragg-lib/info.rkt similarity index 62% rename from brag-lib/info.rkt rename to yaragg-lib/info.rkt index 5ed8688..345bfb8 100755 --- a/brag-lib/info.rkt +++ b/yaragg-lib/info.rkt @@ -3,8 +3,8 @@ (define collection 'multi) (define deps '(["base" #:version "6.3"] - "br-parser-tools-lib" + "yaragg-parser-tools-lib" "rackunit-lib" "syntax-color-lib")) -(define implies '("br-parser-tools-lib")) +(define implies '("yaragg-parser-tools-lib")) diff --git a/brag-lib/brag/codegen/codegen.rkt b/yaragg-lib/yaragg/codegen/codegen.rkt similarity index 96% rename from brag-lib/brag/codegen/codegen.rkt rename to yaragg-lib/yaragg/codegen/codegen.rkt index 19c2e6e..9dac33c 100755 --- a/brag-lib/brag/codegen/codegen.rkt +++ b/yaragg-lib/yaragg/codegen/codegen.rkt @@ -1,16 +1,16 @@ #lang racket/base (require racket/list racket/syntax - brag/rules/stx-types + yaragg/rules/stx-types syntax/id-table - (prefix-in sat: brag/codegen/satisfaction) + (prefix-in sat: yaragg/codegen/satisfaction) (for-template racket/base - brag/codegen/runtime - brag/private/internal-support)) + yaragg/codegen/runtime + yaragg/private/internal-support)) (provide (all-defined-out) - (for-template (all-from-out brag/codegen/runtime - brag/private/internal-support))) + (for-template (all-from-out yaragg/codegen/runtime + yaragg/private/internal-support))) ;; Given a flattened rule, returns a syntax for the code that ;; preserves as much source location as possible. diff --git a/brag-lib/brag/codegen/expander.rkt b/yaragg-lib/yaragg/codegen/expander.rkt similarity index 94% rename from brag-lib/brag/codegen/expander.rkt rename to yaragg-lib/yaragg/codegen/expander.rkt index 3711899..d8dc64c 100755 --- a/brag-lib/brag/codegen/expander.rkt +++ b/yaragg-lib/yaragg/codegen/expander.rkt @@ -1,12 +1,12 @@ #lang racket/base (require (for-syntax racket/base racket/list - brag/codegen/codegen - brag/codegen/runtime - brag/codegen/flatten) - br-parser-tools/lex - br-parser-tools/cfg-parser - (prefix-in bs: brag/support) + yaragg/codegen/codegen + yaragg/codegen/runtime + yaragg/codegen/flatten) + yaragg-parser-tools/lex + yaragg-parser-tools/cfg-parser + (prefix-in bs: yaragg/support) racket/set) (provide (except-out (all-from-out racket/base) #%module-begin) @@ -39,7 +39,7 @@ [((TOKEN-TYPE . TOKEN-TYPE-CONSTRUCTOR) ...) (for/list ([tt (in-list (rules->token-types rules))]) (cons tt (string->symbol (format "token-~a" tt))))] - ;; Flatten rules to use the yacc-style ruleset that br-parser-tools supports + ;; Flatten rules to use the yacc-style ruleset that yaragg-parser-tools supports [GENERATED-RULE-CODES (map flat-rule->yacc-rule (flatten-rules rules))] ;; main exports. Break hygiene so they're also available at top-level / repl [(PARSE PARSE-TO-DATUM PARSE-TREE MAKE-RULE-PARSER ALL-TOKEN-TYPES) @@ -54,7 +54,7 @@ #'(#%module-begin (provide PARSE PARSE-TO-DATUM PARSE-TREE MAKE-RULE-PARSER ALL-TOKEN-TYPES) - ;; handle brag/support `token` with special identifier + ;; handle yaragg/support `token` with special identifier ;; so it doesn't conflict with brag's internal `token` macro ;; defined but deliberately not provided so it's available at repl, but not on import (define TOKEN bs:token) diff --git a/brag-lib/brag/codegen/flatten.rkt b/yaragg-lib/yaragg/codegen/flatten.rkt similarity index 99% rename from brag-lib/brag/codegen/flatten.rkt rename to yaragg-lib/yaragg/codegen/flatten.rkt index 1a4cbae..5ac54b6 100755 --- a/brag-lib/brag/codegen/flatten.rkt +++ b/yaragg-lib/yaragg/codegen/flatten.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require brag/rules/stx-types +(require yaragg/rules/stx-types racket/list (for-syntax racket/base)) (provide flatten-rule diff --git a/brag-lib/brag/codegen/reader.rkt b/yaragg-lib/yaragg/codegen/reader.rkt similarity index 81% rename from brag-lib/brag/codegen/reader.rkt rename to yaragg-lib/yaragg/codegen/reader.rkt index adc0066..2a54ec8 100755 --- a/brag-lib/brag/codegen/reader.rkt +++ b/yaragg-lib/yaragg/codegen/reader.rkt @@ -1,14 +1,14 @@ #lang s-exp syntax/module-reader -brag/codegen/expander +yaragg/codegen/expander #:read my-read #:read-syntax my-read-syntax #:info my-get-info #:whole-body-readers? #t -(require brag/rules/parser - brag/rules/lexer - brag/rules/stx - brag/rules/rule-structs) +(require yaragg/rules/parser + yaragg/rules/lexer + yaragg/rules/stx + yaragg/rules/rule-structs) (define (my-read in) (syntax->datum (my-read-syntax #f in))) @@ -41,7 +41,7 @@ brag/codegen/expander (define (my-get-info key default default-filter) (case key - [(color-lexer) (dynamic-require 'brag/private/colorer 'color-brag (λ () #f))] - [(drracket:indentation) (dynamic-require 'brag/private/indenter 'indent-brag (λ () #f))] + [(color-lexer) (dynamic-require 'yaragg/private/colorer 'color-brag (λ () #f))] + [(drracket:indentation) (dynamic-require 'yaragg/private/indenter 'indent-brag (λ () #f))] [else (default-filter key default)])) diff --git a/brag-lib/brag/codegen/runtime.rkt b/yaragg-lib/yaragg/codegen/runtime.rkt similarity index 98% rename from brag-lib/brag/codegen/runtime.rkt rename to yaragg-lib/yaragg/codegen/runtime.rkt index d2ef10b..e7e4b19 100755 --- a/brag-lib/brag/codegen/runtime.rkt +++ b/yaragg-lib/yaragg/codegen/runtime.rkt @@ -2,9 +2,9 @@ (require racket/match racket/list racket/generator - (prefix-in lex: br-parser-tools/lex) - brag/support - brag/private/internal-support) + (prefix-in lex: yaragg-parser-tools/lex) + yaragg/support + yaragg/private/internal-support) (provide the-error-handler diff --git a/brag-lib/brag/codegen/satisfaction.rkt b/yaragg-lib/yaragg/codegen/satisfaction.rkt similarity index 100% rename from brag-lib/brag/codegen/satisfaction.rkt rename to yaragg-lib/yaragg/codegen/satisfaction.rkt diff --git a/brag-lib/brag/examples/01-equal.rkt b/yaragg-lib/yaragg/examples/01-equal.rkt similarity index 100% rename from brag-lib/brag/examples/01-equal.rkt rename to yaragg-lib/yaragg/examples/01-equal.rkt diff --git a/brag-lib/brag/examples/0n1.rkt b/yaragg-lib/yaragg/examples/0n1.rkt similarity index 100% rename from brag-lib/brag/examples/0n1.rkt rename to yaragg-lib/yaragg/examples/0n1.rkt diff --git a/brag-lib/brag/examples/0n1n.rkt b/yaragg-lib/yaragg/examples/0n1n.rkt similarity index 100% rename from brag-lib/brag/examples/0n1n.rkt rename to yaragg-lib/yaragg/examples/0n1n.rkt diff --git a/brag-lib/brag/examples/add-mult.rkt b/yaragg-lib/yaragg/examples/add-mult.rkt similarity index 100% rename from brag-lib/brag/examples/add-mult.rkt rename to yaragg-lib/yaragg/examples/add-mult.rkt diff --git a/brag-lib/brag/examples/baby-json-alt.rkt b/yaragg-lib/yaragg/examples/baby-json-alt.rkt similarity index 100% rename from brag-lib/brag/examples/baby-json-alt.rkt rename to yaragg-lib/yaragg/examples/baby-json-alt.rkt diff --git a/brag-lib/brag/examples/baby-json-alt2.rkt b/yaragg-lib/yaragg/examples/baby-json-alt2.rkt similarity index 100% rename from brag-lib/brag/examples/baby-json-alt2.rkt rename to yaragg-lib/yaragg/examples/baby-json-alt2.rkt diff --git a/brag-lib/brag/examples/baby-json-hider.rkt b/yaragg-lib/yaragg/examples/baby-json-hider.rkt similarity index 100% rename from brag-lib/brag/examples/baby-json-hider.rkt rename to yaragg-lib/yaragg/examples/baby-json-hider.rkt diff --git a/brag-lib/brag/examples/baby-json.rkt b/yaragg-lib/yaragg/examples/baby-json.rkt similarity index 100% rename from brag-lib/brag/examples/baby-json.rkt rename to yaragg-lib/yaragg/examples/baby-json.rkt diff --git a/brag-lib/brag/examples/bnf.rkt b/yaragg-lib/yaragg/examples/bnf.rkt similarity index 100% rename from brag-lib/brag/examples/bnf.rkt rename to yaragg-lib/yaragg/examples/bnf.rkt diff --git a/brag-lib/brag/examples/codepoints.rkt b/yaragg-lib/yaragg/examples/codepoints.rkt similarity index 100% rename from brag-lib/brag/examples/codepoints.rkt rename to yaragg-lib/yaragg/examples/codepoints.rkt diff --git a/brag-lib/brag/examples/curly-quantifier.rkt b/yaragg-lib/yaragg/examples/curly-quantifier.rkt similarity index 100% rename from brag-lib/brag/examples/curly-quantifier.rkt rename to yaragg-lib/yaragg/examples/curly-quantifier.rkt diff --git a/brag-lib/brag/examples/cutter-another.rkt b/yaragg-lib/yaragg/examples/cutter-another.rkt similarity index 100% rename from brag-lib/brag/examples/cutter-another.rkt rename to yaragg-lib/yaragg/examples/cutter-another.rkt diff --git a/brag-lib/brag/examples/cutter.rkt b/yaragg-lib/yaragg/examples/cutter.rkt similarity index 100% rename from brag-lib/brag/examples/cutter.rkt rename to yaragg-lib/yaragg/examples/cutter.rkt diff --git a/brag-lib/brag/examples/empty-symbol.rkt b/yaragg-lib/yaragg/examples/empty-symbol.rkt similarity index 100% rename from brag-lib/brag/examples/empty-symbol.rkt rename to yaragg-lib/yaragg/examples/empty-symbol.rkt diff --git a/brag-lib/brag/examples/hide-and-splice.rkt b/yaragg-lib/yaragg/examples/hide-and-splice.rkt similarity index 100% rename from brag-lib/brag/examples/hide-and-splice.rkt rename to yaragg-lib/yaragg/examples/hide-and-splice.rkt diff --git a/brag-lib/brag/examples/lua-parser.rkt b/yaragg-lib/yaragg/examples/lua-parser.rkt similarity index 100% rename from brag-lib/brag/examples/lua-parser.rkt rename to yaragg-lib/yaragg/examples/lua-parser.rkt diff --git a/brag-lib/brag/examples/nested-repeats.rkt b/yaragg-lib/yaragg/examples/nested-repeats.rkt similarity index 100% rename from brag-lib/brag/examples/nested-repeats.rkt rename to yaragg-lib/yaragg/examples/nested-repeats.rkt diff --git a/brag-lib/brag/examples/nested-word-list.rkt b/yaragg-lib/yaragg/examples/nested-word-list.rkt similarity index 100% rename from brag-lib/brag/examples/nested-word-list.rkt rename to yaragg-lib/yaragg/examples/nested-word-list.rkt diff --git a/brag-lib/brag/examples/quotation-marks-and-backslashes.rkt b/yaragg-lib/yaragg/examples/quotation-marks-and-backslashes.rkt similarity index 100% rename from brag-lib/brag/examples/quotation-marks-and-backslashes.rkt rename to yaragg-lib/yaragg/examples/quotation-marks-and-backslashes.rkt diff --git a/brag-lib/brag/examples/simple-arithmetic-grammar.rkt b/yaragg-lib/yaragg/examples/simple-arithmetic-grammar.rkt similarity index 100% rename from brag-lib/brag/examples/simple-arithmetic-grammar.rkt rename to yaragg-lib/yaragg/examples/simple-arithmetic-grammar.rkt diff --git a/brag-lib/brag/examples/simple-line-drawing.rkt b/yaragg-lib/yaragg/examples/simple-line-drawing.rkt similarity index 100% rename from brag-lib/brag/examples/simple-line-drawing.rkt rename to yaragg-lib/yaragg/examples/simple-line-drawing.rkt diff --git a/yaragg-lib/yaragg/examples/simple-line-drawing/examples/letter-i.rkt b/yaragg-lib/yaragg/examples/simple-line-drawing/examples/letter-i.rkt new file mode 100755 index 0000000..7029ba8 --- /dev/null +++ b/yaragg-lib/yaragg/examples/simple-line-drawing/examples/letter-i.rkt @@ -0,0 +1,4 @@ +#lang yaragg/examples/simple-line-drawing +3 9 X; +6 3 b 3 X 3 b; +3 9 X; diff --git a/brag-lib/brag/examples/simple-line-drawing/grammar.rkt b/yaragg-lib/yaragg/examples/simple-line-drawing/grammar.rkt similarity index 100% rename from brag-lib/brag/examples/simple-line-drawing/grammar.rkt rename to yaragg-lib/yaragg/examples/simple-line-drawing/grammar.rkt diff --git a/brag-lib/brag/examples/simple-line-drawing/interpret.rkt b/yaragg-lib/yaragg/examples/simple-line-drawing/interpret.rkt similarity index 100% rename from brag-lib/brag/examples/simple-line-drawing/interpret.rkt rename to yaragg-lib/yaragg/examples/simple-line-drawing/interpret.rkt diff --git a/brag-lib/brag/examples/simple-line-drawing/lang/reader.rkt b/yaragg-lib/yaragg/examples/simple-line-drawing/lang/reader.rkt similarity index 74% rename from brag-lib/brag/examples/simple-line-drawing/lang/reader.rkt rename to yaragg-lib/yaragg/examples/simple-line-drawing/lang/reader.rkt index d900f99..afcf14b 100755 --- a/brag-lib/brag/examples/simple-line-drawing/lang/reader.rkt +++ b/yaragg-lib/yaragg/examples/simple-line-drawing/lang/reader.rkt @@ -1,12 +1,12 @@ #lang s-exp syntax/module-reader -brag/examples/simple-line-drawing/semantics +yaragg/examples/simple-line-drawing/semantics #:read my-read #:read-syntax my-read-syntax #:info my-get-info #:whole-body-readers? #t -(require brag/examples/simple-line-drawing/lexer - brag/examples/simple-line-drawing/grammar) +(require yaragg/examples/simple-line-drawing/lexer + yaragg/examples/simple-line-drawing/grammar) (define (my-read in) (syntax->datum (my-read-syntax #f in))) diff --git a/brag-lib/brag/examples/simple-line-drawing/lexer.rkt b/yaragg-lib/yaragg/examples/simple-line-drawing/lexer.rkt similarity index 89% rename from brag-lib/brag/examples/simple-line-drawing/lexer.rkt rename to yaragg-lib/yaragg/examples/simple-line-drawing/lexer.rkt index 3e0e810..02d3e43 100755 --- a/brag-lib/brag/examples/simple-line-drawing/lexer.rkt +++ b/yaragg-lib/yaragg/examples/simple-line-drawing/lexer.rkt @@ -3,8 +3,8 @@ (provide tokenize) ;; A simple lexer for simple-line-drawing. -(require brag/support - br-parser-tools/lex) +(require yaragg/support + yaragg-parser-tools/lex) (define (tokenize ip) (port-count-lines! ip) diff --git a/brag-lib/brag/examples/simple-line-drawing/semantics.rkt b/yaragg-lib/yaragg/examples/simple-line-drawing/semantics.rkt similarity index 100% rename from brag-lib/brag/examples/simple-line-drawing/semantics.rkt rename to yaragg-lib/yaragg/examples/simple-line-drawing/semantics.rkt diff --git a/brag-lib/brag/examples/start-and-atok.rkt b/yaragg-lib/yaragg/examples/start-and-atok.rkt similarity index 100% rename from brag-lib/brag/examples/start-and-atok.rkt rename to yaragg-lib/yaragg/examples/start-and-atok.rkt diff --git a/brag-lib/brag/examples/statlist-grammar.rkt b/yaragg-lib/yaragg/examples/statlist-grammar.rkt similarity index 100% rename from brag-lib/brag/examples/statlist-grammar.rkt rename to yaragg-lib/yaragg/examples/statlist-grammar.rkt diff --git a/brag-lib/brag/examples/subrule.rkt b/yaragg-lib/yaragg/examples/subrule.rkt similarity index 100% rename from brag-lib/brag/examples/subrule.rkt rename to yaragg-lib/yaragg/examples/subrule.rkt diff --git a/brag-lib/brag/examples/top-level-cut-1.rkt b/yaragg-lib/yaragg/examples/top-level-cut-1.rkt similarity index 100% rename from brag-lib/brag/examples/top-level-cut-1.rkt rename to yaragg-lib/yaragg/examples/top-level-cut-1.rkt diff --git a/brag-lib/brag/examples/top-level-cut-2.rkt b/yaragg-lib/yaragg/examples/top-level-cut-2.rkt similarity index 100% rename from brag-lib/brag/examples/top-level-cut-2.rkt rename to yaragg-lib/yaragg/examples/top-level-cut-2.rkt diff --git a/brag-lib/brag/examples/top-level-cut-3.rkt b/yaragg-lib/yaragg/examples/top-level-cut-3.rkt similarity index 100% rename from brag-lib/brag/examples/top-level-cut-3.rkt rename to yaragg-lib/yaragg/examples/top-level-cut-3.rkt diff --git a/brag-lib/brag/examples/whitespace.rkt b/yaragg-lib/yaragg/examples/whitespace.rkt similarity index 100% rename from brag-lib/brag/examples/whitespace.rkt rename to yaragg-lib/yaragg/examples/whitespace.rkt diff --git a/brag-lib/brag/examples/wordy.rkt b/yaragg-lib/yaragg/examples/wordy.rkt similarity index 100% rename from brag-lib/brag/examples/wordy.rkt rename to yaragg-lib/yaragg/examples/wordy.rkt diff --git a/brag-lib/brag/info.rkt b/yaragg-lib/yaragg/info.rkt similarity index 100% rename from brag-lib/brag/info.rkt rename to yaragg-lib/yaragg/info.rkt diff --git a/brag-lib/brag/main.rkt b/yaragg-lib/yaragg/main.rkt similarity index 73% rename from brag-lib/brag/main.rkt rename to yaragg-lib/yaragg/main.rkt index 0976af4..f67341b 100755 --- a/brag-lib/brag/main.rkt +++ b/yaragg-lib/yaragg/main.rkt @@ -1,8 +1,8 @@ #lang racket/base (module reader racket/base - (require brag/codegen/reader) - (provide (all-from-out brag/codegen/reader))) + (require yaragg/codegen/reader) + (provide (all-from-out yaragg/codegen/reader))) ;; this creates dummy identifiers ;; so cross-refs in `brag` docs will work diff --git a/brag-lib/brag/private/colorer.rkt b/yaragg-lib/yaragg/private/colorer.rkt similarity index 96% rename from brag-lib/brag/private/colorer.rkt rename to yaragg-lib/yaragg/private/colorer.rkt index a931887..165e79e 100644 --- a/brag-lib/brag/private/colorer.rkt +++ b/yaragg-lib/yaragg/private/colorer.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require brag/support (submod brag/rules/lexer lex-abbrevs) racket/match) +(require yaragg/support (submod yaragg/rules/lexer lex-abbrevs) racket/match) (provide color-brag) (define brag-syntax-lexer diff --git a/brag-lib/brag/private/indenter.rkt b/yaragg-lib/yaragg/private/indenter.rkt similarity index 100% rename from brag-lib/brag/private/indenter.rkt rename to yaragg-lib/yaragg/private/indenter.rkt diff --git a/brag-lib/brag/private/internal-support.rkt b/yaragg-lib/yaragg/private/internal-support.rkt similarity index 98% rename from brag-lib/brag/private/internal-support.rkt rename to yaragg-lib/yaragg/private/internal-support.rkt index cc209e9..513ab7f 100755 --- a/brag-lib/brag/private/internal-support.rkt +++ b/yaragg-lib/yaragg/private/internal-support.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/support) +(require yaragg/support) (provide current-source current-parser-error-handler diff --git a/brag-lib/brag/rules/lexer.rkt b/yaragg-lib/yaragg/rules/lexer.rkt similarity index 95% rename from brag-lib/brag/rules/lexer.rkt rename to yaragg-lib/yaragg/rules/lexer.rkt index 620f73d..1bdd590 100755 --- a/brag-lib/brag/rules/lexer.rkt +++ b/yaragg-lib/yaragg/rules/lexer.rkt @@ -1,10 +1,10 @@ #lang racket/base -(require (for-syntax racket/base brag/rules/parser)) -(require br-parser-tools/lex - (prefix-in : br-parser-tools/lex-sre) - brag/rules/parser - brag/rules/rule-structs - (only-in brag/support from/to) +(require (for-syntax racket/base yaragg/rules/parser)) +(require yaragg-parser-tools/lex + (prefix-in : yaragg-parser-tools/lex-sre) + yaragg/rules/parser + yaragg/rules/rule-structs + (only-in yaragg/support from/to) racket/string syntax-color/racket-lexer racket/match) @@ -163,7 +163,7 @@ (values "" end-pos)])) ;; position->pos: position -> pos -;; Converts position structures from br-parser-tools/lex to our own pos structures. +;; Converts position structures from yaragg-parser-tools/lex to our own pos structures. (define (position->pos a-pos) (pos (position-offset a-pos) (position-line a-pos) diff --git a/brag-lib/brag/rules/parser.rkt b/yaragg-lib/yaragg/rules/parser.rkt similarity index 98% rename from brag-lib/brag/rules/parser.rkt rename to yaragg-lib/yaragg/rules/parser.rkt index 52baaca..46b8345 100755 --- a/brag-lib/brag/rules/parser.rkt +++ b/yaragg-lib/yaragg/rules/parser.rkt @@ -1,9 +1,9 @@ #lang racket/base -(require br-parser-tools/yacc - br-parser-tools/lex +(require yaragg-parser-tools/yacc + yaragg-parser-tools/lex racket/list racket/match - brag/rules/rule-structs) + yaragg/rules/rule-structs) ;; A parser for grammars. @@ -265,7 +265,7 @@ ;; position->pos: position -> pos -;; Coerses position structures from br-parser-tools/lex to our own pos structures. +;; Coerses position structures from yaragg-parser-tools/lex to our own pos structures. (define (position->pos a-pos) (pos (position-offset a-pos) (position-line a-pos) diff --git a/brag-lib/brag/rules/rule-structs.rkt b/yaragg-lib/yaragg/rules/rule-structs.rkt similarity index 92% rename from brag-lib/brag/rules/rule-structs.rkt rename to yaragg-lib/yaragg/rules/rule-structs.rkt index 1889db2..c5d1ed9 100755 --- a/brag-lib/brag/rules/rule-structs.rkt +++ b/yaragg-lib/yaragg/rules/rule-structs.rkt @@ -2,7 +2,7 @@ (provide (all-defined-out)) -;; We keep our own position structure because br-parser-tools/lex's position +;; We keep our own position structure because yaragg-parser-tools/lex's position ;; structure is non-transparent, hence highly resistant to unit testing. (struct pos (offset line col) #:transparent) diff --git a/brag-lib/brag/rules/stx-types.rkt b/yaragg-lib/yaragg/rules/stx-types.rkt similarity index 100% rename from brag-lib/brag/rules/stx-types.rkt rename to yaragg-lib/yaragg/rules/stx-types.rkt diff --git a/brag-lib/brag/rules/stx.rkt b/yaragg-lib/yaragg/rules/stx.rkt similarity index 97% rename from brag-lib/brag/rules/stx.rkt rename to yaragg-lib/yaragg/rules/stx.rkt index 27789ef..ebaef81 100755 --- a/brag-lib/brag/rules/stx.rkt +++ b/yaragg-lib/yaragg/rules/stx.rkt @@ -1,7 +1,7 @@ #lang racket/base -(require brag/rules/rule-structs - br-parser-tools/lex +(require yaragg/rules/rule-structs + yaragg-parser-tools/lex racket/match syntax/strip-context) diff --git a/brag-lib/brag/support.rkt b/yaragg-lib/yaragg/support.rkt similarity index 96% rename from brag-lib/brag/support.rkt rename to yaragg-lib/yaragg/support.rkt index 648b682..5a7f867 100755 --- a/brag-lib/brag/support.rkt +++ b/yaragg-lib/yaragg/support.rkt @@ -1,11 +1,11 @@ #lang racket/base -(require br-parser-tools/lex +(require yaragg-parser-tools/lex racket/string racket/struct - (prefix-in : br-parser-tools/lex-sre) + (prefix-in : yaragg-parser-tools/lex-sre) (for-syntax racket/base)) -(provide (all-from-out br-parser-tools/lex) - (all-from-out br-parser-tools/lex-sre) +(provide (all-from-out yaragg-parser-tools/lex) + (all-from-out yaragg-parser-tools/lex-sre) [struct-out token-struct] token [struct-out exn:fail:parsing]) diff --git a/brag-lib/brag/test/test-01-equal.rkt b/yaragg-lib/yaragg/test/test-01-equal.rkt similarity index 96% rename from brag-lib/brag/test/test-01-equal.rkt rename to yaragg-lib/yaragg/test/test-01-equal.rkt index e9b7925..e67b9bd 100755 --- a/brag-lib/brag/test/test-01-equal.rkt +++ b/yaragg-lib/yaragg/test/test-01-equal.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/examples/01-equal +(require yaragg/examples/01-equal rackunit) (check-equal? (syntax->datum (parse "")) diff --git a/brag-lib/brag/test/test-0n1.rkt b/yaragg-lib/yaragg/test/test-0n1.rkt similarity index 96% rename from brag-lib/brag/test/test-0n1.rkt rename to yaragg-lib/yaragg/test/test-0n1.rkt index 077b5d8..6ca2e0d 100755 --- a/brag-lib/brag/test/test-0n1.rkt +++ b/yaragg-lib/yaragg/test/test-0n1.rkt @@ -1,7 +1,7 @@ #lang racket/base -(require brag/examples/0n1 - brag/support +(require yaragg/examples/0n1 + yaragg/support rackunit) (define (lex ip) diff --git a/brag-lib/brag/test/test-0n1n.rkt b/yaragg-lib/yaragg/test/test-0n1n.rkt similarity index 96% rename from brag-lib/brag/test/test-0n1n.rkt rename to yaragg-lib/yaragg/test/test-0n1n.rkt index f7655d5..7cedd0a 100755 --- a/brag-lib/brag/test/test-0n1n.rkt +++ b/yaragg-lib/yaragg/test/test-0n1n.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/examples/0n1n - brag/support +(require yaragg/examples/0n1n + yaragg/support rackunit) (define (lex ip) diff --git a/yaragg-lib/yaragg/test/test-all.rkt b/yaragg-lib/yaragg/test/test-all.rkt new file mode 100755 index 0000000..db42c24 --- /dev/null +++ b/yaragg-lib/yaragg/test/test-all.rkt @@ -0,0 +1,26 @@ +#lang racket/base + +(require yaragg/test/test-0n1 + yaragg/test/test-0n1n + yaragg/test/test-01-equal + yaragg/test/test-baby-json + yaragg/test/test-baby-json-hider + yaragg/test/test-curly-quantifier + yaragg/test/test-cutter + yaragg/test/test-empty-symbol + yaragg/test/test-errors + yaragg/test/test-flatten + yaragg/test/test-hide-and-splice + yaragg/test/test-lexer + yaragg/test/test-nested-repeats + yaragg/test/test-old-token + yaragg/test/test-parser + yaragg/test/test-quotation-marks-and-backslashes + yaragg/test/test-simple-arithmetic-grammar + yaragg/test/test-simple-line-drawing + yaragg/test/test-start-and-atok + yaragg/test/test-top-level-cut + yaragg/test/test-weird-grammar + yaragg/test/test-whitespace + yaragg/test/test-wordy + (submod yaragg/codegen/satisfaction test)) diff --git a/brag-lib/brag/test/test-baby-json-hider.rkt b/yaragg-lib/yaragg/test/test-baby-json-hider.rkt similarity index 92% rename from brag-lib/brag/test/test-baby-json-hider.rkt rename to yaragg-lib/yaragg/test/test-baby-json-hider.rkt index 473039c..41c606c 100755 --- a/brag-lib/brag/test/test-baby-json-hider.rkt +++ b/yaragg-lib/yaragg/test/test-baby-json-hider.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/examples/baby-json-hider - brag/support +(require yaragg/examples/baby-json-hider + yaragg/support rackunit) (define parse-result (parse (list "{" diff --git a/brag-lib/brag/test/test-baby-json.rkt b/yaragg-lib/yaragg/test/test-baby-json.rkt similarity index 84% rename from brag-lib/brag/test/test-baby-json.rkt rename to yaragg-lib/yaragg/test/test-baby-json.rkt index f09fa1e..c8fd2c5 100755 --- a/brag-lib/brag/test/test-baby-json.rkt +++ b/yaragg-lib/yaragg/test/test-baby-json.rkt @@ -1,7 +1,7 @@ #lang racket/base -(require brag/examples/baby-json - (prefix-in alt: brag/examples/baby-json-alt) - brag/support +(require yaragg/examples/baby-json + (prefix-in alt: yaragg/examples/baby-json-alt) + yaragg/support rackunit) (let ([str (list "{" diff --git a/brag-lib/brag/test/test-codepoints.rkt b/yaragg-lib/yaragg/test/test-codepoints.rkt similarity index 88% rename from brag-lib/brag/test/test-codepoints.rkt rename to yaragg-lib/yaragg/test/test-codepoints.rkt index 13544f8..232588d 100755 --- a/brag-lib/brag/test/test-codepoints.rkt +++ b/yaragg-lib/yaragg/test/test-codepoints.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/examples/codepoints +(require yaragg/examples/codepoints rackunit) (check-equal? (parse-to-datum '("\"A\\" "'c\\" "*d\\\"\\ef\"" "hello world")) diff --git a/brag-lib/brag/test/test-curly-quantifier.rkt b/yaragg-lib/yaragg/test/test-curly-quantifier.rkt similarity index 94% rename from brag-lib/brag/test/test-curly-quantifier.rkt rename to yaragg-lib/yaragg/test/test-curly-quantifier.rkt index ad27540..cc99482 100755 --- a/brag-lib/brag/test/test-curly-quantifier.rkt +++ b/yaragg-lib/yaragg/test/test-curly-quantifier.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/examples/curly-quantifier - brag/support +(require yaragg/examples/curly-quantifier + yaragg/support rackunit) (check-exn exn:fail:parsing? (λ () (parse-to-datum "a"))) diff --git a/brag-lib/brag/test/test-cutter-another.rkt b/yaragg-lib/yaragg/test/test-cutter-another.rkt similarity index 73% rename from brag-lib/brag/test/test-cutter-another.rkt rename to yaragg-lib/yaragg/test/test-cutter-another.rkt index db5bffd..24a128c 100755 --- a/brag-lib/brag/test/test-cutter-another.rkt +++ b/yaragg-lib/yaragg/test/test-cutter-another.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/examples/cutter-another - brag/support +(require yaragg/examples/cutter-another + yaragg/support rackunit) (check-equal? (parse-tree "w") '(top (w))) diff --git a/brag-lib/brag/test/test-cutter.rkt b/yaragg-lib/yaragg/test/test-cutter.rkt similarity index 54% rename from brag-lib/brag/test/test-cutter.rkt rename to yaragg-lib/yaragg/test/test-cutter.rkt index f4a14ac..b78fd4b 100755 --- a/brag-lib/brag/test/test-cutter.rkt +++ b/yaragg-lib/yaragg/test/test-cutter.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/examples/cutter - brag/support +(require yaragg/examples/cutter + yaragg/support rackunit) ;; related to rule-flattening problem diff --git a/brag-lib/brag/test/test-empty-symbol.rkt b/yaragg-lib/yaragg/test/test-empty-symbol.rkt similarity index 83% rename from brag-lib/brag/test/test-empty-symbol.rkt rename to yaragg-lib/yaragg/test/test-empty-symbol.rkt index 523c0ae..4e56119 100755 --- a/brag-lib/brag/test/test-empty-symbol.rkt +++ b/yaragg-lib/yaragg/test/test-empty-symbol.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/examples/empty-symbol - brag/support +(require yaragg/examples/empty-symbol + yaragg/support rackunit) (check-true (and (member (parse-to-datum "") (list '(top (xs)) '(top (ys)) '(top (zs)))) #t)) diff --git a/brag-lib/brag/test/test-errors.rkt b/yaragg-lib/yaragg/test/test-errors.rkt similarity index 98% rename from brag-lib/brag/test/test-errors.rkt rename to yaragg-lib/yaragg/test/test-errors.rkt index b84ae34..54417c7 100755 --- a/brag-lib/brag/test/test-errors.rkt +++ b/yaragg-lib/yaragg/test/test-errors.rkt @@ -130,7 +130,7 @@ EOF (check-compile-error #<datum (parse '("foo"))) diff --git a/brag-lib/brag/test/test-whitespace.rkt b/yaragg-lib/yaragg/test/test-whitespace.rkt similarity index 87% rename from brag-lib/brag/test/test-whitespace.rkt rename to yaragg-lib/yaragg/test/test-whitespace.rkt index d753eaa..d01e1ea 100755 --- a/brag-lib/brag/test/test-whitespace.rkt +++ b/yaragg-lib/yaragg/test/test-whitespace.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/examples/whitespace - brag/support +(require yaragg/examples/whitespace + yaragg/support rackunit) (check-equal? diff --git a/brag-lib/brag/test/test-wordy.rkt b/yaragg-lib/yaragg/test/test-wordy.rkt similarity index 87% rename from brag-lib/brag/test/test-wordy.rkt rename to yaragg-lib/yaragg/test/test-wordy.rkt index bcb516d..157cfab 100755 --- a/brag-lib/brag/test/test-wordy.rkt +++ b/yaragg-lib/yaragg/test/test-wordy.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require brag/examples/wordy - brag/support +(require yaragg/examples/wordy + yaragg/support rackunit) (check-equal? diff --git a/brag-lib/brag/test/weird-grammar.rkt b/yaragg-lib/yaragg/test/weird-grammar.rkt similarity index 100% rename from brag-lib/brag/test/weird-grammar.rkt rename to yaragg-lib/yaragg/test/weird-grammar.rkt diff --git a/br-parser-tools-doc/LICENSE.txt b/yaragg-parser-tools-doc/LICENSE.txt similarity index 100% rename from br-parser-tools-doc/LICENSE.txt rename to yaragg-parser-tools-doc/LICENSE.txt diff --git a/br-parser-tools-doc/info.rkt b/yaragg-parser-tools-doc/info.rkt similarity index 52% rename from br-parser-tools-doc/info.rkt rename to yaragg-parser-tools-doc/info.rkt index 8760588..a064bd6 100644 --- a/br-parser-tools-doc/info.rkt +++ b/yaragg-parser-tools-doc/info.rkt @@ -5,10 +5,6 @@ (define build-deps '("scheme-lib" "racket-doc" "syntax-color-doc" - "br-parser-tools-lib" + "yaragg-parser-tools-lib" "scribble-lib")) -(define update-implies '("br-parser-tools-lib")) - -(define pkg-desc "documentation part of \"br-parser-tools\"") - -(define pkg-authors '(mflatt)) +(define update-implies '("yaragg-parser-tools-lib")) diff --git a/br-parser-tools-doc/br-parser-tools/br-parser-tools.scrbl b/yaragg-parser-tools-doc/yaragg-parser-tools/br-parser-tools.scrbl similarity index 95% rename from br-parser-tools-doc/br-parser-tools/br-parser-tools.scrbl rename to yaragg-parser-tools-doc/yaragg-parser-tools/br-parser-tools.scrbl index 1a23b5e..e624dd0 100644 --- a/br-parser-tools-doc/br-parser-tools/br-parser-tools.scrbl +++ b/yaragg-parser-tools-doc/yaragg-parser-tools/br-parser-tools.scrbl @@ -2,10 +2,10 @@ @(require scribble/manual scribble/struct scribble/xref scribble/bnf (for-label scheme/base scheme/contract - br-parser-tools/lex - (prefix-in : br-parser-tools/lex-sre) - br-parser-tools/yacc - br-parser-tools/cfg-parser)) + yaragg-parser-tools/lex + (prefix-in : yaragg-parser-tools/lex-sre) + yaragg-parser-tools/yacc + yaragg-parser-tools/cfg-parser)) @title{Parser Tools: @exec{lex} and @exec{yacc}-style Parsing (BR edition)} @@ -26,7 +26,7 @@ This documentation assumes familiarity with @exec{lex}- and @exec{yacc}-style le @section-index["scanning"] @section-index["scanner"] -@defmodule[br-parser-tools/lex] +@defmodule[yaragg-parser-tools/lex] @; ---------------------------------------- @@ -61,7 +61,7 @@ This documentation assumes familiarity with @exec{lex}- and @exec{yacc}-style le @margin-note{The implementation of @racketmodname[syntax-color/racket-lexer] contains a lexer for the @racketmodname[racket] language. In addition, files in the @filepath{examples} sub-directory - of the @filepath{br-parser-tools} collection contain + of the @filepath{yaragg-parser-tools} collection contain simpler example lexers.} An @racket[re] is matched as follows: @@ -69,7 +69,7 @@ This documentation assumes familiarity with @exec{lex}- and @exec{yacc}-style le @itemize[ @item{@racket[id] --- expands to the named @deftech{lexer abbreviation}; abbreviations are defined via @racket[define-lex-abbrev] or supplied by modules - like @racketmodname[br-parser-tools/lex-sre].} + like @racketmodname[yaragg-parser-tools/lex-sre].} @item{@racket[string] --- matches the sequence of characters in @racket[string].} @item{@racket[character] --- matches a literal @racket[character].} @item{@racket[(repetition lo hi re)] --- matches @racket[re] repeated between @racket[lo] @@ -94,15 +94,15 @@ empty string, @racket[(union)] matches nothing, The regular expression language is not designed to be used directly, but rather as a basis for a user-friendly notation written with regular expression macros. For example, -@racketmodname[br-parser-tools/lex-sre] supplies operators from Olin -Shivers's SREs, and @racketmodname[br-parser-tools/lex-plt-v200] supplies +@racketmodname[yaragg-parser-tools/lex-sre] supplies operators from Olin +Shivers's SREs, and @racketmodname[yaragg-parser-tools/lex-plt-v200] supplies (deprecated) operators from the previous version of this library. Since those libraries provide operators whose names match other Racket bindings, such as @racket[*] and @racket[+], they normally must be imported using a prefix: @racketblock[ -(require (prefix-in : br-parser-tools/lex-sre)) +(require (prefix-in : yaragg-parser-tools/lex-sre)) ] The suggested prefix is @racket[:], so that @racket[:*] and @@ -360,14 +360,14 @@ characters, @racket[char-lower-case?] characters, etc.} @subsection{Lexer SRE Operators} -@defmodule[br-parser-tools/lex-sre] +@defmodule[yaragg-parser-tools/lex-sre] @; Put the docs in a macro, so that we can bound the scope of @; the import of `*', etc.: @(define-syntax-rule (lex-sre-doc) (... (begin - (require (for-label br-parser-tools/lex-sre)) + (require (for-label yaragg-parser-tools/lex-sre)) @defform[(* re ...)]{ @@ -437,16 +437,16 @@ characters.} @subsection{Lexer Legacy Operators} -@defmodule[br-parser-tools/lex-plt-v200] +@defmodule[yaragg-parser-tools/lex-plt-v200] @(define-syntax-rule (lex-v200-doc) (... (begin - (require (for-label br-parser-tools/lex-plt-v200)) + (require (for-label yaragg-parser-tools/lex-plt-v200)) -@t{The @racketmodname[br-parser-tools/lex-plt-v200] module re-exports +@t{The @racketmodname[yaragg-parser-tools/lex-plt-v200] module re-exports @racket[*], @racket[+], @racket[?], and @racket[&] from - @racketmodname[br-parser-tools/lex-sre]. It also re-exports + @racketmodname[yaragg-parser-tools/lex-sre]. It also re-exports @racket[:or] as @racket[:], @racket[::] as @racket[|@|], @racket[:~] as @racket[^], and @racket[:/] as @racket[-].} @@ -467,7 +467,7 @@ The same as @racket[(complement re ...)].}))) Each @racket[_action-expr] in a @racket[lexer] form can produce any kind of value, but for many purposes, producing a @deftech{token} value is useful. Tokens are usually necessary for inter-operating with -a parser generated by @racket[br-parser-tools/parser], but tokens may not +a parser generated by @racket[yaragg-parser-tools/parser], but tokens may not be the right choice when using @racket[lexer] in other situations. @defform[(define-tokens group-id (token-id ...))]{ @@ -513,7 +513,7 @@ be the right choice when using @racket[lexer] in other situations. @section-index["yacc"] -@defmodule[br-parser-tools/yacc] +@defmodule[yaragg-parser-tools/yacc] @defform/subs[#:literals (grammar tokens start end precs src-pos suppress debug yacc-output prec) @@ -712,9 +712,9 @@ be the right choice when using @racket[lexer] in other situations. @section-index["cfg-parser"] -@defmodule[br-parser-tools/cfg-parser]{The @racketmodname[br-parser-tools/cfg-parser] +@defmodule[yaragg-parser-tools/cfg-parser]{The @racketmodname[yaragg-parser-tools/cfg-parser] library provides a parser generator that is an alternative to that of -@racketmodname[br-parser-tools/yacc].} +@racketmodname[yaragg-parser-tools/yacc].} @defform/subs[#:literals (grammar tokens start end precs src-pos suppress debug yacc-output prec) @@ -731,7 +731,7 @@ library provides a parser generator that is an alternative to that of Creates a parser similar to that of @racket[parser]. Unlike @racket[parser], @racket[cfg-parser], can consume arbitrary and potentially ambiguous context-free - grammars. Its interface is a subset of @racketmodname[br-parser-tools/yacc], with + grammars. Its interface is a subset of @racketmodname[yaragg-parser-tools/yacc], with the following differences: @itemize[ @@ -751,7 +751,7 @@ library provides a parser generator that is an alternative to that of @section{Converting @exec{yacc} or @exec{bison} Grammars} -@defmodule[br-parser-tools/yacc-to-scheme] +@defmodule[yaragg-parser-tools/yacc-to-scheme] @defproc[(trans [file path-string?]) any/c]{ @@ -765,7 +765,7 @@ conversion tool. It is not entirely robust. For example, if the C actions in the original grammar have nested blocks, the tool will fail. Annotated examples are in the @filepath{examples} subdirectory of the -@filepath{br-parser-tools} collection.} +@filepath{yaragg-parser-tools} collection.} @; ---------------------------------------------------------------------- diff --git a/yaragg-parser-tools-doc/yaragg-parser-tools/info.rkt b/yaragg-parser-tools-doc/yaragg-parser-tools/info.rkt new file mode 100644 index 0000000..ecaff49 --- /dev/null +++ b/yaragg-parser-tools-doc/yaragg-parser-tools/info.rkt @@ -0,0 +1,3 @@ +#lang info + +(define scribblings '(("yaragg-parser-tools.scrbl" (multi-page) (parsing-library)))) diff --git a/br-parser-tools-lib/LICENSE.txt b/yaragg-parser-tools-lib/LICENSE.txt similarity index 100% rename from br-parser-tools-lib/LICENSE.txt rename to yaragg-parser-tools-lib/LICENSE.txt diff --git a/br-parser-tools-lib/info.rkt b/yaragg-parser-tools-lib/info.rkt similarity index 66% rename from br-parser-tools-lib/info.rkt rename to yaragg-parser-tools-lib/info.rkt index 1e24a13..6158c09 100644 --- a/br-parser-tools-lib/info.rkt +++ b/yaragg-parser-tools-lib/info.rkt @@ -5,5 +5,3 @@ "base" "compatibility-lib")) (define build-deps '("rackunit-lib")) - -(define pkg-desc "implementation (no documentation) part of \"br-parser-tools\"") diff --git a/br-parser-tools-lib/br-parser-tools/cfg-parser.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/cfg-parser.rkt similarity index 99% rename from br-parser-tools-lib/br-parser-tools/cfg-parser.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/cfg-parser.rkt index 250b019..a0bd2d7 100755 --- a/br-parser-tools-lib/br-parser-tools/cfg-parser.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/cfg-parser.rkt @@ -1,5 +1,5 @@ #lang racket/base -;; This module implements a parser form like the br-parser-tools's +;; This module implements a parser form like the yaragg-parser-tools's ;; `parser', except that it works on an arbitrary CFG (returning ;; the first sucecssful parse). @@ -23,7 +23,7 @@ ;; different lengths. (Otherwise, in the spirit of finding one ;; successful parse, only the first result is kept.) -;; The br-parser-tools's `parse' is used to transform tokens in the +;; The yaragg-parser-tools's `parse' is used to transform tokens in the ;; grammar to tokens specific to this parser. In other words, this ;; parser uses `parser' so that it doesn't have to know anything about ;; tokens. @@ -31,12 +31,12 @@ -(require br-parser-tools/yacc - br-parser-tools/lex) +(require yaragg-parser-tools/yacc + yaragg-parser-tools/lex) (require (for-syntax racket/base syntax/boundmap - br-parser-tools/private-lex/token-syntax)) + yaragg-parser-tools/private-lex/token-syntax)) (provide cfg-parser) @@ -752,7 +752,7 @@ (module* test racket/base (require (submod "..") - br-parser-tools/lex + yaragg-parser-tools/lex racket/block rackunit) diff --git a/br-parser-tools-lib/br-parser-tools/examples/calc.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/examples/calc.rkt similarity index 95% rename from br-parser-tools-lib/br-parser-tools/examples/calc.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/examples/calc.rkt index 0d351bd..7d86837 100644 --- a/br-parser-tools-lib/br-parser-tools/examples/calc.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/examples/calc.rkt @@ -4,9 +4,9 @@ ;; Import the parser and lexer generators. -(require br-parser-tools/yacc - br-parser-tools/lex - (prefix-in : br-parser-tools/lex-sre)) +(require yaragg-parser-tools/yacc + yaragg-parser-tools/lex + (prefix-in : yaragg-parser-tools/lex-sre)) (define-tokens value-tokens (NUM VAR FNCT)) (define-empty-tokens op-tokens (newline = OP CP + - * / ^ EOF NEG)) diff --git a/br-parser-tools-lib/br-parser-tools/examples/read.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/examples/read.rkt similarity index 98% rename from br-parser-tools-lib/br-parser-tools/examples/read.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/examples/read.rkt index b01f77a..992b561 100644 --- a/br-parser-tools-lib/br-parser-tools/examples/read.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/examples/read.rkt @@ -4,9 +4,9 @@ ;; list of syntax objects, instead of returning one syntax object at a time (require (for-syntax racket/base) - br-parser-tools/lex - (prefix-in : br-parser-tools/lex-sre) - br-parser-tools/yacc + yaragg-parser-tools/lex + (prefix-in : yaragg-parser-tools/lex-sre) + yaragg-parser-tools/yacc syntax/readerr) (define-tokens data (DATUM)) diff --git a/br-parser-tools-lib/br-parser-tools/info.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/info.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/info.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/info.rkt diff --git a/br-parser-tools-lib/br-parser-tools/lex-plt-v200.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/lex-plt-v200.rkt similarity index 84% rename from br-parser-tools-lib/br-parser-tools/lex-plt-v200.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/lex-plt-v200.rkt index ce11f2d..486cc26 100644 --- a/br-parser-tools-lib/br-parser-tools/lex-plt-v200.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/lex-plt-v200.rkt @@ -1,7 +1,7 @@ #lang racket/base (require (for-syntax racket/base) - br-parser-tools/lex - (prefix-in : br-parser-tools/lex-sre)) + yaragg-parser-tools/lex + (prefix-in : yaragg-parser-tools/lex-sre)) (provide epsilon ~ (rename-out [:* *] diff --git a/br-parser-tools-lib/br-parser-tools/lex-sre.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/lex-sre.rkt similarity index 98% rename from br-parser-tools-lib/br-parser-tools/lex-sre.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/lex-sre.rkt index 40f2b16..172c55d 100644 --- a/br-parser-tools-lib/br-parser-tools/lex-sre.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/lex-sre.rkt @@ -1,6 +1,6 @@ #lang racket/base (require (for-syntax racket/base) - br-parser-tools/lex) + yaragg-parser-tools/lex) (provide (rename-out [sre-* *] [sre-+ +] diff --git a/br-parser-tools-lib/br-parser-tools/lex.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/lex.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/lex.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/lex.rkt diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/actions.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/actions.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/private-lex/actions.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/actions.rkt diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/deriv.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/deriv.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/private-lex/deriv.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/deriv.rkt diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/error-tests.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/error-tests.rkt similarity index 98% rename from br-parser-tools-lib/br-parser-tools/private-lex/error-tests.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/error-tests.rkt index 108dca2..7cb25be 100644 --- a/br-parser-tools-lib/br-parser-tools/private-lex/error-tests.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/error-tests.rkt @@ -1,6 +1,6 @@ #lang racket/base (require (for-syntax racket/base) - br-parser-tools/private-lex/lex + yaragg-parser-tools/private-lex/lex rackunit) (define-syntax (catch-syn-error stx) diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/front.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/front.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/private-lex/front.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/front.rkt diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/re.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/re.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/private-lex/re.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/re.rkt diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/stx.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/stx.rkt similarity index 99% rename from br-parser-tools-lib/br-parser-tools/private-lex/stx.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/stx.rkt index 9d1f90e..ed01dea 100644 --- a/br-parser-tools-lib/br-parser-tools/private-lex/stx.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/stx.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require br-parser-tools/private-lex/util syntax/id-table racket/syntax) +(require yaragg-parser-tools/private-lex/util syntax/id-table racket/syntax) (provide parse) (define (bad-args stx num) diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/token-syntax.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/token-syntax.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/private-lex/token-syntax.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/token-syntax.rkt diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/token.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/token.rkt similarity index 97% rename from br-parser-tools-lib/br-parser-tools/private-lex/token.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/token.rkt index 7e5f0f0..8139668 100644 --- a/br-parser-tools-lib/br-parser-tools/private-lex/token.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/token.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require (for-syntax racket/base br-parser-tools/private-lex/token-syntax)) +(require (for-syntax racket/base yaragg-parser-tools/private-lex/token-syntax)) ;; Defining tokens diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/unicode-chars.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/unicode-chars.rkt similarity index 97% rename from br-parser-tools-lib/br-parser-tools/private-lex/unicode-chars.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/unicode-chars.rkt index 1832aca..56a6b1a 100644 --- a/br-parser-tools-lib/br-parser-tools/private-lex/unicode-chars.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/unicode-chars.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require racket/promise br-parser-tools/private-lex/util) +(require racket/promise yaragg-parser-tools/private-lex/util) (provide (all-defined-out)) diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/util.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/util.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/private-lex/util.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-lex/util.rkt diff --git a/br-parser-tools-lib/br-parser-tools/private-yacc/grammar.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/grammar.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/private-yacc/grammar.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/grammar.rkt diff --git a/br-parser-tools-lib/br-parser-tools/private-yacc/graph.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/graph.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/private-yacc/graph.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/graph.rkt diff --git a/br-parser-tools-lib/br-parser-tools/private-yacc/input-file-parser.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/input-file-parser.rkt similarity index 98% rename from br-parser-tools-lib/br-parser-tools/private-yacc/input-file-parser.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/input-file-parser.rkt index 52ca94f..40eaeda 100644 --- a/br-parser-tools-lib/br-parser-tools/private-yacc/input-file-parser.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/input-file-parser.rkt @@ -1,7 +1,7 @@ #lang racket/base -(require br-parser-tools/private-yacc/yacc-helper - br-parser-tools/private-lex/token-syntax - br-parser-tools/private-yacc/grammar +(require yaragg-parser-tools/private-yacc/yacc-helper + yaragg-parser-tools/private-lex/token-syntax + yaragg-parser-tools/private-yacc/grammar racket/class racket/contract (for-template racket/base)) diff --git a/br-parser-tools-lib/br-parser-tools/private-yacc/lalr.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/lalr.rkt similarity index 99% rename from br-parser-tools-lib/br-parser-tools/private-yacc/lalr.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/lalr.rkt index d6b1b10..91a6b6a 100644 --- a/br-parser-tools-lib/br-parser-tools/private-yacc/lalr.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/lalr.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require br-parser-tools/private-yacc/lr0 - br-parser-tools/private-yacc/grammar +(require yaragg-parser-tools/private-yacc/lr0 + yaragg-parser-tools/private-yacc/grammar racket/list racket/class) diff --git a/br-parser-tools-lib/br-parser-tools/private-yacc/lr0.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/lr0.rkt similarity index 99% rename from br-parser-tools-lib/br-parser-tools/private-yacc/lr0.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/lr0.rkt index f771e20..f6e13a7 100644 --- a/br-parser-tools-lib/br-parser-tools/private-yacc/lr0.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/lr0.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require br-parser-tools/private-yacc/grammar - br-parser-tools/private-yacc/graph +(require yaragg-parser-tools/private-yacc/grammar + yaragg-parser-tools/private-yacc/graph racket/list racket/class) diff --git a/br-parser-tools-lib/br-parser-tools/private-yacc/parser-actions.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/parser-actions.rkt similarity index 97% rename from br-parser-tools-lib/br-parser-tools/private-yacc/parser-actions.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/parser-actions.rkt index 81b25b3..16c7857 100644 --- a/br-parser-tools-lib/br-parser-tools/private-yacc/parser-actions.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/parser-actions.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require br-parser-tools/private-yacc/grammar) +(require yaragg-parser-tools/private-yacc/grammar) (provide (except-out (all-defined-out) make-reduce make-reduce*) (rename-out [make-reduce* make-reduce])) diff --git a/br-parser-tools-lib/br-parser-tools/private-yacc/parser-builder.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/parser-builder.rkt similarity index 96% rename from br-parser-tools-lib/br-parser-tools/private-yacc/parser-builder.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/parser-builder.rkt index 5bf89b8..95a9aee 100644 --- a/br-parser-tools-lib/br-parser-tools/private-yacc/parser-builder.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/parser-builder.rkt @@ -1,7 +1,7 @@ #lang racket/base -(require br-parser-tools/private-yacc/input-file-parser - br-parser-tools/private-yacc/grammar - br-parser-tools/private-yacc/table +(require yaragg-parser-tools/private-yacc/input-file-parser + yaragg-parser-tools/private-yacc/grammar + yaragg-parser-tools/private-yacc/table racket/class racket/contract) (require (for-template racket/base)) diff --git a/br-parser-tools-lib/br-parser-tools/private-yacc/table.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/table.rkt similarity index 98% rename from br-parser-tools-lib/br-parser-tools/private-yacc/table.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/table.rkt index 200f5b7..971cfb4 100644 --- a/br-parser-tools-lib/br-parser-tools/private-yacc/table.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/table.rkt @@ -1,8 +1,8 @@ #lang racket/base -(require br-parser-tools/private-yacc/grammar - br-parser-tools/private-yacc/lr0 - br-parser-tools/private-yacc/lalr - br-parser-tools/private-yacc/parser-actions +(require yaragg-parser-tools/private-yacc/grammar + yaragg-parser-tools/private-yacc/lr0 + yaragg-parser-tools/private-yacc/lalr + yaragg-parser-tools/private-yacc/parser-actions racket/contract racket/list racket/class) diff --git a/br-parser-tools-lib/br-parser-tools/private-yacc/yacc-helper.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/yacc-helper.rkt similarity index 97% rename from br-parser-tools-lib/br-parser-tools/private-yacc/yacc-helper.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/yacc-helper.rkt index 90e465e..a101f12 100644 --- a/br-parser-tools-lib/br-parser-tools/private-yacc/yacc-helper.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/private-yacc/yacc-helper.rkt @@ -1,6 +1,6 @@ #lang racket/base (require (prefix-in rl: racket/list) - br-parser-tools/private-lex/token-syntax) + yaragg-parser-tools/private-lex/token-syntax) ;; General helper routines (provide duplicate-list? remove-duplicates overlap? vector-andmap display-yacc) diff --git a/br-parser-tools-lib/br-parser-tools/yacc-to-scheme.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/yacc-to-scheme.rkt similarity index 97% rename from br-parser-tools-lib/br-parser-tools/yacc-to-scheme.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/yacc-to-scheme.rkt index d0e97fe..630b5a6 100644 --- a/br-parser-tools-lib/br-parser-tools/yacc-to-scheme.rkt +++ b/yaragg-parser-tools-lib/yaragg-parser-tools/yacc-to-scheme.rkt @@ -1,7 +1,7 @@ #lang racket/base -(require br-parser-tools/lex - (prefix-in : br-parser-tools/lex-sre) - br-parser-tools/yacc +(require yaragg-parser-tools/lex + (prefix-in : yaragg-parser-tools/lex-sre) + yaragg-parser-tools/yacc syntax/readerr racket/list) (provide trans) diff --git a/br-parser-tools-lib/br-parser-tools/yacc.rkt b/yaragg-parser-tools-lib/yaragg-parser-tools/yacc.rkt similarity index 100% rename from br-parser-tools-lib/br-parser-tools/yacc.rkt rename to yaragg-parser-tools-lib/yaragg-parser-tools/yacc.rkt diff --git a/br-parser-tools/LICENSE.txt b/yaragg-parser-tools/LICENSE.txt similarity index 100% rename from br-parser-tools/LICENSE.txt rename to yaragg-parser-tools/LICENSE.txt diff --git a/yaragg-parser-tools/info.rkt b/yaragg-parser-tools/info.rkt new file mode 100644 index 0000000..03279fa --- /dev/null +++ b/yaragg-parser-tools/info.rkt @@ -0,0 +1,8 @@ +#lang info + +(define collection 'multi) + +(define deps '("yaragg-parser-tools-lib" + "yaragg-parser-tools-doc")) +(define implies '("yaragg-parser-tools-lib" + "yaragg-parser-tools-doc")) diff --git a/brag/info.rkt b/yaragg/info.rkt similarity index 63% rename from brag/info.rkt rename to yaragg/info.rkt index 1fc64ef..8b32fef 100755 --- a/brag/info.rkt +++ b/yaragg/info.rkt @@ -3,11 +3,11 @@ (define collection 'multi) (define deps '(["base" #:version "6.3"] - "brag-lib")) + "yaragg-lib")) (define build-deps '("at-exp-lib" - "br-parser-tools-doc" + "yaragg-parser-tools-doc" "racket-doc" "scribble-lib")) -(define implies '("brag-lib")) \ No newline at end of file +(define implies '("yaragg-lib")) \ No newline at end of file diff --git a/yaragg/yaragg/info.rkt b/yaragg/yaragg/info.rkt new file mode 100755 index 0000000..34da740 --- /dev/null +++ b/yaragg/yaragg/info.rkt @@ -0,0 +1,4 @@ +#lang info + +(define scribblings '(("yaragg.scrbl"))) + diff --git a/brag/brag/brag.scrbl b/yaragg/yaragg/yaragg.scrbl similarity index 96% rename from brag/brag/brag.scrbl rename to yaragg/yaragg/yaragg.scrbl index 2babb1d..2adfc46 100755 --- a/brag/brag/brag.scrbl +++ b/yaragg/yaragg/yaragg.scrbl @@ -4,8 +4,8 @@ file/md5 (for-label racket brag - brag/support - (only-in br-parser-tools/lex lexer-src-pos) + yaragg/support + (only-in yaragg-parser-tools/lex lexer-src-pos) (only-in syntax/parse syntax-parse ~literal))) @@ -42,7 +42,7 @@ Originally @racket[brag] was built to support the @link["https://docs.racket-lan @section{Quick start} @(define my-eval (make-base-eval)) -@(my-eval '(require brag/examples/nested-word-list +@(my-eval '(require yaragg/examples/nested-word-list racket/list racket/match)) @@ -68,7 +68,7 @@ What we intend by this notation is this: @racket[nested-word-list] is either a @ Here are a few examples of tokens: @interaction[#:eval my-eval - (require brag/support) + (require yaragg/support) (token 'LEFT-PAREN) (token 'WORD "crunchy" #:span 7) (token 'RIGHT-PAREN)] @@ -247,9 +247,9 @@ that can parse tokens and produce a syntax object as a result. Let's try this function: @interaction[#:eval my-eval - (require brag/support) + (require yaragg/support) @eval:alts[(require "simple-line-drawing.rkt") - (require brag/examples/simple-line-drawing)] + (require yaragg/examples/simple-line-drawing)] (define stx (parse (list (token 'INTEGER 6) (token 'INTEGER 2) @@ -264,11 +264,11 @@ A @emph{token} is the smallest meaningful element of a source program. Tokens ca If possible, we also want to attach source location information to each token. Why? Because this information will be incorporated into the syntax objects produced by @racket[parse]. -A parser often works in conjunction with a helper function called a @emph{lexer} that converts the raw code of the source program into tokens. The @racketmodname[br-parser-tools/lex] library can help us write a position-sensitive +A parser often works in conjunction with a helper function called a @emph{lexer} that converts the raw code of the source program into tokens. The @racketmodname[yaragg-parser-tools/lex] library can help us write a position-sensitive tokenizer: @interaction[#:eval my-eval - (require br-parser-tools/lex) + (require yaragg-parser-tools/lex) (define (tokenize ip) (port-count-lines! ip) (define my-lexer @@ -307,7 +307,7 @@ Note also from this lexer example: @item{@racket[parse] accepts as input either a sequence of tokens, or a function that produces tokens (which @racket[parse] will call repeatedly to get the next token).} - @item{As an alternative to the basic @racket[token] structure, a token can also be an instance of the @racket[position-token] structure (also found in @racketmodname[br-parser-tools/lex]). In that case, the token will try to derive its position from that of the position-token.} + @item{As an alternative to the basic @racket[token] structure, a token can also be an instance of the @racket[position-token] structure (also found in @racketmodname[yaragg-parser-tools/lex]). In that case, the token will try to derive its position from that of the position-token.} @item{@racket[parse] will stop if it gets @racket[void] (or @racket['eof]) as a token.} @@ -492,7 +492,7 @@ Let's add one. @filebox["letter-i.rkt"]{ @verbatim|{ - #lang brag/examples/simple-line-drawing + #lang yaragg/examples/simple-line-drawing 3 9 X; 6 3 b 3 X 3 b; 3 9 X; @@ -510,7 +510,7 @@ things: @itemize[ @item{Tell Racket to use the @tt{brag}-generated parser and lexer we defined earlier whenever it sees a program written with - @litchar{#lang brag/examples/simple-line-drawing}.} + @litchar{#lang yaragg/examples/simple-line-drawing}.} @item{Define transformation rules for @racket[drawing], @racket[rows], and @racket[chunk] to rewrite these into standard Racket forms.} @@ -530,19 +530,19 @@ We do the first part by defining a @emph{module reader}: a @filepath{/lang/reader}. Here's the definition for -@filepath{brag/examples/simple-line-drawing/lang/reader.rkt}: +@filepath{yaragg/examples/simple-line-drawing/lang/reader.rkt}: -@filebox["brag/examples/simple-line-drawing/lang/reader.rkt"]{ +@filebox["yaragg/examples/simple-line-drawing/lang/reader.rkt"]{ @codeblock|{ #lang s-exp syntax/module-reader - brag/examples/simple-line-drawing/semantics + yaragg/examples/simple-line-drawing/semantics #:read my-read #:read-syntax my-read-syntax #:info my-get-info #:whole-body-readers? #t - (require brag/examples/simple-line-drawing/lexer - brag/examples/simple-line-drawing/grammar) + (require yaragg/examples/simple-line-drawing/lexer + yaragg/examples/simple-line-drawing/grammar) (define (my-read in) (syntax->datum (my-read-syntax #f in))) @@ -566,7 +566,7 @@ object using a module called @filepath{semantics.rkt}. Let's look into @filepath{semantics.rkt} and see what's involved in compilation: -@filebox["brag/examples/simple-line-drawing/semantics.rkt"]{ +@filebox["yaragg/examples/simple-line-drawing/semantics.rkt"]{ @codeblock|{ #lang racket/base (require (for-syntax racket/base syntax/parse)) @@ -939,8 +939,8 @@ bindings. The most important of these is @racket[parse]: @item{a string} @item{a symbol} @item{an instance produced by @racket[token]} - @item{an instance produced by the token constructors of @racketmodname[br-parser-tools/lex]} - @item{an instance of @racketmodname[br-parser-tools/lex]'s @racket[position-token] whose + @item{an instance produced by the token constructors of @racketmodname[yaragg-parser-tools/lex]} + @item{an instance of @racketmodname[yaragg-parser-tools/lex]'s @racket[position-token] whose @racket[position-token-token] is a @tech{token}.} ] @@ -1003,7 +1003,7 @@ Thus, it's only the presence of @tech{rule identifier}s in a rule's the following interaction shows how to extract a parser for @racket[term]s. @interaction[#:eval my-eval @eval:alts[(require "simple-arithmetic-grammar.rkt") - (require brag/examples/simple-arithmetic-grammar)] + (require yaragg/examples/simple-arithmetic-grammar)] (define term-parse (make-rule-parser term)) (define tokens (list (token 'INT 3) "*" @@ -1029,7 +1029,7 @@ Thus, it's only the presence of @tech{rule identifier}s in a rule's For example: @interaction[#:eval my-eval @eval:alts[(require "simple-arithmetic-grammar.rkt") - (require brag/examples/simple-arithmetic-grammar)] + (require yaragg/examples/simple-arithmetic-grammar)] all-token-types ] @@ -1039,13 +1039,13 @@ Thus, it's only the presence of @tech{rule identifier}s in a rule's @section{Support API} -@defmodule[brag/support] +@defmodule[yaragg/support] -The @racketmodname[brag/support] module provides functions to interact with +The @racketmodname[yaragg/support] module provides functions to interact with @tt{brag} programs. The most useful is the @racket[token] function, which produces tokens to be parsed. -In addition to the exports shown below, the @racketmodname[brag/support] module also provides everything from @racketmodname[brag/support], and everything from @racketmodname[br-parser-tools/lex]. +In addition to the exports shown below, the @racketmodname[yaragg/support] module also provides everything from @racketmodname[yaragg/support], and everything from @racketmodname[yaragg-parser-tools/lex]. @defproc[(token [type (or/c string? symbol?)]