caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: yoann padioleau <padator@wanadoo.fr>
To: Alex Baretta <alex@barettadeit.com>
Cc: Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Yacc limitations
Date: Fri, 23 Sep 2005 11:29:57 +0200 (CEST)	[thread overview]
Message-ID: <6807416.1127467797619.JavaMail.www@wwinf1502> (raw)

> > What is the problem with your SQL grammar and with ocamlyacc ? 
> 
> The problem is that context-free is bad. Did you ever see or hear of any
> real language where the context of a token is not meaningful? 

Even with a context free grammar I can capture the context of a token.
in 
S -> A B token C 

I control that token  is in the context  of having A B before and C after.


> It is
> often possible and sometimes easy to describe the set of strings
> belonging to a language in terms of a context-free grammar, but it is
> very difficult in general to describe *the semantics* of that set of
> strings without reference to the context.

Because grammar is about syntax, not semantics. The same is true for natural langage. 

Now let's say that you can write context free grammar for your SQL langage, what would you write ? 
You now have the ability to put multiple non-terminal at the left of the rule, such as in 

A B C -> D 

What would you write for your SQL grammar ? 


> 
> Now, I don't necessarily ask for undecidable generalized
> grammars--although IIRC the camlp4 parsing engine actually provides them
> as LL1+backtracking. I would be more than happy to have a smarter
> context-free yacc-like tool providing human readable explanations of
> syntactic conflicts.

Yes a better explanation of conflicts is something I would like too. 





             reply	other threads:[~2005-09-23  9:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-23  9:29 yoann padioleau [this message]
2005-09-23 12:51 ` Alex Baretta
  -- strict thread matches above, loose matches on Subject: below --
2005-09-22 16:46 yoann padioleau
2005-09-22 17:08 ` brogoff
2005-09-22  9:57 Alex Baretta
2005-09-22 13:09 ` [Caml-list] " Christophe Raffalli
2005-09-26 11:54   ` Pierre Boulet
     [not found] ` <4332ACF2.6020702@univ-savoie.fr>
2005-09-22 14:05   ` Alex Baretta
2005-09-22 16:37 ` Christophe TROESTLER
2005-09-23  6:05 ` Jake A. Kirilenko
2005-09-23 15:30 ` Alan Falloon

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=6807416.1127467797619.JavaMail.www@wwinf1502 \
    --to=padator@wanadoo.fr \
    --cc=alex@barettadeit.com \
    --cc=caml-list@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).