Created by Abdulaziz Ghuloum and last modified

Parser-tools provide online lex/yacc-style macros for making lexers and parsers (online as opposed to the other offline tools that have to generate some intermediate files). Its design and usage is described in:

   ``Lexer and Parser Generators in Scheme''[1]


   ``Parser Tools: lex and yacc-style Parsing''[2]

Branch it somewhere in your library path and it should work.

As of now, the libraries work under both Ikarus and PLT.

Under Ikarus, it works seamlessly, so, nothing more to be said other than ``please use it and report any bugs''.

Under PLT, there's a little problem due to the mutable/immutable pairs problem. Basically, the libraries assume immutable pairs, and most of the primitives/syntax they use are NOT the R6RS primitives, but rather come from the "scheme" language. So, if you want to use it in an R6RS program, you're out of luck, unless you abandon the (rnrs) namespace completely and another alternative (like I did). I'm not interested in bridging the gap between the two PLT subsystems. (If somebody is really interested in this, I recommend
making a set of libraries that start with (irnrs *) that mirror the (rnrs *) hierarchy (omitting the (rnrs mutable-pairs) library), but uses only immutable pairs under PLT. Contact me if you need help.)

Porting parser-tools to other psyntax-based R6RS systems should be easy. Porting it to non-psyntax systems (Larceny and Ypsilon) may not be possible due to two features that the system use and happen to exist in both PLT and Ikarus: settable syntax (syntax-parameters or fluid-syntaxes) and compile-time bindings (syntax-local-value and make-compile-time-value). These are undocumented in Ikarus but are supported and I'm willing to provide full documentation (time permitting!). Porting to Chez Scheme should be painless too.

Needless to say, there might still be some bugs lurking there, but the calc example does work! I intend to use it more extensively and would like to iron out any bugs sooner or later.

I think the library should be released under the LGPL (original licence), but I need to check with the original authors (Flatt et al) to be absolutely sure.


[1] http://www.cs.utah.edu/plt/publications/scheme04-ofsm.pdf
[2] http://download.plt-scheme.org/doc/4.1/pdf/parser-tools.pdf

Get this branch:
bzr branch lp:~aghuloum/scheme-libraries/parser-tools
Only Abdulaziz Ghuloum can upload to this branch. If you are Abdulaziz Ghuloum please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Abdulaziz Ghuloum
Scheme Libraries

Recent revisions

52. By Abdulaziz Ghuloum <email address hidden> on 2009-08-09

Fixed a typo in class.sls.

51. By Abdulaziz Ghuloum <email address hidden> on 2009-08-07

clarified boundaries between token, lex, and yacc

50. By Abdulaziz Ghuloum <email address hidden> on 2009-08-07

moved token structs into their own library and all token-related
stuff under (parser-tools token *).

49. By Abdulaziz Ghuloum <email address hidden> on 2009-08-07

made all libraries under the (parser-tools *) namespace.

48. By Abdulaziz Ghuloum <email address hidden> on 2009-08-07

examples/read.sps now compiles and runs (without output)

47. By Abdulaziz Ghuloum <email address hidden> on 2009-08-07

examples/calc.sps now works in ikarus

46. By Abdulaziz Ghuloum <email address hidden> on 2009-08-06

fixed compat for mzscheme's equal hash tables.

45. By Abdulaziz Ghuloum <email address hidden> on 2009-08-06

made class compat works, normalized uses of hash tables.

44. By Abdulaziz Ghuloum <email address hidden> on 2009-08-06

moving along

43. By Abdulaziz Ghuloum <email address hidden> on 2009-08-06

eliminated all uses of syntax-local-value

Branch metadata

Branch format:
Branch format 6
Repository format:
Bazaar pack repository format 1 (needs bzr 0.92)
This branch contains Public information 
Everyone can see this information.