ExampleDoitImpl.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Generated by BJackson.pa at April 22, 1987 2:16:57 am PDT
using ThreeCasabaFour [1.1] of April 14, 1987 6:34:07 pm PDT
DIRECTORY
ExampleBaseDef,
ExampleATDef,
ExampleAGDef,
ThreeC4Support;
ExampleDoitImpl: CEDAR PROGRAM IMPORTS ExampleBaseDef, ThreeC4Support EXPORTS ExampleAGDef=
BEGIN
OPEN ExampleBaseDef, ExampleATDef, ExampleAGDef, ThreeC4Support;
ExpressionbinProdEvaluate: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: INT] =
BEGIN
tree: ExpressionNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ExpressionbinProdData ← NARROW[tree.data];
IF EqualOp[treeData.Opop, Op.plus] THEN {temp0 ← Add[treeData.Expressionleft.procs.Evaluate[treeData.Expressionleft], treeData.Expressionright.procs.Evaluate[treeData.Expressionright]];
} ELSE {IF EqualOp[treeData.Opop, Op.minus] THEN {temp0 ← Subtract[treeData.Expressionleft.procs.Evaluate[treeData.Expressionleft], treeData.Expressionright.procs.Evaluate[treeData.Expressionright]];
} ELSE {IF EqualOp[treeData.Opop, Op.mult] THEN {temp0 ← Multipy[treeData.Expressionleft.procs.Evaluate[treeData.Expressionleft], treeData.Expressionright.procs.Evaluate[treeData.Expressionright]];
} ELSE {IF EqualOp[treeData.Opop, Op.div] THEN {temp0 ← Divide[treeData.Expressionleft.procs.Evaluate[treeData.Expressionleft], treeData.Expressionright.procs.Evaluate[treeData.Expressionright]];
} ELSE {temp0 ← Error["unknown binary operator"];
};
};
};
};
END
END;
ExpressionnumberProdEvaluate: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: INT] =
BEGIN
tree: ExpressionNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
treeData: ExpressionnumberProdData ← NARROW[tree.data];
temp0 ← ValueOf[treeData.number];
END
END;
ExpressionlocProdEvaluate: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: INT] =
BEGIN
tree: ExpressionNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← tree.position;
END
END;
ExpressionsignalProdEvaluate: PUBLIC PROC[ref: REF ANY] RETURNS[temp0: INT] =
BEGIN
tree: ExpressionNode← NARROW[ref];
BEGIN
ENABLE ThreeC4Support.GetSourceInfo => RESUME[tree.position, tree.length];
temp0 ← Signal[];
END
END;
END..