News for hackers. Stuff that matters.
Re:Pratt Parsers: Expression Parsing Made Easy (2011) by gnufx on Saturday February 17, 2018 @09:42AM (#16400843)
Good point about "if you can do it in Java"... There's a "reprint" of Pratt's paper (of unclear copyright status) at <https://tdop.github.io/>. Classic examples are his CGOL syntax for Lisp <https://people.eecs.berkeley.edu/~fateman/cgol/cgol.1> and Carrette's alternative reader for SIOD as a simpleer example <https://github.com/gjcarrette/siod/tree/master/winsiod>.

I used a variant long ago to implement a command line syntax for Scheme as an extension language. You can modify the dispatch so that juxtaposition acts as application (a pseudo operator with very low precedence) rather than raising an error. That allows mixfix or fully parenthesized forms interchangeably -- possibly with caveats I don't remember -- e.g.

  foo 2*bar*i; baz
probably used at the REPL, reading as the form

  (begin (foo (* 2 bar i)) (baz))
you'd probably use in scripts.

There are no comments on this comment yet.