index aaf4c8afb54ce95487c4b72639b82485e631594f..b1787397516a9f973992d5c622f678c85bc985c4 100644 (file)
END;
VAR
- ch: CHAR; (* current character *)
+ ch-: CHAR; (* current character *)
name: DevCPT.Name; (* ident *)
VAR
END
END Get;
- PROCEDURE New (IN name: DevCPT.Name; val: BOOLEAN);
+ PROCEDURE New (IN name: DevCPT.Name): Selector;
VAR s: Selector;
BEGIN
s := scope;
WHILE (s.next # NIL) & (s.next.name$ # name$) DO s := s.next END;
- IF s.next = NIL THEN NEW(s.next); s.next.name := name$; s.next.val := val
+ IF s.next = NIL THEN NEW(s.next); s.next.name := name$; s.next.val := FALSE
ELSE err(1)
- END
+ END;
+ RETURN s.next
END New;
PROCEDURE Old (IN name: DevCPT.Name): Selector;
END Printable;
PROCEDURE Parse*;
- VAR val: BOOLEAN;
+ VAR val: BOOLEAN; s: Selector;
BEGIN
- Get(sym);
+ ch := " "; Get(sym);
IF sym = new THEN
Get(sym);
- IF sym = ident THEN New(name, FALSE); Get(sym)
+ IF sym = ident THEN
+ s := New(name); Get(sym);
+ IF (sym = plus) OR (sym = minus) THEN
+ s.val := sym = plus; Get(sym)
+ END
ELSE err(48)
END
- ELSIF sym = error THEN
- IF Printable() THEN err(501) END; Get(sym)
ELSIF sym = ident THEN
- Get(sym);
- IF sym = plus THEN Old(name).val := TRUE; Get(sym)
- ELSIF sym = minus THEN Old(name).val := FALSE; Get(sym)
+ s := Old(name); Get(sym);
+ IF (sym = plus) OR (sym = minus) THEN
+ s.val := sym = plus; Get(sym)
ELSE err(41)
END
+ ELSIF sym = error THEN
+ IF Printable() THEN err(501) END; Get(sym)
ELSIF sym = if THEN
Get(sym); Expression(val); If(val);
IF sym = then THEN Get(sym)
Close;
If(TRUE);
NEW(scope);
- New("TRUE", TRUE);
- New("FALSE", FALSE)
+ Set("TRUE", TRUE);
+ Set("FALSE", FALSE)
END Init;
END DevCPR.