caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Micha <micha-1@fantasymail.de>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Ocamlyacc questions
Date: Sun, 6 Feb 2005 02:26:10 +0100	[thread overview]
Message-ID: <200502060226.10577.micha-1@fantasymail.de> (raw)
In-Reply-To: <20050206022456.GA5170@wcug.wwu.edu>

Am Sonntag, 6. Februar 2005 03:24 schrieb cjohnson@wcug.wwu.edu:
> 1. The action {} after the first identifier causes an error.  Does
> ocamlyacc not support actions before the last token? 

no, as far as I know, not

> How would I work 
> around this?

declare extra nonterminals such as:

program: PROGRAM prg_ident IDENTIFIER PERIOD {};

prg_ident: IDENTIFIER {} 

but you can get conflicts...

> 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 <type> program' where type
>     is int, unit, etc. causes a syntax error.  Any ideas?

yes, it should be:

%start program
%type <type> program

the type is declared extra (as the docu says... :-)


 Micha


      reply	other threads:[~2005-02-06  1:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-06  2:24 cjohnson
2005-02-06  1:26 ` Micha [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200502060226.10577.micha-1@fantasymail.de \
    --to=micha-1@fantasymail.de \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).