caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] ocamlyacc -- can i tell it to be quiet?
@ 2005-11-18 16:34 yoann padioleau
  2005-11-18 17:56 ` skaller
  0 siblings, 1 reply; 9+ messages in thread
From: yoann padioleau @ 2005-11-18 16:34 UTC (permalink / raw)
  To: skaller; +Cc: Sebastian Egner, caml-list


> 
> > BTW, I dont know if your grammar talks about C, but in C you can even write
> >  "long const extern long a;"
> 
> The grammar in question is the Felix grammar, which is a kind
> of hybrid syntax between C++ and ML. It make no pretense
> of being an upgrade of C++ syntactically .. however I do
> try to keep enough familiar things in it that it won't
> be quite as scary as Ocaml or Haskell.

You should put a <shameless-advertising> around such statements :) 

Did you intentionnaly post your previous message to be able to get more attention on felix :) 


> 
> Felix uses "vlong" for C's "long long" .. not hard to 
> learn, but every new thing you have to learn is a barrier
> to acceptance.


> 
> -- 
> John Skaller <skaller at users dot sf dot net>
> Felix, successor to C++: http://felix.sf.net
> 
> 
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: [Caml-list] ocamlyacc -- can i tell it to be quiet?
@ 2005-11-18 14:40 yoann padioleau
  2005-11-18 16:25 ` skaller
  0 siblings, 1 reply; 9+ messages in thread
From: yoann padioleau @ 2005-11-18 14:40 UTC (permalink / raw)
  To: Sebastian Egner, skaller; +Cc: caml-list, caml-list-bounces



> 
> > 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;"




^ permalink raw reply	[flat|nested] 9+ messages in thread
* ocamlyacc -- can i tell it to be quiet?
@ 2005-11-18 14:08 skaller
  2005-11-18 14:16 ` [Caml-list] " Sebastian Egner
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: skaller @ 2005-11-18 14:08 UTC (permalink / raw)
  To: caml-list

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?

[My script considers any conflict a fatal error]

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-18 17:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-18 16:34 [Caml-list] ocamlyacc -- can i tell it to be quiet? yoann padioleau
2005-11-18 17:56 ` skaller
  -- strict thread matches above, loose matches on Subject: below --
2005-11-18 14:40 yoann padioleau
2005-11-18 16:25 ` 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

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).