From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id C6FA9BC57 for ; Fri, 22 Oct 2010 19:41:49 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtYBAE5pwUzAbSoIe2dsb2JhbACTdY1yFQEBFiIEHsA0hUoE X-IronPort-AV: E=Sophos;i="4.58,224,1286143200"; d="scan'208";a="74726686" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Oct 2010 19:41:49 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from localhost (okapi.in-berlin.de [192.109.42.117]) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id o9MHfmTL006681 for ; Fri, 22 Oct 2010 19:41:48 +0200 Received: from e178021239.adsl.alicedsl.de (e178021239.adsl.alicedsl.de [85.178.21.239]) by webmail.in-berlin.de (Horde Framework) with HTTP; Fri, 22 Oct 2010 19:41:48 +0200 Message-ID: <20101022194148.21032yqfgzi9y1gc@webmail.in-berlin.de> Date: Fri, 22 Oct 2010 19:41:48 +0200 From: "Oliver Bandel" To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Typesystem and Parsers References: <20101022165950.13786wcej1xp31eu@webmail.in-berlin.de> In-Reply-To: <20101022165950.13786wcej1xp31eu@webmail.in-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.3.3 X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Spam: no; 0.00; bandel:01 in-berlin:01 parsers:01 bandel:01 in-berlin:01 ocaml:01 token:01 imho:01 oliver:01 oliver:01 parsing:01 parsing:01 caml-list:01 int:01 int:01 Zitat von "Oliver Bandel" : > Hello, > > when reading papers or books on parsing > techniques, the parsing often is done in > different distinctive steps, where type checking > and semantic checks are done after the parse tree > is build up. > > This may be the classical way, for example when doing it in C. > > When using OCaml with it's strong type system, > IMHO the big advantage is, that the type system can be used to > restrict the input data in a way that without additionally checks > correct input is enforced, otherwise a parse error is detected. [...] Would something like a parse-error-token make sense, when the typesystem and the ocamlyacc-grammar forbidds parsing wrong sequences? Maybe something like (simple example): type token_t = Add | Sub | Int of int | String of string | ParseError of string ?? Ciao, Oliver