iwm@doc.ic.ac.uk (Ian Moor) (04/09/88)
The pxp BSD Pascal prettyprinter inserts the word `null' in places where a null statement is legal : if B then P else; becomes if B then P else null;. Null is not a legal Pascal statement and causes non BSD Pascal processing tools to complain, (eg. ptc : Pascal to C converter). As pxp has an {\HUGE FLAME undocumented} switch -O for removing `others' in case statements it is used in compiling TeX -- and the Tangle preprocessor generates statements with null cases that get mangled as described above. Ian W Moor UUCP: seismo!mcvax!ukc!icdoc!iwm ARPA: iwm@doc.ic.ac.uk JANET: iwm@uk.ac.ic.doc Department of Computing Whereat a great and far-off voice was heard, saying, Imperial College. Poop-poop-poopy, and it was even so; and the days 180 Queensgate of Poopy Panda were long in the land. London SW7 Uk.
mike@turing.UNM.EDU (Michael I. Bushnell) (04/11/88)
In article <252@gould.doc.ic.ac.uk> iwm@doc.ic.ac.uk (Ian Moor) writes: >The pxp BSD Pascal prettyprinter inserts the word `null' in places >where a null statement is legal : if B then P else; becomes >if B then P else null;. Null is not a legal Pascal statement and >causes non BSD Pascal processing tools to complain, (eg. ptc : Pascal to >C converter). As pxp has an {\HUGE FLAME undocumented} switch -O for >removing `others' in case statements it is used in compiling TeX -- >and the Tangle preprocessor generates statements with null cases that >get mangled as described above. While null statements are ALWAYS legal...[take a look at the syntax], the procedure name "null" is required to be provided in every ISO comformant compiler. It is a procedure which does nothing. Berkeley pc just ignores it instead of generating a call. So, it IS standard pascal. Furthermore, in my opinion, the placement of an explicit call to null makes the structure much more readable. N u m q u a m G l o r i a D e o Michael I. Bushnell HASA - "A" division 14308 Skyline Rd NE Computer Science Dept. Albuquerque, NM 87123 OR Farris Engineering Ctr. OR University of New Mexico mike@turing.unm.edu Albuquerque, NM 87131 {ucbvax,gatech}!unmvax!turing.unm.edu!mike
geoffw@elecvax.eecs.unsw.oz (Geoff Whale) (04/19/88)
Try running this self-explanatory Pascal program through pxp:
------------
program fred(output);
{ Guess what - BSD 4.2 pxp prints comments thus:
printf(commenttext);
so guess what happens when it encounters
a %% sign, especially one followed by *
}
{ The following comment contains %%x and %%*x }
{ %x %*x }
begin
null
end.
------------
I don't know if it's fixed in 4.3 (I doubt it,
only deranged students ever use comments, particularly
with any punctuation :-))
ARPA: geoffw%elecvax.eecs.unsw.oz@seismo.CSS.GOV
JANET: elecvax.eecs.unsw.oz!geoffw@ukc
BITNET: geoffw%elecvax.eecs.unsw.oz%seismo.CSS.GOV@WISCVM
UUCP: {seismo,hplabs,ukc,mcvax,ubc-vision,nttlab}!munnari!elecvax.eecs.unsw.oz!geoffw
{decvax,vax135}!mulga!elecvax.eecs.unsw.oz!geoffw