From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA21054; Wed, 3 Apr 2002 10:49:17 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA20853 for ; Wed, 3 Apr 2002 10:49:16 +0200 (MET DST) Received: from ebene.inrialpes.fr (ebene.inrialpes.fr [194.199.18.70]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g338nFD10032 for ; Wed, 3 Apr 2002 10:49:16 +0200 (MET DST) Received: from pop-serv.inrialpes.fr (pop-serv.inrialpes.fr [194.199.18.66]) by ebene.inrialpes.fr (8.11.6/8.11.6) with ESMTP id g338n7W04332 for ; Wed, 3 Apr 2002 10:49:07 +0200 (MEST) Received: from inrialpes.fr (cime.inrialpes.fr [194.199.23.76]) by pop-serv.inrialpes.fr (8.11.3/8.11.3/ImagV2) with ESMTP id g338n6314798 for ; Wed, 3 Apr 2002 10:49:06 +0200 (MEST) Message-ID: <3CAAC202.40056D40@inrialpes.fr> Date: Wed, 03 Apr 2002 10:49:06 +0200 From: Frederic Tronel X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.8 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: caml-list@inria.fr Subject: [Caml-list] camlp4 and syntax modifications Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, I'm using camlp4 to embed a specification language (Lotos) into caml. I've written quotations that allow to write and use Lotos expressions directly in my caml code. But I'm facing a problem with what appears to be slight syntax changes. Here's an example: open Lotos (* grammar extension for lotos *) let _ = let send f t e = <:sync> in let p = <:process (Toto [SEND,RECV] ()) where process Titi [] () noexit := STOP endproc endproc >> in let s = <:spec STOP [] [not(false and true)] -> STOP where ^(p)>> in Printf.fprintf stdout "%s\n" (dump_spec s 0) Does compile smoothly (${OCAMLC} -pp "${CAMLP4O} ./lotos.cmo" -I +camlp4 -c test_embedded_lotos.ml) However if I add a "for" control structure in my code, like: open Lotos let _ = let send f t e = <:sync> in let p = <:process (Toto [SEND,RECV] ()) where process Titi [] () noexit := STOP endproc endproc >> in let s = <:spec STOP [] [not(false and true)] -> STOP where ^(p)>> in for i = 0 to 10 do () done; Printf.fprintf stdout "%s\n" (dump_spec s 0) which is perfectly legal according to the original caml syntax, it does not compile. /users/tronel/bin/ocamlc -pp "/users/tronel/bin/camlp4o ./lotos.cmo" -I +camlp4 -c test_embedded_lotos.ml File "test_embedded_lotos.ml", line 18, characters 5-7: Parse error: [expr level top] expected after 'in' (in [expr]) Preprocessing error *** Error code 2 I'm intentionally using the original syntax (camlp4o) since I've a bunch of code already written that I don't want to translate to the revised syntax. What is the correct syntax to use ??? Regards, Frederic Tronel. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners