2007-09-20 18:09:08 -04:00
|
|
|
! Copyright (C) 2006 Chris Double.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2008-01-09 01:36:11 -05:00
|
|
|
USING: help.markup help.syntax ;
|
|
|
|
IN: parser-combinators
|
2007-09-20 18:09:08 -04:00
|
|
|
|
|
|
|
HELP: list-of
|
2007-11-24 18:07:01 -05:00
|
|
|
{ $values
|
2007-09-20 18:09:08 -04:00
|
|
|
{ "items" "a parser object" } { "separator" "a parser object" } { "parser" "a parser object" } }
|
2007-11-24 18:07:01 -05:00
|
|
|
{ $description
|
2007-09-20 18:09:08 -04:00
|
|
|
"Return a parser for parsing the repetition of things that are "
|
|
|
|
"separated by a certain symbol. For example, comma separated lists. "
|
|
|
|
"'items' is a parser that can parse the individual elements. 'separator' "
|
2007-11-24 18:07:01 -05:00
|
|
|
"is a parser for the symbol that separatest them. The result tree of "
|
2007-09-20 18:09:08 -04:00
|
|
|
"the resulting parser is an array of the parsed elements." }
|
2008-03-11 20:51:58 -04:00
|
|
|
{ $example "USING: parser-combinators parser-combinators.simple prettyprint ;" "\"1,2,3,4\" 'integer' \",\" token list-of parse-1 ." "{ 1 2 3 4 }" }
|
2007-09-20 18:09:08 -04:00
|
|
|
{ $see-also list-of } ;
|
|
|
|
|
2007-11-24 18:07:01 -05:00
|
|
|
HELP: any-char-parser
|
|
|
|
{ $values
|
|
|
|
{ "parser" "a parser object" } }
|
|
|
|
{ $description
|
|
|
|
"Return a parser that consumes a single value "
|
|
|
|
"from the input string. The value consumed is the "
|
|
|
|
"result of the parse." }
|
|
|
|
{ $examples
|
2008-06-03 05:06:52 -04:00
|
|
|
{ $example "USING: lists.lazy parser-combinators prettyprint ;" "\"foo\" any-char-parser parse-1 ." "102" } } ;
|