SaffronMakeTypeBoundImpl.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Generated by BJackson.pa at April 27, 1987 11:24:13 pm PDT
using ThreeCasabaFour [1.1] of April 14, 1987 6:34:07 pm PDT
DIRECTORY
CedarBaseContext,
SaffronAG6Def,
CedarBaseMisc,
CedarBaseTypeAux,
ThreeC4Support,
SaffronATDef,
CedarBaseValue,
CedarBaseType;
SaffronMakeTypeBoundImpl: CEDAR PROGRAM IMPORTS CedarBaseMisc, CedarBaseTypeAux, ThreeC4Support, CedarBaseValue, CedarBaseType EXPORTS SaffronAG6Def=
BEGIN
OPEN CedarBaseContext, SaffronAG6Def, CedarBaseMisc, CedarBaseTypeAux, ThreeC4Support, SaffronATDef, CedarBaseValue, CedarBaseType;
BoundProdMakeTypeBound: PUBLIC PROC[ref: REF ANY, typeIndex: TypeIndex, localContext: LocalContext, ribContext: RibContext, typeGraph: TypeGraph] RETURNS[temp0: OrdinalValue, temp1: LocalContext, temp2: TypeGraph] =
BEGIN
tree: BoundNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: BoundProdData ← NARROW[tree.data];
BEGIN
assert2: BOOLEAN;
assert1: BOOLEAN;
typeNode: TypeNode;
localContext3: LocalContext;
typeGraph3: TypeGraph;
assert: BOOLEAN;
boundTypeNode: TypeNode;
localContext2: LocalContext;
typeGraph2: TypeGraph;
boundTypeIndex: TypeIndex;
value: Value;
localContext1: LocalContext;
typeGraph1: TypeGraph;
[value, localContext1, typeGraph1] ← treeData.Exp.procs.MakeValue[treeData.Exp, localContext, ribContext, typeGraph, typeIndex];
boundTypeIndex ← ValueGetType[value];
[boundTypeNode, localContext2, typeGraph2] ← FetchType[typeGraph1, boundTypeIndex, localContext1, ribContext];
assert ← Assert[IsEnumType[boundTypeNode], "type mismatch", BotchAction.quit];
[typeNode, localContext3, typeGraph3] ← FetchType[typeGraph2, typeIndex, localContext2, ribContext];
assert1 ← Assert[PaintEqual[GetPaint[typeNode], GetPaint[boundTypeNode]], "type mismatch", BotchAction.quit];
assert2 ← Assert[IsSimpleValue[value], "not a compile-time constant", BotchAction.quit];
temp2 ← typeGraph3;
temp1 ← localContext3;
temp0 ← ValueGetOrdinal[value];
END;
END
END;
END..