Syntax & Sematics [was: Re: [Enough already] Re: Proposal3:

Mats Nygren nygren at sics.se
Wed Jun 7 13:29:52 UTC 2000


"Andrew C. Greenberg" <werdna at gate.net> wrote:
> >The main architectural idea I am proposing is that as long as something
> >maps bijectively to a standard parse tree form (or a standard textual
> >form) it will work. To understand this it is important to note that this
> >is about syntax entirely. As soon as semantic issues are introduced it
> >becomes to complicated, at least for the time beeing.
> 
> Can you give an example of such a bijection?  Most programming 
> languages have plural programs that map to a given parse.  For 
> example:
> 
> 	(x + y) * z
> 
> and
> 
> 	x + y * z
> 
> (at least in present-day Smalltalk) both map to the same tree.

If one wants to separate these, that can be done. The parser would
recognize that a parenthesis is unnecessary and make a parse node for
explicit paranthesis. So there would be distinct parse trees for the two
examples (if they are in the same syntax).

What I mean with bijection, as is clear from several places, is as
follows:

whenever there is a mapping to a parse tree, a parser, there should be a
writer of the same syntax also. And whenever there is a writer of some syntax,
there should be a parser for that syntax also. This sums up to a system that as a
rule behaves very well. Thats all there is to it.

If you want precise mathematics, I'm talking about bijections between
equivalence classes of program texts. Or in some cases projection pairs.
(or sections/retractions etc). An informal way of writing about this is
preferable I believe.

Beyond that there is some fine print, since we have difficulties in this
discussion anyway I propose we leave that out for the time beeing.

/Mats





More information about the Squeak-dev mailing list