Xref: utzoo comp.lang.misc:7310 comp.arch:21903 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!think.com!ames!lll-winken!iggy.GW.Vitalink.COM!pacbell.com!pacbell!rtech!mtxinu!taniwha!paul From: paul@taniwha.UUCP (Paul Campbell) Newsgroups: comp.lang.misc,comp.arch Subject: Re: Algol68 Message-ID: <809@taniwha.UUCP> Date: 7 Apr 91 03:48:24 GMT References: <9168@castle.ed.ac.uk> <4202@zaphod.UUCP> <801@taniwha.UUCP> <4217@zaphod.UUCP> Reply-To: paul@taniwha.UUCP (Paul Campbell) Organization: Taniwha Systems Design, Oakland Lines: 41 In article <4217@zaphod.UUCP> bobd@zaphod.UUCP (Bob Dalgleish) writes: >In article <801@taniwha.UUCP> paul@taniwha.UUCP (Paul Campbell) writes: >>I always had the idea that what Wirth did was implement all the 'easy' >>stuff in Pascal. >How do you mean? Well he implemented the basic type structures (but not full pointers or unions), most of the flow control (but only as voids) etc etc I didn't mean this in a bad way - I think that it was probably a good choice at the time - and the results are obvious - Pascal caught on because it is (relatively) easy to implement and a portable compiler is available ... >Hank Boehm at the University of Alberta in Edmonton put together a neat >method of recognition. He constructed two slr(0) grammars, one to be >applied left to right, and the other to be applied by reading the source >backwards. When the I/O system was added afterwards, his parser failed. >I also saw some work on attribute grammars, which were well over my >head. I did something similar except I did two passes, the first parsed the parenthesis (control flow and mode/operator/prio decs) using recursive descent - the result was a tree annotated with the unparsed expressions in it. The second pass traversed the treee and used a lr0 parser that was recursively run on the unparsed nodes - the result being a treee that was walked to generate code. Paul Campbell PS: for those who don't know even the revised report contains ambiguity, the most common example is: union([]int , struct (int a, b, c)) fred = (1,2,3); -- Paul Campbell UUCP: ..!mtxinu!taniwha!paul AppleLink: CAMPBELL.P "But don't we all deserve. More than a kinder and gentler fuck" - Two Nice Girls, "For the Inauguration"