ASVariableSequences.mesa
Last Edited by: Arnon, June 10, 1985 4:19:22 pm PDT
This structure exists in order to be a subDomain of Sequences, i.e. first we create an initial version of VariableSequences with the standard SequenceStructure constructor, then we set up a subclass that has the special ops.
DIRECTORY
AlgebraClasses;
ASVariableSequences: CEDAR DEFINITIONS
= BEGIN OPEN AC: AlgebraClasses;
Types
VariableSequence: TYPE = AC.Object;
VariableSequences: AC.Object; -- public structure
Operations
VariableFirstChar: PROC [char: CHAR, V: VariableSequence] RETURNS [BOOL];
True if char is the first character of some variable in V.
MakeVariableSequence: AC.ListImbedOp;
This will become Method $variableSequence of structure VariableSequences.
MergeVariableSequences: AC.BinaryOp;
All variables of firstArg that do not occur in secondArg are placed at left (low) end of result.
Variables X and Y may occur in different order in the two args; no note is made of this; they will occur in result in the order they had in secondArg.
NewMainVariable: AC.BinaryOp;
firstArg is a VariableSequence, secondArg is a Variable that may or may not occur in firstArg. result is firstArg with reordered variables so that secondArg is new main variable. Order of other variables is preserved
END.