[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sections
Original-Via: uk.ac.ukc; Wed, 31 Oct 90 16:28:42 GMT
From: Kent Karlsson <kent>
Date: Wed, 31 Oct 90 13:50:33 +0100
To: haskell@cs.glasgow.ac.uk
Subject: Re: sections
Original-Sender: kent%se.chalmers.cs@sunic.sunet.se
Sender: haskell-request@cs.glasgow.ac.uk
> a ``semantic'' check that the "exp" in the second production is really
> an "aexp", so giving the exact syntax that you suggest -- "exp" is used
...
> There's no problem with *parsing* this that I can see (just allow "_"
> as a valid "aexp"!), but the compiler must be a bit more clever if it is
> to turn one of these into a lambda later on (and also check for illegal
> uses of "_").
There is nothing context sensitive about "extended" sections, as this
fragment of context free grammar shows:
aexp -> ( exp )
| var
| ...
exp -> application
| aexp
| exp1 op exp2
| sapplication
| _ op exp2
| exp1 op _
| ...
application -> application aexp
| aexp aexp
sapplication -> sapplication aexp
| application _
| aexp _
/kent k