PipalSisyph.mesa
Copyright Ó 1985, 1986, 1987, 1988 by Xerox Corporation. All rights reserved.
Created by Sindhu and Serlet, November 26, 1985 1:02:25 am PDT
Pradeep Sindhu November 15, 1986 11:24:25 pm PST
Barth, January 13, 1986 3:31:45 pm PST
Bertrand Serlet April 30, 1988 6:56:28 pm PDT
Context Handling Procedures
CreateContext:
PROC
RETURNS [context: PipalSinix.Context];
Evaluates all design satellites or expressions in that context.
Define:
PROC [context: PipalSinix.Context, variable:
ATOM, value:
REF];
Defines variable for context, and sets its value.
Set:
PROC [context: PipalSinix.Context, variable:
ATOM, value:
REF];
Assumes that variable is a defined variable, and sets its value.
Get:
PROC [context: PipalSinix.Context, variable:
ATOM]
RETURNS [value:
REF];
Retrieves the value of variable.
GetInt:
PROC [context: PipalSinix.Context, variable:
ATOM]
RETURNS [value:
INT];
Retrieves the value of variable, and converts to INT.
GetAtom:
PROC [context: PipalSinix.Context, variable:
ATOM]
RETURNS [value:
ATOM];
Retrieves the value of variable, and converts to an ATOM.
GetRope:
PROC [context: PipalSinix.Context, variable:
ATOM]
RETURNS [value: Core.
ROPE];
Retrieves the value of variable, and converts to a ROPE.
Eval:
PROC [context: PipalSinix.Context, expr: Core.
ROPE]
RETURNS [value:
REF];
Computes the value of expr.
Expressions yielding a non-REF (such as an INT) a REFized, to allow satellites like: "Value: 2".
Might raise InterpreterError.
DefineEval:
PROC [context: PipalSinix.Context, variable:
ATOM, expr: Core.
ROPE];
Defines variable for context, and sets its value to the evaluated expression.
SetEval:
PROC [context: PipalSinix.Context, variable:
ATOM, expr: Core.
ROPE];
Assumes that variable is a defined variable, and sets its value to the evaluated expression.
Exceptions
ContextProblem:
SIGNAL [message: Core.
ROPE, variable:
ATOM];
GlobalNonAtomic:
SIGNAL [object: Pipal.Object, name: Core.
ROPE, wire: Core.Wire];
InterpreterProblem: SIGNAL [context: PipalSinix.Context, expr, errorRope: Core.ROPE];
Private Utilities for implementors of Extract Procs
defaultGlobalNames: PRIVATE LIST OF Core.ROPE;
globalNames:
PRIVATE
LIST
OF Core.
ROPE;
variables treated specially by the extractor.
Recognized satellites are:
<variable> ~ <expr> (declaration)
<variable> ← <expr> (parameter passing)
<variable> : <expr> (property)
others (for those, variable=NIL and expr=satellite)
ParseSatellite:
PRIVATE
PROC [satellite: Core.
ROPE]
RETURNS [variable:
ATOM ←
NIL, char:
CHAR, expr: Core.
ROPE];
ParsedRope: TYPE = RECORD [variable: ATOM, expr: Core.ROPE];
ParseSatellites:
PRIVATE
PROC [satellites:
LIST
OF Core.
ROPE]
RETURNS [declarations, assignments, properties:
LIST
OF ParsedRope ←
NIL, others:
LIST
OF Core.
ROPE ←
NIL];
ProcessGlobalNames:
PROC [mode: PipalSinix.Mode, objName: Core.
ROPE, context: PipalSinix.Context, fused: RefTab.Ref, instances:
LIST
OF CoreClasses.CellInstance];
Global wires for a given global name are identified as wire (named appropriately or unnamed) connected in instances to a sub public appropriately named. They are made public and fused.