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=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 18571BC0A for ; Tue, 27 Feb 2007 16:42:28 +0100 (CET) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.230]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1RFgO3i024273 for ; Tue, 27 Feb 2007 16:42:26 +0100 Received: by wr-out-0506.google.com with SMTP id i11so894075wra for ; Tue, 27 Feb 2007 07:42:24 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=gB3yFdOOkap2FljsJ/8ueEF+NcM/EF9surh63rNfsYNQ2iq3Dmr0fLheDcJxy4DR+q7XABwxnb3LBLWZy9D22xM+1bPGZrcxkhCprOGm+Dh7wLovmuQZfp/8YjGNOHqd8keM1lon3nHqjsA/puo4wEBPZMs0CliULYENkUnQIy4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ni6Xdl/BNdoVQhlXY5jTGGefI1+h/PbG8Zw27j5mAsiEAcR3zSH7Sk0VxoFQmsypXOPAkACU3kQ22XK85oCTGRBerQLwoMIOrp626NUnFXb4IFank2jGUTjZdty3T/3I22sJle58GF33tDjhzddTEO+bqBm764QOecP6RFG7BFM= Received: by 10.114.204.3 with SMTP id b3mr1827023wag.1172590941162; Tue, 27 Feb 2007 07:42:21 -0800 (PST) Received: by 10.114.194.3 with HTTP; Tue, 27 Feb 2007 07:42:21 -0800 (PST) Message-ID: <6dbd4d000702270742s39afbac6yfa46881c7069909c@mail.gmail.com> Date: Tue, 27 Feb 2007 10:42:21 -0500 From: "Denis Bueno" To: "Joel Reymont" Subject: Re: [Caml-list] Testing lexers and parsers Cc: caml-list@inria.fr In-Reply-To: <7175FEA6-5CA0-4379-9BBC-CF43504CE733@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7175FEA6-5CA0-4379-9BBC-CF43504CE733@gmail.com> X-j-chkmail-Score: MSGID : 45E45160.002 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 45E45160.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lexers:01 parsers:01 ocaml:01 parsing:01 parsing:01 structurally:01 parser:01 wrote:01 caml-list:01 functions:01 modules:02 ast:02 ast:02 comparison:04 structural:04 On 2/27/07, Joel Reymont wrote: > Is there a better way to accomplish this while still using structural > comparison of ASTs? > > Should I try to read my target AST into OCaml, for example? Should I > create a bunch of "target AST" modules with functions that return my > target AST? I recently had to deal with this problem. I ended up testing the parsing/printing by parsing a file, printing it out, and parsing the print-out, and then making sure the ASTs built up are structurally identical (modulo any position fields you might have lurking in your ASTs). I have to say, ever since I did this testing, I have had no problems with my parser. -Denis