From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 94ACABB81 for ; Sun, 12 Dec 2004 02:32:06 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBC1W5Jh014705 for ; Sun, 12 Dec 2004 02:32:06 +0100 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 CAA06579 for ; Sun, 12 Dec 2004 02:32:05 +0100 (MET) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBC1W3cD014702 for ; Sun, 12 Dec 2004 02:32:04 +0100 Received: from [192.168.1.200] (ppp203-65.lns1.syd3.internode.on.net [203.122.203.65]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id iBC1Vw0r078322; Sun, 12 Dec 2004 12:01:59 +1030 (CST) Subject: Felix 1.0.20 released From: skaller Reply-To: skaller@users.sourceforge.net To: felix-language Cc: caml-list Content-Type: text/plain Message-Id: <1102815117.2603.16.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 12 Dec 2004 12:31:58 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41BB9F96.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41BB9F93.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; sourceforge:01 parser:01 trivial:01 tokens:01 token:01 token:01 endmatch:01 expr:01 grammar:01 expr:01 endmatch:01 parser:01 endl:01 glebe:01 ffau:98 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: Felix version 1.0.20 is now stablised and 1.0.21 has been opened as the development version. Felix is an Algol like language with a strong functional subsystem and ML like typing. Available with BSD like FFAU licence from http://felix.sf.net This version integrates Scott McPeaks Elkhound GLR parser http://www.cs.berkeley.edu/~smcpeak/elkhound/ directly in the language. A complete (but trivial) working example is given below to indicate the what the integration looks like. ---------------------------------------------- include "std"; // the input string data := "1+2+3$"; // a type for tokens union token_t = | TOK_EOF | TOK_PLUS | TOK_INT of int ; // a token stream generator var i = 0; fun get_token():token_t = { ch := data.[i to i+1]; ++i; tok := match ch with | "$" => TOK_EOF | "+" => TOK_PLUS | "1" => TOK_INT 1 | "2" => TOK_INT 2 | "3" => TOK_INT 3 endmatch ; return tok; } // a type for expression terms union expr_t = | Integer of int ; // a grammar for expressions nonterm expr : expr_t = | xx:expr TOK_PLUS y:TOK_INT => match xx with | Integer ?i => Integer (i+y) endmatch | y:TOK_INT => Integer y ; // a parser for our example var z : 1 + int = parse (the get_token) with | e: expr => match e with | Integer ?i => i endmatch endmatch ; // print the result match z with | case 1 => { print "Error"; } | case 2 (?i) => { print i; } endmatch; endl; -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net