From: yoann padioleau <padator@wanadoo.fr>
To: Sebastian Egner <sebastian.egner@philips.com>,
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:40:54 +0100 (CET) [thread overview]
Message-ID: <6556771.1132324854307.JavaMail.www@wwinf1520> (raw)
>
> > 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 ;-).
except that sometimes there is some space, comments, between the 2 "long", so the regexp for "long long" would
be uselessly complicated.
BTW, I dont know if your grammar talks about C, but in C you can even write
"long const extern long a;"
next reply other threads:[~2005-11-18 14:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-18 14:40 yoann padioleau [this message]
2005-11-18 16:25 ` skaller
-- strict thread matches above, loose matches on Subject: below --
2005-11-18 16:34 yoann padioleau
2005-11-18 17:56 ` skaller
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
2005-11-18 14:58 ` Christian Lindig
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=6556771.1132324854307.JavaMail.www@wwinf1520 \
--to=padator@wanadoo.fr \
--cc=caml-list-bounces@yquem.inria.fr \
--cc=caml-list@yquem.inria.fr \
--cc=sebastian.egner@philips.com \
--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