From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 5472CBC37 for ; Thu, 11 Jun 2009 15:21:58 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtYBANmhMEqLEwExhWdsb2JhbACYPwEBAQoLChkFpk6QEgWECg X-IronPort-AV: E=Sophos;i="4.42,202,1243807200"; d="scan'208";a="31026791" Received: from infao0809.mpi-sb.mpg.de (HELO hera.mpi-sb.mpg.de) ([139.19.1.49]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 11 Jun 2009 15:21:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mpi-sb.mpg.de; s=mail200803; h=From:To:In-Reply-To:Subject: References:Message-Id:Content-Type:Content-Transfer-Encoding: Mime-Version:Date:Cc; bh=QJU4CQe4QXV6+vDw5HvmTc3CyPzPwE2fxjgYSdL 9/AI=; b=xPSxJmE+0VX+sKodh7zXZKrNI+oAobYQIMjmGNyRb2NdvIiN7ih3q4E edngQFiqaHzlI+MDniBzae+nZk3f6Zne3D29l6HD/YKzzzteJMnAEo6vbbNwl7vF 1UfZPl1khD8Hng55n7xHNwaHQLRxACejm6DFKXsQ5llf3lsAD3rc= Received: from infao0525.mpi-sb.mpg.de ([139.19.1.26]:55030 helo=newmaniac.mpi-sb.mpg.de) by hera.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.69) id 1MEkE5-0007Fa-Np; Thu, 11 Jun 2009 15:21:56 +0200 Received: from srbk-4db7eb5b.pool.einsundeins.de ([77.183.235.91]:51720 helo=[192.168.178.20]) by newmaniac.mpi-sb.mpg.de with esmtpsa (TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63) (envelope-from ) id 1MEkE5-0004Ig-7O; Thu, 11 Jun 2009 15:21:53 +0200 From: Andreas Rossberg To: Andrej Bauer In-Reply-To: <7d8707de0906110557n6a1511a2k9f4f00827f954cb6@mail.gmail.com> Subject: Re: [Caml-list] ocamllex and python-style indentation References: <7d8707de0906110557n6a1511a2k9f4f00827f954cb6@mail.gmail.com> Message-Id: <6A392E9D-572B-469F-B931-71529CF338EF@mpi-sws.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Thu, 11 Jun 2009 15:21:52 +0200 Cc: caml-list@inria.fr X-Mailer: Apple Mail (2.935.3) X-Spam: no; 0.00; rossberg:01 rossberg:01 ocamllex:01 andrej:01 lexer:01 parser:01 ocamllex:01 andrej:01 syntax:01 ocaml:01 cheers:01 wrote:01 parsing:01 andreas:01 andreas:01 On Jun 11, 2009, at 14.57 h, Andrej Bauer wrote: > My parsing powers are not sufficient to easily come up with > lexer/parser for a simple language that uses python-style indentation > and newline rules. Does anyone have such a thing lying around, written > in ocamllex/yacc or menhir? I would appreciate a peek to see how > you've dealt with it. Hi Andrej, I have some _very_ old code (a source-to-source translator that provides Haskell-style syntax for Ocaml itself) that does that: http://www.mpi-sws.org/~rossberg/hocaml-0.12.tgz Hope that helps. Cheers, - Andreas