[Caml-list] Parser/lexer for block indented code

2010-02-01 Thread Andrej Bauer
Would anyone happen to have lying around parser/lexer for block indented code (a la Python and Haskell)? I am using ocamlyacc or menhir, whichever. It seems to be the best way to do deal with this is to put a filter between lexer and parser that inserts appropriate hints. I would like to avoid rei

Re: [Caml-list] Parser/lexer for block indented code

2010-02-02 Thread blue storm
There is "The Whitespace Thing" : http://people.csail.mit.edu/mikelin/ocaml+twt/ I have tried to reproduce something similar using Camlp4 twice, the first time with a ad-hoc grammar reusing as much as the current grammar as possible, the second with the specific goal of compatibility with the F# "

Re: [Caml-list] Parser/lexer for block indented code

2010-02-02 Thread Yoann Padioleau
On Feb 1, 2010, at 11:33 PM, Andrej Bauer wrote: > > Would anyone happen to have lying around parser/lexer for block > indented code (a la Python and Haskell)? I am using ocamlyacc or > menhir, whichever. There was some discussions about this in the past: http://caml.inria.fr/pub/ml-archives/c

Re: [Caml-list] Parser/lexer for block indented code

2010-02-02 Thread blue storm
Yes, it appears I have a bit over-interpreted the question. Parsers for "generic" indentation-meaningful languages (not OCaml) have been discussed there. In particular, Andreas Rossberg has a working lexer in the layoutLexer.ml file of http://www.mpi-sws.org/~rossberg/hocaml-0.12.tgz __