caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] ocamlyacc -- can i tell it to be quiet?
Date: Fri, 18 Nov 2005 14:34:22 +0000	[thread overview]
Message-ID: <200511181434.22448.jon@ffconsultancy.com> (raw)
In-Reply-To: <1132322923.10869.29.camel@rosella>

On Friday 18 November 2005 14:08, skaller wrote:
> The following leads to shift reduce conflict:
>
> ctype_name:
>   | LONG LONG
>   | LONG
>
> Yacc is very weird -- I can parse a list of LONG without
> a conflict .. but not two of them??

I'm not a yacc expert but there seem to be two possibilities:

1. The same action is repeated, in which case "LONG LONG" is superfluous and 
can be removed.

2. The two actions are different, in which case you need to tell yacc that 
LONG LONG has a higher precedence:

%nonassoc LONG
%prec long_long
...
ctype_name:
| LONG LONG %prec long_long { ... }
| LONG { ... };

I think this is equivalent to the dangling "else" problem. Anyway, you 
shouldn't be parsing C++, it is bad for your health. ;-)

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


  parent reply	other threads:[~2005-11-18 14:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-18 14:08 skaller
2005-11-18 14:16 ` [Caml-list] " Sebastian Egner
2005-11-18 15:59   ` skaller
2005-11-18 14:22 ` skaller
2005-11-18 14:34 ` Jon Harrop [this message]
2005-11-18 14:58 ` Christian Lindig
2005-11-18 14:40 yoann padioleau
2005-11-18 16:25 ` skaller
2005-11-18 16:34 yoann padioleau
2005-11-18 17:56 ` skaller

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=200511181434.22448.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.com \
    --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).