From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA16225 for caml-redistribution; Tue, 26 Jan 1999 18:46:59 +0100 (MET) 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 SAA30153 for ; Tue, 26 Jan 1999 18:33:45 +0100 (MET) Received: from cepheus.azstarnet.com (cepheus.azstarnet.com [169.197.56.195]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id SAA26019 for ; Tue, 26 Jan 1999 18:33:43 +0100 (MET) Received: from dylan (dialup22ip095.tus.azstarnet.com [169.197.40.223]) by cepheus.azstarnet.com (8.9.1a/8.9.1a) with SMTP id KAA23799 for ; Tue, 26 Jan 1999 10:31:21 -0700 (MST) X-Sent-via: StarNet http://www.azstarnet.com/ Message-ID: <000c01be4952$09752290$210148bf@dylan> From: "David McClain" To: "Liste CAML" Subject: GenLex stream parsers too eager? Date: Tue, 26 Jan 1999 10:33:46 -0700 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: weis It appears that the Genlex derived parsers always eagerly tokenize = negaitve integer and float constants. This causes incorrect behavior in = closely spaced code (no-spaces): a-2*c --> parses as "a", "-2" ,"*", "c" instead of = "a","-","2","*","c" So instead of getting one expression tree, I get two, with the first = containing only "a". Also, if the operator were exponentiation instead of multiplication, the = second tree would incorrectly compute a (possibly) complex valued = expression instead of a simple negative of a real expression. I have tried various workarounds, but they really obfuscate the original = recursive descent structure of parsers. Any suggestions? (Perhaps I should be using OCAMLLEX and OCAMLYACC = instead?) David McClain Sr. Scientist Raytheon Missile Systems Co. Tucson, AZ http://www.azstarnet.com/~dmcclain/homepage.htm