(index ("char" 0) ("<c>" 130) ("seq" 197) ("<and>" 341) ("sel" 429) ("<or>" 577) ("one?" 661) ("<?>" 799) ("rep" 868) ("<*>" 1176) ("rep+" 1244) ("<+>" 1328) ("pred" 1397) ("<&>" 1872) ("pred!" 1949) ("<&!>" 2036) ("eof" 2117) ("act" 2177) ("<@>" 2694) ("neg" 2786) ("<^>" 2869) ("regexp-parser" 2937) ("<r>" 3050) ("lazy" 3141) ("cached" 3535) ("str" 3633) ("<s>" 3704) ("one-of" 3772) ("join+" 3862) ("join+_" 4309) ("ind" 4494) ("<#>" 4730) ("<w>" 4808) ("<w*>" 4972) ("<w+>" 5048) ("<space>" 5123) ("<s*>" 5228) ("<s+>" 5313) ("rep_" 5397) ("<*_>" 5574) ("rep+_" 5662) ("<+_>" 6113) ("seq_" 6202) ("and_" 6357) ("even" 6448) ("odd" 6835) ("parse-file" 7212) ("parse-string" 7367) ("parse-port" 7526))
(def (sig (procedure "(char CHAR)" (id char))) (p "Generate a parser that reads a char and returns this character as a string."))
(def (sig (procedure "(<c> CHAR)" (id <c>))) (p "Alias of char."))
(def (sig (procedure "(seq PARSER ...)" (id seq))) (p "Sequence parser: each subparser must match, and their results are returned in a list."))
(def (sig (procedure "(<and> PARSER ...)" (id <and>))) (p "Alias of sequence parser."))
(def (sig (procedure "(sel PARSER ...)" (id sel))) (p "Branch parser and ordered selected.  Returns the result of the first parser that matches."))
(def (sig (procedure "(<or> PARSER ...)" (id <or>))) (p "Alias of branch parser."))
(def (sig (procedure "(one? PARSER)" (id one?))) (p "Appear 0 or 1 time.  Returns the empty string if " (tt "PARSER") " doesn't match."))
(def (sig (procedure "(<?> PARSER)" (id <?>))) (p "Alias of one?."))
(def (sig (procedure "(rep PARSER)" (id rep))) (p "Repeat 0 to infinite times.  Returns a list of " (tt "PARSER") " results, with as many items as matches that were found.") (p "Example:") (highlight scheme "(parse-string \"aabba\" (rep (sel (char #\\a) (char #\\b))))\n=> (\"a\" \"a\" \"b\" \"b\" \"a\")"))
(def (sig (procedure "(<*> PARSER)" (id <*>))) (p "Alias of rep."))
(def (sig (procedure "(rep+ PARSER)" (id rep+))) (p "Repeat 1 to infinite times."))
(def (sig (procedure "(<+> PARSER)" (id <+>))) (p "Alias of rep+."))
(def (sig (procedure "(pred PARSER0 PARSER1)" (id pred))) (p "Lookahead predicate PARSER1.") (p "Example:") (highlight scheme "(parse-string \"a\" (pred (char #\\a) (eof)))\n=> \"a\"\n;; If we had used (seq), we would get '(\"a\" \"\")\n\n;; This also allows us to ensure this is the entire string:\n(parse-string \"ab\" (pred (char #\\a) (eof)))\n=> #f\n\n;; Without the lookahead, it will simply consume as much as possible:\n(parse-string \"ab\" (char #\\a))\n=> \"a\""))
(def (sig (procedure "(<&> PARSER0 PARSER1)" (id <&>))) (p "Alias of pred"))
(def (sig (procedure "(pred! PARSER0 PARSER1)" (id pred!))) (p "Negative lookahead."))
(def (sig (procedure "(<&!> PARSER0 PARSER1)" (id <&!>))) (p "Alias of pred!."))
(def (sig (procedure "(eof)" (id eof))) (p "End of file."))
(def (sig (procedure "(act PARSER [SUCC-PROC] [FAIL-PREC])" (id act))) (p "Act on the result of the parser, whether it's success or failure.") (p "This allows you to add semantic actions to the parser.") (p (b "Note:") " Be sure not to return " (tt "#f") " in " (tt "SUCC-PROC") ", because that will be filtered out.") (p "Example:") (highlight scheme "(define a-or-b (sel (char #\\a) (char #\\b)))\n(parse-string \"aabba\" (rep (act a-or-b (lambda (x) (if (string=? \"a\" x) 'yes 'no)))))\n=> (yes yes no no yes)"))
(def (sig (procedure "(<@> PARSER [SUCC-PROC] [FAIL-PREC])" (id <@>))) (p "Alias of act."))
(def (sig (procedure "(neg PARSER)" (id neg))) (p "Take parser failure as pass."))
(def (sig (procedure "(<^> PARSER)" (id <^>))) (p "Alias of neg."))
(def (sig (procedure "(regexp-parser STRING [CHUNK-SIZE])" (id regexp-parser))) (p "Generate a regexp parser."))
(def (sig (procedure "(<r> STRING [CHUNK-SIZE])" (id <r>))) (p "Alias of regexp-parser."))
(def (sig (syntax "(lazy PARSER)" (id lazy))) (p "Defer the binding of parser. This is useful for mutually recursive parsers, as " (tt "PARSER") " can be defined after the use of the lazy parser.") (p "Example:") (highlight scheme ";; Without \"lazy\" around bar, this would give an error that\n;; bar is not yet defined.\n(define foo (sel (char #\\x) (lazy bar)))\n(define bar (char #\\y))"))
(def (sig (procedure "(cached PARSER)" (id cached))) (p "Cache parser result(packrat parsing)."))
(def (sig (procedure "(str STRING)" (id str))) (p "A string parser."))
(def (sig (procedure "(<s> STRING)" (id <s>))) (p "Alias of str."))
(def (sig (procedure "(one-of STRING)" (id one-of))) (p "Parse one of chars in STRING."))
(def (sig (procedure "(join+ PARSER0 PARSER1)" (id join+))) (p "Repeat PARSER0 one or more times, interspersed by PARSER1.") (p "Example:") (highlight scheme ";; Parse an array of \"a\" or \"b\" identifiers:\n;; This can be done more elegantly with rep+_\n(define ident (sel (char #\\a) (char #\\b)))\n\n(parse-string\n   \"[a,b,b,a]\"\n   (even (ind (seq (char #\\[) (join+ ident (char #\\,)) (char #\\])) 1)))\n\n=> (\"a\" \"b\" \"b\" \"a\")"))
(def (sig (procedure "(join+_ PARSER0 PARSER1 [skip: PARSER2])" (id join+_))) (p "Repeat PARSER0 with PARSER1 inserted but skip PARSER2. By default, PARSER2 is spaces parser (<s*>)."))
(def (sig (procedure "(ind SEQ-PARSER INDEX)" (id ind))) (p "Return the value of SEQ_PARSER output that is indicated by INDEX.") (p "Example:") (highlight scheme "(parse-string \"xy\" (ind (seq (char #\\x) (char #\\y)) 1))\n=> \"y\""))
(def (sig (procedure "(<#> SEQ-PARSER INDEX)" (id <#>))) (p "Alias of ind."))
(def (sig (procedure "(<w>)" (id <w>))) (p "A word letter (any uppercase or lowercase letter, digit or underscore, i.e. the same as " (tt "(<r> \"\\\\w\")") ")."))
(def (sig (procedure "(<w*>)" (id <w*>))) (p "Zero or more word letters."))
(def (sig (procedure "(<w+>)" (id <w+>))) (p "One or more word letters."))
(def (sig (procedure "(<space>)" (id <space>))) (p "One whitespace character (space, tab or newline)."))
(def (sig (procedure "(<s*>)" (id <s*>))) (p "Zero or more whitespace characters."))
(def (sig (procedure "(<s+>)" (id <s+>))) (p "One or more whitespace characters."))
(def (sig (procedure "(rep_ PARSER0 [skip: PARSER1])" (id rep_))) (p "Repeat PARSER0 from 0 to infinite times, but skip PARSER1. By default, PARSER1 is spaces parser (<s*>)."))
(def (sig (procedure "(<*_> PARSER0 [skip: PARSER1])" (id <*_>))) (p "Alias of rep_."))
(def (sig (procedure "(rep+_ PARSER0 [skip: PARSER1])" (id rep+_))) (p "Repeat PARSER0 from 1 to infinite times, but skip PARSER1. By default, PARSER1 is spaces parser (<s*>).") (p "Example:") (highlight scheme ";; Parse an array of \"a\" or \"b\" identifiers:\n(define ident (sel (char #\\a) (char #\\b)))\n\n(parse-string\n   \"[a,b,b,a]\"\n   (ind (seq (char #\\[) (rep+_ a-or-b skip: (char #\\,)) (char #\\])) 1))\n=> (\"a\" \"b\" \"b\" \"a\")"))
(def (sig (procedure "(<+_> PARSER0 [skip: PARSER1])" (id <+_>))) (p "Alias of rep+_."))
(def (sig (procedure "(seq_ PARSER ... [skip: PARSER1])" (id seq_))) (p "Sequence parser but skip PARSER1. By default, PARSER1 is spaces parser (<s*>)."))
(def (sig (procedure "(and_ PARSER ... [skip: PARSER1])" (id and_))) (p "Alias of seq_."))
(def (sig (procedure "(even SEQ-PARSER)" (id even))) (p "Generate a parser which returns the elements at even-numbered positions of sequence parser output, collected in a list.") (p (b "Note:") " This starts counting at zero!") (p "Example:") (highlight scheme "(parse-string \"abcde\" (even (seq (char #\\a) (char #\\b) (char #\\c) (char #\\d) (char #\\e))))\n=> (\"a\" \"c\" \"e\")"))
(def (sig (procedure "(odd SEQ-PARSER)" (id odd))) (p "Generate a parser which returns the elements at odd-numbered positions of sequence parser output, collected in a list.") (p (b "Note:") " This starts counting at zero!") (p "Example:") (highlight scheme "(parse-string \"abcde\" (odd (seq (char #\\a) (char #\\b) (char #\\c) (char #\\d) (char #\\e))))\n=> (\"b\" \"d\")"))
(def (sig (procedure "(parse-file FILENAME PARSER [CACHE])" (id parse-file))) (p "Parse a file with " (tt "PARSER") ". By default, no cache (CACHE=#f)."))
(def (sig (procedure "(parse-string STRING PARSER [CACHE])" (id parse-string))) (p "Parse a string with " (tt "PARSER") ". By default, no cache (CACHE=#f)."))
(def (sig (syntax "(parse-port PORT PARSER [CACHE])" (id parse-port))) (p "Parse from " (tt "PORT") " with " (tt "PARSER") ". By default, no cache (CACHE=#f)."))
