Next: Enumerated types
Up: The Pascal type model
Previous: The Pascal type model
Required simple types[6]
:
SET ordinalType = [intType, boolType, charType];
SET arithType = [intType, realType];
SET simpleType = [intType, realType, boolType, charType];
COERCION
(intType): realType;
OPER
cmpeq, cmpne, cmpls, cmpgt, cmple, cmpge(simpleType,simpleType): boolType;
pos, neg(arithType): arithType;
add, sub, mul(arithType,arithType): arithType;
divi, rem(intType,intType): intType;
divr(realType,realType): realType;
inv(boolType): boolType;
disj, conj(boolType,boolType): boolType;
rewriteOp, putOp, resetOp, getOp(textType): voidType;
readOp(textType, simpleType): voidType;
rdtextOp(simpleType): voidType;
readlnOp(textType): voidType;
wtextOp(writableType): voidType;
wlistOp(writableType,writableType): voidType;
wfileOp(textType, writableType): voidType;
writelnOp(textType): voidType;
absOp, sqrOp(arithType): arithType;
sinOp, cosOp, expOp, lnOp, sqrtOp, arctanOp(realType): realType;
truncOp, roundOp(realType): intType;
ordOp(ordinalType): intType;
chrOp(intType): charType;
succOp, predOp(ordinalType): ordinalType;
oddOp(intType): boolType;
txtTest(textType): boolType;
txtDeref(textType): charType;
COERCION
(intType): writableType;
(realType): writableType;
(boolType): writableType;
(charType): writableType;
(stringType): writableType;
(eofType): boolType;
(eolnType): boolType;
INDICATION
equal: cmpeq;
lsgt: cmpne;
less: cmpls;
greater: cmpgt;
lessequal: cmple;
greaterequal: cmpge;
plus: pos, add;
minus: neg, sub;
or: disj;
star: mul;
slash: divr;
div: divi;
mod: rem;
and: conj;
not: inv;
rewriteType: rewriteOp;
putType: putOp;
resetType: resetOp;
getType: getOp;
readType: readOp, rdtextOp;
readlnType: readlnOp;
writeType: wlistOp, wtextOp, wfileOp;
writelnType: writelnOp, wlistOp, wtextOp, wfileOp;
absType: absOp;
sqrType: sqrOp;
sinType: sinOp;
cosType: cosOp;
expType: expOp;
lnType: lnOp;
sqrtType: sqrtOp;
arctanType: arctanOp;
truncType: truncOp;
roundType: roundOp;
ordType: ordOp;
chrType: chrOp;
succType: succOp;
predType: predOp;
oddType: oddOp;
eofType: txtTest;
eolnType: txtTest;
deref: txtDeref;
This macro is invoked in definition 3.
intKey -> Defer={intType};
realKey -> Defer={realType};
boolKey -> Defer={boolType};
charKey -> Defer={charType};
textKey -> Defer={textType};
trueKey -> TypeOf={boolType};
falseKey -> TypeOf={boolType};
Property definitions[11]
This macro is attached to a product file.
The required ordinal types all have corresponding set types:
Sets of required ordinal types[8]
:
TREE SYMBOL program COMPUTE
SYNT.GotType=
ORDER(
AddTypeToBlock(
intsetType,
SetTypes,
SingleDefTableKeyList(intType)),
ResetCanonicalSet(intType,intsetType),
AddTypeToBlock(
boolsetType,
SetTypes,
SingleDefTableKeyList(boolType)),
ResetCanonicalSet(boolType,boolsetType),
AddTypeToBlock(
charsetType,
SetTypes,
SingleDefTableKeyList(charType)),
ResetCanonicalSet(charType,charsetType));
SYNT.GotOper=
ORDER(
InstClass1(setType,FinalType(intsetType),intType),
MonadicOperator(
makeset,
NoOprName,
intType,
FinalType(intsetType)),
InstClass1(setType,FinalType(boolsetType),boolType),
MonadicOperator(
makeset,
NoOprName,
boolType,
FinalType(boolsetType)),
InstClass1(setType,FinalType(charsetType),charType),
MonadicOperator(
makeset,
NoOprName,
charType,
FinalType(charsetType)));
END;
RULE: Source ::= program COMPUTE
Source.GotType=program.GotType;
Source.GotOper=program.GotOper;
END;
This macro is invoked in definition 1.
Next: Enumerated types
Up: The Pascal type model
Previous: The Pascal type model
2008-08-29