Path: utzoo!attcan!uunet!mcsun!ukc!stl!tom From: tom@stl.stc.co.uk (Tom Thomson) Newsgroups: comp.arch Subject: Re: Algol was an advance, was He's not the only one at it again! Message-ID: <3262@stl.stc.co.uk> Date: 31 Jul 90 16:00:32 GMT References: <1288@s8.Morgan.COM> <58372@lanl.gov> <1990Jul30.174035.26412@esegue.segue.boston.ma.us> Sender: news@stl.stc.co.uk Reply-To: "Tom Thomson" Organization: ICL Lines: 24 In article <1990Jul30.174035.26412@esegue.segue.boston.ma.us> johnl@esegue.segue.boston.ma.us (John R. Levine) writes: >(Of course, just because Algol has a context-free easy-to-tokenize syntax >doesn't mean that actual implementations all do. There was IBM's Algol F, >which ignored blanks and required you to put quotes around your keywords, >proving once again that Real programmers can write Fortran programs in any >language. What's been forgotten here is that ALL the early implementations of Algol had this problem, it's NOT an IBM Algol F problem. The Algol report used BOLD TYPE to distinguish keyword tokens from identifiers, so asking ffor quotes around keywords (or "@" symbols, or "_" symbols, or "%" symbols, as in some versions) was just asking the programmer to indicate which bits were supposed to be in bold type. Also, the only reason you can claim the syntax is context free is to choose to assert that programs that use undeclared identifiers are syntactically correct. Probably the best way of handling the syntax is to put hooks into the parser that adds identifiers to the appropriate (real, integer, boolean) class as they are declared and not recognise arbitrary identifier-like strings as identifiers as valid identifiers unless they have been declared. This results in a parser that behaves nothing like a context free one. Tom Thomson [tom @ nw.stl.stc.co.uk