[racket] Developing a Recursive Descent Parser in Racket

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Thu Oct 24 00:45:30 EDT 2013

A lex&yacc-like pair of parser tools is included in Racket, and works 
OK.  http://doc.racket-lang.org/parser-tools/

Danny Yoo did some work on higher-level parser specification.  I'm not 
sure what's a good URL, but here are some:

If you want to write a parser by hand, you can use things like 
"read-char", "peek-char", and regexp-matching to tokenize, and use 
procedures for simple recursive descent.  This is how my old permissive 
HTML parser was implemented.  Or other ways (e.g., if your parser is 
doing heavy backtracking on the input characters/bytes directly rather 
than on an intermediate token stream/list, maybe read the input into a 
big string or byte-string first, rather than port-peeking or file-seeking).

Neil V.

Posted on the users mailing list.