mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 04:02:25 +00:00
Accept all SET types in INCL.
This commit is contained in:
parent
1fa182c7ce
commit
2e02f9204c
18 changed files with 22 additions and 64 deletions
|
|
@ -811,11 +811,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
|||
ELSE err(201); x^.conval^.setval := {l..k}
|
||||
END ;
|
||||
x^.obj := NIL
|
||||
ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y)
|
||||
ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y) (* todo choose appropriate set type ? *)
|
||||
END
|
||||
ELSE err(93)
|
||||
END ;
|
||||
x^.typ := OPT.settyp
|
||||
x^.typ := OPT.settyp (* todo choose appropriate set type ? *)
|
||||
END SetRange;
|
||||
|
||||
PROCEDURE SetElem*(VAR x: OPT.Node);
|
||||
|
|
@ -829,9 +829,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
|||
ELSE err(202)
|
||||
END ;
|
||||
x^.obj := NIL
|
||||
ELSE Convert(x, OPT.settyp)
|
||||
ELSE Convert(x, OPT.settyp) (* todo choose appropriate set type ? *)
|
||||
END ;
|
||||
x^.typ := OPT.settyp
|
||||
x^.typ := OPT.settyp (* todo choose appropriate set type ? *)
|
||||
END SetElem;
|
||||
|
||||
PROCEDURE CheckAssign(x: OPT.Struct; ynode: OPT.Node); (* x := y *)
|
||||
|
|
@ -1027,7 +1027,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
|||
|OPT.inclfn,
|
||||
OPT.exclfn: (*INCL, EXCL*)
|
||||
IF NotVar(x) THEN err(112)
|
||||
ELSIF x^.typ # OPT.settyp THEN err(111); x^.typ := OPT.settyp
|
||||
ELSIF x.typ.form # OPT.Set THEN err(111); x^.typ := OPT.settyp
|
||||
ELSIF x^.readonly THEN err(76)
|
||||
END
|
||||
|OPT.lenfn: (*LEN*)
|
||||
|
|
@ -1124,8 +1124,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
|||
OPT.exclfn: (*INCL, EXCL*)
|
||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||
ELSIF f = OPT.Int THEN
|
||||
IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval > OPM.MaxSet)) THEN err(202)
|
||||
END ;
|
||||
IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval >= p.typ.size*8)) THEN err(202)
|
||||
END;
|
||||
p := NewOp(OPT.Nassign, fctno, p, x)
|
||||
ELSE err(111)
|
||||
END ;
|
||||
|
|
|
|||
|
|
@ -552,7 +552,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
|
|||
END FPrint;
|
||||
|
||||
|
||||
PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SET);
|
||||
PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SET); (*SYSTEM.SET64);*)
|
||||
BEGIN FPrint(fp, SYSTEM.VAL(LONGINT, set))
|
||||
END FPrintSet;
|
||||
|
||||
|
|
@ -603,12 +603,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
|
|||
BEGIN Files.ReadNum(oldSF, k); RETURN k
|
||||
END SymRInt64;
|
||||
|
||||
(* todo - combine RSet64 and RSet *)
|
||||
PROCEDURE SymRSet64*(VAR s: SYSTEM.SET64);
|
||||
BEGIN Files.ReadNum(oldSF, s)
|
||||
END SymRSet64;
|
||||
|
||||
PROCEDURE SymRSet*(VAR s: SET);
|
||||
PROCEDURE SymRSet*(VAR s: SET); (*SYSTEM.SET64);*)
|
||||
BEGIN Files.ReadNum(oldSF, s)
|
||||
END SymRSet;
|
||||
|
||||
|
|
@ -653,7 +648,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
|
|||
BEGIN Files.WriteNum(newSF, i)
|
||||
END SymWInt;
|
||||
|
||||
(* todo
|
||||
(*
|
||||
PROCEDURE SymWSet*(s: SYSTEM.SET64);
|
||||
BEGIN Files.WriteNum(newSF, SYSTEM.VAL(SYSTEM.INT64, s))
|
||||
END SymWSet;
|
||||
|
|
|
|||
|
|
@ -15,10 +15,8 @@ TYPE
|
|||
ext*: ConstExt; (* string or code for code proc *)
|
||||
intval*: SYSTEM.INT64; (* constant value or adr, proc par size, text position or least case label *)
|
||||
intval2*: LONGINT; (* string length, proc var size or larger case label *)
|
||||
(* todo
|
||||
setval*: SYSTEM.SET64; (* constant value, procedure body present or "ELSE" present in case *)
|
||||
*)
|
||||
setval*: SET; (* constant value, procedure body present or "ELSE" present in case *)
|
||||
(*setval*: SYSTEM.SET64;*) (* constant value, procedure body present or "ELSE" present in case *)
|
||||
setval*: SET; (* constant value, procedure body present or "ELSE" present in case *)
|
||||
realval*: LONGREAL (* real or longreal constant value *)
|
||||
END;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue