caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sebastian Egner <sebastian.egner@philips.com>
To: skaller <skaller@users.sourceforge.net>
Cc: caml-list@yquem.inria.fr, caml-list-bounces@yquem.inria.fr
Subject: Re: [Caml-list] ocamlyacc -- can i tell it to be quiet?
Date: Fri, 18 Nov 2005 15:16:04 +0100	[thread overview]
Message-ID: <OFC3EA1194.47FD1C2C-ONC12570BD.004E0D15-C12570BD.004E88BD@philips.com> (raw)
In-Reply-To: <1132322923.10869.29.camel@rosella>

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

> 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?? 
> 
> Is there any way to tell it to shut up?

Rather than trying to solve this in the LALR parser (which
might involve a major rewrite of the grammer in this case),
the easiest way is to adapt the _lexer_ to produce two
different tokens for "long" and for "long long": The lexer
(ocamllex) always goes for the longest match, and in this
case this is what you want ;-).

Sebastian.

[-- Attachment #2: Type: text/html, Size: 944 bytes --]

  reply	other threads:[~2005-11-18 14:17 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 ` Sebastian Egner [this message]
2005-11-18 15:59   ` [Caml-list] " skaller
2005-11-18 14:22 ` skaller
2005-11-18 14:34 ` Jon Harrop
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=OFC3EA1194.47FD1C2C-ONC12570BD.004E0D15-C12570BD.004E88BD@philips.com \
    --to=sebastian.egner@philips.com \
    --cc=caml-list-bounces@yquem.inria.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=skaller@users.sourceforge.net \
    /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).