From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id ABEC4BC88 for ; Sun, 6 Feb 2005 02:07:11 +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 j1617Bqw021398 for ; Sun, 6 Feb 2005 02:07:11 +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 CAA02369 for ; Sun, 6 Feb 2005 02:07:11 +0100 (MET) From: cjohnson@wcug.wwu.edu Received: from sloth.wcug.wwu.edu (sloth.wcug.wwu.edu [140.160.139.223]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id j16179eY021391 for ; Sun, 6 Feb 2005 02:07:10 +0100 Received: (qmail 5306 invoked by uid 1089); 6 Feb 2005 02:24:56 -0000 Date: Sat, 5 Feb 2005 18:24:56 -0800 To: caml-list@inria.fr Subject: Ocamlyacc questions Message-ID: <20050206022456.GA5170@wcug.wwu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Miltered: at nez-perce with ID 42056DBF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42056DBD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocamlyacc:01 ocamlyacc:01 compiler:01 grammar:01 token:01 token:01 syntax:01 program':98 program':98 twain:98 tail:01 int:01 unit:02 unit:02 string:03 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.2 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.0.2 X-Spam-Level: I'm evaluating ocamlyacc for a compiler implementation, and I was hoping to get help with two questions. Here is a very simple ocamlyacc grammar file: %{ (* A simple ocamlyacc file for demonstration. *) %} %token PROGRAM %token IDENTIFIER %start program %% program : PROGRAM IDENTIFIER {} IDENTIFIER PERIOD {} ; %% This has two errors: 1. The action {} after the first identifier causes an error. Does ocamlyacc not support actions before the last token? How would I work around this? 2. When the action from #1 is removed, I get an error message, "no type has been declared for the start symbol" but changing '%start program' to '%start program' where type is int, unit, etc. causes a syntax error. Any ideas? Thanks in advance! -- Chris Johnson cjohnson@wcug.wwu.edu The man who sets out to carry a cat by its tail learns something that will always be useful and which never will grow dim or doubtful. -- Mark Twain