]> gitweb.factorcode.org Git - factor.git/blob - extra/parser-combinators/parser-combinators-docs.factor
Reformat
[factor.git] / extra / parser-combinators / parser-combinators-docs.factor
1 ! Copyright (C) 2006 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax ;
4 IN: parser-combinators
5
6 HELP: list-of
7 { $values
8   { "items" "a parser object" } { "separator" "a parser object" } { "parser" "a parser object" } }
9 { $description
10     "Return a parser for parsing the repetition of things that are "
11     "separated by a certain symbol. For example, comma separated lists. "
12     "'items' is a parser that can parse the individual elements. 'separator' "
13     "is a parser for the symbol that separatest them. The result tree of "
14     "the resulting parser is an array of the parsed elements." }
15 { $example "USING: parser-combinators parser-combinators.simple prettyprint ;" "\"1,2,3,4\" integer-parser \",\" token list-of parse-1 ." "{ 1 2 3 4 }" }
16 { $see-also list-of } ;
17
18 HELP: any-char-parser
19 { $values
20   { "parser" "a parser object" } }
21 { $description
22     "Return a parser that consumes a single value "
23     "from the input string. The value consumed is the "
24     "result of the parse." }
25 { $examples
26 { $example "USING: lists.lazy parser-combinators prettyprint ;" "\"foo\" any-char-parser parse-1 ." "102" } } ;