Artifact 7ecf54b4d16ee2405c8fb17213911b63f39f91067ca57c99b579364d7c8741a6:
- File
psl-1983/3-1/util/parser-fix.red
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 2109) [annotate] [blame] [check-ins using] [more...]
- File
psl-1983/util/parser-fix.red
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 2109) [annotate] [blame] [check-ins using]
%7:51am Sunday, 4 April 1982 Some parser fixes. FLUID '(!*BREAK); procedure ParErr(x,y); Begin Scalar !*BREAK; % Turn off BREAK StdError(x); End; procedure ElseError x; ParErr("ELSE should appear only in IF statement",T); procedure ThenError x; ParErr("THEN should appear only in IF statement",T); DefineRop('THEN,4,ThenError); DefineRop('ELSE,4,ElseError); procedure DoError x; ParErr("DO should appear only in WHILE or FOR statements",T); procedure UntilError x; ParErr("UNTIL should appear only in REPEAT statement",T); DefineRop('Do,4,DoPError); DefineRop('Until,4,UntilMError); procedure SUMError x; ParErr("SUM should appear only in FOR statements",T); procedure STEPError x; ParErr("STEP should appear only in FOR statement",T); procedure ProductError x; ParErr("PRODUCT should appear only in FOR statement",T); DefineRop('STEP,4,STEPError); DefineRop('SUM,4,SUMError); DefineRop('PRODUCT,4,ProductError); procedure CollectError x; ParErr("COLLECT should appear only in FOR EACH statements",T); procedure CONCError x; ParErr("CONC should appear only in FOR EACH statement",T); procedure JOINError x; ParErr("JOIN should appear only in FOR EACH statement",T); DefineRop('CONC,4,CONCError); DefineRop('Collect,4,CollectError); DefineRop('JOIN,4,JOINError); % Parse Simple ATOM list SYMBOLIC PROCEDURE ParseAtomList(U,V,W); %. parse LIST of Atoms, maybe quoted % U=funcname, V=following Token, W=arg treatment BEGIN Scalar Atoms; IF V EQ '!*SEMICOL!* THEN RETURN ParErr("Missing AtomList after KEYWORD",T); L: Atoms:=V . Atoms; SCAN(); IF CURSYM!* eq '!*COMMA!* then <<V:=SCAN(); goto L>>; IF CURSYM!* eq '!*SEMICOL!* then Return <<OP := CURSYM!*; If W eq 'FEXPR then U . Reverse Atoms else LIST(U,MkQuotList Reverse Atoms)>>; ParErr("Expect only Comma delimeter in ParseAtomList",T); END; DefineRop('Load,NIL,ParseAtomList('Load,X,'Fexpr)); Definerop('A1,NIL,ParseAtomList('A0,X,'Expr)); Definerop('A2,NIL,ParseAtomList('A0,X,'FExpr)); procedure a0 x; print x;