2008-03-12 11:43:18 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								! Copyright (C) 2008 Chris Double, Doug Coleman. 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								! See http://factorcode.org/license.txt for BSD license. 
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								USING:  help.markup  help.syntax  kernel  math  sequences 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								unicode.categories strings ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								IN:  peg.parsers 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-03-12 11:43:18 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  1token 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "ch"  "a character"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Calls 1string on a character and returns a parser that matches that character." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $examples
							 
						 
					
						
							
								
									
										
										
										
											2008-07-14 21:51:30 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"a\" CHAR: a 1token parse ."  "\"a\""  }
							 
						 
					
						
							
								
									
										
										
										
											2015-08-15 21:10:13 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} { $see-also string-parser } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-12 11:43:18 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  (list-of) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { "items"  sequence  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "separator"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { "repeat1?"  boolean  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that returns a list of items separated by the separator parser.  Does not hide the separators." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $see-also list-of list-of-many } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  list-of 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { "items"  sequence  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "separator"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-11 20:51:58 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that returns a list of items separated by the separator parser.  Hides the separators and matches a list of one or more items." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $notes "Use "  { $link list-of-many } " to ensure a list contains two or more items."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples
							 
						 
					
						
							
								
									
										
										
										
											2008-07-14 21:51:30 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"a\" \"a\" token \",\" token list-of parse  ."  "V{ \"a\" }"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"a,a,a,a\" \"a\" token \",\" token list-of parse ."  "V{ \"a\" \"a\" \"a\" \"a\" }"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $see-also list-of-many } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  list-of-many 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { "items"  sequence  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "separator"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-11 20:51:58 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that returns a list of items separated by the separator parser.  Hides the separators and matches a list of two or more items." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $notes "Use "  { $link list-of } " to return a list of only one item." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $examples
							 
						 
					
						
							
								
									
										
										
										
											2008-07-14 21:51:30 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { $code "USING: peg peg.parsers prettyprint ;"  "\"a\" \"a\" token \",\" token list-of-many parse => exception"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"a,a,a,a\" \"a\" token \",\" token list-of-many parse ."  "V{ \"a\" \"a\" \"a\" \"a\" }"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $see-also list-of } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  epsilon 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that matches the empty sequence." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  any-char 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that matches the any single character." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  exactly-n 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { "n"  integer  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "parser'"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that matches an exact repetition of the input parser." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $examples
							 
						 
					
						
							
								
									
										
										
										
											2008-07-14 21:51:30 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { $code "USING: peg peg.parsers prettyprint ;"  "\"aaa\" \"a\" token 4 exactly-n parse => exception"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"aaaa\" \"a\" token 4 exactly-n parse ."  "V{ \"a\" \"a\" \"a\" \"a\" }"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $see-also at-least-n at-most-n from-m-to-n } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  at-least-n 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { "n"  integer  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "parser'"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that matches n or more repetitions of the input parser." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $examples
							 
						 
					
						
							
								
									
										
										
										
											2015-08-06 18:05:12 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { $code "USING: peg peg.parsers prettyprint ;"  "\"aaa\" \"a\" token 4 at-least-n parse => exception"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-07-14 21:51:30 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"aaaa\" \"a\" token 4 at-least-n parse ."  "V{ \"a\" \"a\" \"a\" \"a\" }"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"aaaaa\" \"a\" token 4 at-least-n parse ."  "V{ \"a\" \"a\" \"a\" \"a\" \"a\" }"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $see-also exactly-n at-most-n from-m-to-n } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  at-most-n 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { "n"  integer  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "parser'"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that matches n or fewer repetitions of the input parser." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $examples
							 
						 
					
						
							
								
									
										
										
										
											2008-07-14 21:51:30 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"aaaa\" \"a\" token 4 at-most-n parse ."  "V{ \"a\" \"a\" \"a\" \"a\" }"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"aaaaa\" \"a\" token 4 at-most-n parse ."  "V{ \"a\" \"a\" \"a\" \"a\" }"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $see-also exactly-n at-least-n from-m-to-n } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  from-m-to-n 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { "m"  integer  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "n"  integer  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "parser'"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that matches between and including m to n repetitions of the input parser." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $examples
							 
						 
					
						
							
								
									
										
										
										
											2008-07-14 21:51:30 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"aaa\" \"a\" token 3 4 from-m-to-n parse ."  "V{ \"a\" \"a\" \"a\" }"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"aaaa\" \"a\" token 3 4 from-m-to-n parse ."  "V{ \"a\" \"a\" \"a\" \"a\" }"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"aaaaa\" \"a\" token 3 4 from-m-to-n parse ."  "V{ \"a\" \"a\" \"a\" \"a\" }"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $see-also exactly-n at-most-n at-least-n } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  pack 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "begin"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "body"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "end"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-11 20:51:58 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that parses the begin, body, and end parsers in order.  The begin and end parsers are hidden." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $examples
							 
						 
					
						
							
								
									
										
										
										
											2015-08-15 21:10:13 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"hi123bye\" \"hi\" token integer-parser \"bye\" token pack parse ."  "123"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $see-also surrounded-by } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  surrounded-by 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { "begin"  string  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "end"  string  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "parser'"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Calls token on begin and end to make them into string parsers.  Returns a parser that parses the begin, body, and end parsers in order.  The begin and end parsers are hidden." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $examples
							 
						 
					
						
							
								
									
										
										
										
											2015-08-15 21:10:13 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint ;"  "\"hi123bye\" integer-parser \"hi\" \"bye\" surrounded-by parse ."  "123"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} { $see-also pack } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-15 21:10:13 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  digit-parser 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that matches a single digit as defined by the "  { $link digit? } " word." 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-15 21:10:13 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} { $see-also integer-parser } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-15 21:10:13 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  integer-parser 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
									
										
										
										
											2015-08-15 21:10:13 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    "Returns a parser that matches an integer composed of digits, as defined by the "  { $link digit-parser } " word." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $see-also digit-parser string-parser } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-15 21:10:13 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  string-parser 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-03 14:28:53 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "Returns a parser that matches an string composed of a \", anything that is not \", and another \"." 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-15 21:10:13 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} { $see-also integer-parser } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-19 20:40:22 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  range-pattern 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { "pattern"  string  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-19 20:40:22 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { "parser"  "a parser"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} { $description
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Returns a parser that matches a single character based on the set " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"of characters in the pattern string." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Any single character in the pattern matches that character. " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"If the pattern begins with a ^ then the set is negated " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"(the element matches any character not in the set). Any pair " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"of characters separated with a dash (-) represents the " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"range of characters from the first to the second, inclusive." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples
							 
						 
					
						
							
								
									
										
										
										
											2015-07-02 13:31:22 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { $example "USING: peg peg.parsers prettyprint strings ;"  "\"a\" \"_a-zA-Z\" range-pattern parse 1string ."  "\"a\""  }
							 
						 
					
						
							
								
									
										
										
										
											2015-08-06 18:05:12 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { $code "USING: peg peg.parsers prettyprint ;\n\"0\" \"^0-9\" range-pattern parse => exception"  }
							 
						 
					
						
							
								
									
										
										
										
											2008-03-19 20:40:22 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}  ;