DIRECTORY AMTypes, Convert, IO, OpPrecParse, OrderedSymbolTableRef, ProcessExtras, Rope, RoseTranslateTypes, RoseTranslateInsides, SignalTypeRegistration, TextNode, TiogaStreams; RoseTranslateRead: CEDAR PROGRAM IMPORTS Convert, IO, OPP: OpPrecParse, OSTR: OrderedSymbolTableRef, ProcessExtras, Rope, RoseTranslateTypes, RoseTranslateInsides, SignalTypeRegistration, TS: TiogaStreams EXPORTS RoseTranslateInsides = BEGIN OPEN RoseTranslateTypes, RoseTranslateInsides; wasRef: PUBLIC WasRef _ NEW [WasRefRep _ ["was module reference"]]; arglikeError, oplikeError: OPP.Token; ops: SymbolTable _ OSTR.CreateTable[CompareOps]; dashClass, assertClass, arrowClass, colonClass, ltClass, gtClass, eqClass, commaClass, lambdaClass, returnClass, squareClass, applClass, rsClass, semiClass, cellClass, cellEndClass, nameClass, portsProcClass, applyClass, stateClass, initStateClass, ioCreatorClass, ioRefTypeClass, initializerClass, expandClass, portsClass, cedarClass, bbTestClass, stTestClass, initCTPropsClass, errorClass, directoryClass, importsClass, openClass, libClass, noisyErrClass, myArgClass: PUBLIC TokenClass; evalClasses: ARRAY EvalType OF TokenClass; autoName: Op _ NIL; evalKeywords: ARRAY EvalType OF ROPE = ["ValsChanged", "InitQ", "PropQ", "InitUD", "PropUD", "FinalUD", "EvalSimple", "FindVicinity"]; MyBreak: PUBLIC IO.BreakProc = {RETURN [SELECT char FROM IN ['a..'z], IN ['A .. 'Z], IN ['0 .. '9] => other, IO.SP, IO.CR, IO.TAB, IO.LF, IO.FF => sepr, ENDCASE => break]}; ErrCheck: PUBLIC PROC [args: OPP.ArgList] RETURNS [errFound: BOOLEAN] = BEGIN WHILE args # NIL DO IF args.first.arg = error THEN RETURN [TRUE]; args _ args.rest; ENDLOOP; errFound _ FALSE; END; OpsCheck: PUBLIC PROC [context: REF ANY, sr: SourceRange, ops: OpPrecParse.TokenList, classes: TokenClassList] RETURNS [err: BOOL] = BEGIN err _ FALSE; WHILE (ops # NIL) AND (classes # NIL) AND NOT err DO IF ops.first.class # classes.first THEN {err _ TRUE; EXIT}; ops _ ops.rest; classes _ classes.rest; ENDLOOP; IF (ops # NIL) # (classes # NIL) THEN err _ TRUE; IF (ops = NIL) AND (classes # NIL) THEN { Whimper[sr, context, SELECT classes.first FROM returnClass => "missing RETURN", rsClass => "missing right square-bracket", cellEndClass => "missing EndCellType", ENDCASE => "mismatched LAMBDA - RETURN, [ - ], or CellType - EndCellType"]; RETURN}; IF err THEN Whimper[sr, context, "mismatched LAMBDA - RETURN, [ - ], or CellType - EndCellType"]; END; ReduceNoisily: PUBLIC OPP.Reducer = BEGIN reduced _ Complain[sr, context, "Missing op before %g", IO.refAny[args.rest.first.arg]]; END; SimplerReduce: PUBLIC OPP.Reducer = {reduced _ args.first.arg}; ReduceError: PUBLIC OPP.Reducer = {reduced _ error}; ReduceIntElt: PUBLIC OPP.Reducer = BEGIN ie: InterfaceElt _ NEW [InterfaceEltRep _ []]; nodeType: REF ANY; IF ErrCheck[args] THEN RETURN [error]; SELECT ops.first.class FROM ltClass => ie.input _ NOT (ie.output _ FALSE); gtClass => ie.input _ NOT (ie.output _ TRUE); eqClass => ie.input _ ie.output _ TRUE; ENDCASE => ERROR; WITH args.first.arg SELECT FROM id: ID => ie.name _ id.rope; ENDCASE => RETURN [Complain[sr, context, "An Interface Element must be identified by an ID, not %g", IO.refAny[args.first.arg]]]; IF (nodeType _ args.rest.first.arg) = omitted THEN { IF SignalTypeRegistration.defaultNodeType = NIL THEN RETURN [Complain[sr, context, "No default NodeType"]]; nodeType _ NEW [IDRep _ [sr, SignalTypeRegistration.defaultNodeType]]}; WITH nodeType SELECT FROM sti: SignalTypeInvocation => ie.sti _ sti; id: ID => IF (ie.sti _ InstantiateSignalType[context, id.rope, NIL]) = NIL THEN RETURN [error]; ENDCASE => RETURN [Complain[sr, context, "An Interface Element must use a Signal Type, not %g", IO.refAny[nodeType]]]; ie.sr _ sr; reduced _ ie; END; ReduceLambda: PUBLIC OPP.Reducer = BEGIN cf: CellFn _ NEW [CellFnRep _ []]; ok: BOOL _ TRUE; IF ErrCheck[args] THEN RETURN [error]; IF OpsCheck[context, sr, ops, LIST[lambdaClass, returnClass]] THEN RETURN [error]; WITH args.first.arg SELECT FROM sb: SquareBracketed => WITH sb.subject SELECT FROM bl: BindingList => cf.args _ bl; ENDCASE => ok _ FALSE; ENDCASE => ok _ FALSE; IF NOT ok THEN RETURN [Complain[sr, context, "LAMBDA must be given parameters, not %g", IO.refAny[args.first.arg]]]; WITH args.rest.first.arg SELECT FROM cd: CellDef => cf.cd _ cd; ENDCASE => ok _ FALSE; IF NOT ok THEN RETURN [Complain[sr, context, "I can only construct functions that return cell types, not %g", IO.refAny[args.rest.first.arg]]]; cf.cd.forFn _ cf; cf.sr _ sr; reduced _ cf; END; ReduceAppl: PUBLIC OPP.Reducer = BEGIN --making either signal type invocation or cell instance subject: REF ANY; subjectIsID: BOOL _ FALSE; subjectAsID: ID; asAny: REF ANY; job: Job _ NARROW[context]; parms: REF ANY; IF ErrCheck[args] THEN RETURN [error]; subject _ args.first.arg; WITH subject SELECT FROM id: ID => subjectIsID _ TRUE; a: Application => NULL; ENDCASE => RETURN [Complain[sr, context, "Must Apply %g to an Application or a simple ID, not %g", IO.refAny[args.rest.first.arg], IO.refAny[args.first.arg]]]; IF args.rest.first.arg = omitted THEN parms _ NEW [ArgsRep _ [sr, NIL]] ELSE WITH args.rest.first.arg SELECT FROM ri: Int => parms _ NEW [ArgsRep _ [sr, LIST[ri]]]; rr: Reel => parms _ NEW [ArgsRep _ [sr, LIST[rr]]]; q: Quoted => parms _ NEW [ArgsRep _ [sr, LIST[q]]]; id: ID => parms _ NEW [ArgsRep _ [sr, LIST[id]]]; a: Args => parms _ a; b: Binding => {bl: BindingList _ LIST[b]; parms _ bl}; bl: BindingList => parms _ bl; ENDCASE => RETURN [Complain[sr, context, "Must apply to %g a BindingList or ArgList, not %g", IO.refAny[subject], IO.refAny[args.rest.first.arg]]]; IF subjectIsID THEN { subjectAsID _ NARROW[subject]; asAny _ SignalTypeRegistration.signalTypes.Lookup[subjectAsID.rope]; IF asAny # NIL THEN RETURN [InstantiateSignalType[context, subjectAsID.rope, parms]]; }; reduced _ NEW [ApplicationRep _ [sr, subject, parms]]; END; Sofar: PUBLIC PROC [sr: SourceRange, context, org: REF ANY] RETURNS [cd: CellDef] = BEGIN IF org = autoName THEN cd _ NEW [CellDefRep _ [sr: sr, nameIsLiteral: FALSE, nameSource: NIL]] ELSE WITH org SELECT FROM q: Quoted => { cd _ NEW [CellDefRep _ [sr: sr, literalName: q.rope, nameIsLiteral: TRUE]]; }; cellDef: CellDef => {cd _ cellDef; cd.sr _ sr}; ENDCASE => { [] _ Complain[sr, context, "Bad Cell header: %g", IO.refAny[org]]; cd _ NIL; }; END; InsistOnCedarSource: PUBLIC PROC [context: REF ANY, sofar: REF ANY, args: OPP.ArgList] RETURNS [cs: CedarSource, reduced: REF ANY] = BEGIN WITH args.rest.first.arg SELECT FROM cedar: CedarSource => {cs _ cedar; reduced _ sofar}; ENDCASE => {cs _ NIL; reduced _ Complain[nullSR, context, "Internal Error"]}; END; ReduceName: PUBLIC OPP.Reducer = BEGIN IF ErrCheck[args] THEN RETURN [error]; WITH args.first.arg SELECT FROM cs: CedarSource => reduced _ NEW [CellDefRep _ [sr: sr, nameIsLiteral: FALSE, nameSource: cs ]]; ENDCASE => RETURN [Complain[sr, context, "Internal Error"]]; END; ReduceCell: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF OpsCheck[context, sr, ops, LIST[cellClass, cellEndClass]] THEN RETURN [error]; IF (reduced _ sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.interfaceLiteral = NIL AND sofar.interfaceSource = NIL THEN sofar.interfaceLiteral _ DigestInterface[context, NIL]; END; ReducePortsProc: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.interfaceSource # NIL THEN Whimper[sr, context, "Redefining PortsProc"]; [sofar.interfaceSource, reduced] _ InsistOnCedarSource[context, sofar, args]; END; ReduceApply: PUBLIC OPP.Reducer = BEGIN cf: CellFn; IF ErrCheck[args] THEN RETURN [error]; WITH args.first.arg SELECT FROM cellFn: CellFn => cf _ cellFn; ENDCASE => RETURN [Complain[sr, context, "HowToApply tacked onto %g, should have been a Cell Type Function", IO.refAny[args.first.arg]]]; IF cf.howToApply # NIL THEN Whimper[sr, context, "Redefining how to Apply"]; cf.sr _ sr; [cf.howToApply, reduced] _ InsistOnCedarSource[context, cf, args]; END; ReduceState: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.stateGiven THEN Whimper[sr, context, "Redefining State Vector"]; sofar.stateGiven _ TRUE; [sofar.stateSource, reduced] _ InsistOnCedarSource[context, sofar, args]; sofar.stateInittable _ FALSE; END; ReduceInitState: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.stateGiven THEN Whimper[sr, context, "Redefining State Vector"]; sofar.stateGiven _ TRUE; [sofar.stateSource, reduced] _ InsistOnCedarSource[context, sofar, args]; sofar.stateInittable _ TRUE; END; ReducePorts: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; WITH args.rest.first.arg SELECT FROM sb: SquareBracketed => { IF NOT ISTYPE[sb.subject, InterfaceEltList] THEN RETURN [Complain[sr, context, "PORTS must be given a square bracketed interface element list, not %g", IO.refAny[args.rest.first.arg]]]; sofar.interfaceLiteral _ DigestInterface[context, NARROW[sb.subject]] } ENDCASE => reduced _ Complain[sr, context, "PORTS must be given a square bracketed interface element list, not %g", IO.refAny[args.rest.first.arg]]; reduced _ sofar; END; ReduceExpand: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.expandGiven THEN Whimper[sr, context, "Redefining Expand Proc"]; sofar.expandGiven _ TRUE; reduced _ sofar; WITH args.rest.first.arg SELECT FROM s: Statements => sofar.expandCode _ s; cs: CedarSource => sofar.expandCode _ NEW [StatementsRep _ [sr, LIST[cs]]]; bl: BindingList => sofar.expandCode _ NEW [StatementsRep _ [sr, LIST[bl]]]; b: Binding => sofar.expandCode _ NEW [StatementsRep _ [sr, LIST[b]]]; ENDCASE => reduced _ Complain[sr, context, "EXPAND must be given a statement or statement list, not %g", IO.refAny[args.rest.first.arg]]; END; ReduceIOCreator: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.ioCreatorGiven THEN Whimper[sr, context, "Redefining IOCreator"]; sofar.ioCreatorGiven _ TRUE; [sofar.ioCreatorSource, reduced] _ InsistOnCedarSource[context, sofar, args]; END; ReduceIORefType: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (reduced _ sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.ioRefTypeName # NIL THEN Whimper[sr, context, "Redefining IORef TYPE name"]; WITH args.rest.first.arg SELECT FROM id: ID => sofar.ioRefTypeName _ id.rope; ENDCASE => reduced _ Complain[sr, context, "An IORef TYPE name must be an ID, not %g", IO.refAny[args.rest.first.arg]]; END; ReduceInitializer: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.initializerGiven THEN Whimper[sr, context, "Redefining Initializer"]; sofar.initializerGiven _ TRUE; [sofar.initializerSource, reduced] _ InsistOnCedarSource[context, sofar, args]; END; ReduceEval: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; type: EvalType _ ToEvalType[ops.first.class]; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.evalsGiven[type] THEN Whimper[sr, context, "Redefining %g Proc", IO.rope[evalKeywords[type]]]; sofar.evalsGiven[type] _ TRUE; [sofar.evalSources[type], reduced] _ InsistOnCedarSource[context, sofar, args]; END; ToEvalType: PROC [class: TokenClass] RETURNS [et: EvalType] = BEGIN FOR et IN EvalType DO IF evalClasses[et] = class THEN RETURN ENDLOOP; ERROR; END; ReduceBBTest: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.bbTestGiven THEN Whimper[sr, context, "Redefining Black Box Test Proc"]; sofar.bbTestGiven _ TRUE; [sofar.bbTestSource, reduced] _ InsistOnCedarSource[context, sofar, args]; END; ReduceSTTest: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.stTestGiven THEN Whimper[sr, context, "Redefining Test (State Too) Proc"]; sofar.stTestGiven _ TRUE; [sofar.stTestSource, reduced] _ InsistOnCedarSource[context, sofar, args]; END; ReduceInitCTProps: PUBLIC OPP.Reducer = BEGIN sofar: CellDef; IF ErrCheck[args] THEN RETURN [error]; IF (sofar _ Sofar[sr, context, args.first.arg]) = NIL THEN RETURN [error]; IF sofar.initCTPropsGiven THEN Whimper[args.rest.first.sr, context, "Redefining Initial Props Proc"]; sofar.initCTPropsGiven _ TRUE; [sofar.initCTPropsSource, reduced] _ InsistOnCedarSource[context, sofar, args]; END; CompareOps: PUBLIC OSTR.CompareProc = BEGIN s1, s2: ROPE; s1 _ WITH r1 SELECT FROM r: ROPE => r, op: Op => op.name, ENDCASE => ERROR; s2 _ WITH r2 SELECT FROM r: ROPE => r, op: Op => op.name, ENDCASE => ERROR; RETURN [s1.Compare[s2, FALSE]]; END; ParseExpression: PUBLIC PROC [job: Job] RETURNS [expr: REF ANY] = BEGIN GetToken: OPP.TokenProc = BEGIN asRope: ROPE; op: Op; peek: CHAR; startIdx: INT; GetSR: PROC RETURNS [sr: SourceRange] = { next: INT _ job.from.GetIndex[]; sr _ [startIdx, next-1]}; HandleNumber: PROC [sgn: INT] RETURNS [OPP.Token] = BEGIN tokenKind: IO.TokenKind; token: ROPE; [tokenKind, token, ] _ job.from.GetCedarTokenRope[]; SELECT tokenKind FROM tokenREAL => RETURN [[GetSR[], myArgClass, NEW [ReelRep _ [GetSR[], Convert.RealFromLiteral[token]*sgn]]]]; tokenDECIMAL, tokenOCTAL, tokenHEX => RETURN [[ GetSR[], myArgClass, NEW [IntRep _ [ GetSR[], sgn*Convert.CardFromWholeNumberLiteral[token]]]]]; ENDCASE => ERROR; END; WHILE TRUE DO ProcessExtras.CheckForAbort[]; IF useOld THEN {useOld _ FALSE; RETURN [[oldSR, myArgClass, old]]}; [] _ job.from.SkipWhitespace[flushComments: FALSE]; startIdx _ job.from.GetIndex[]; IF job.from.EndOf[] THEN RETURN [OPP.end]; job.tokenCount _ job.tokenCount + 1; peek _ job.from.PeekChar[]; IF peek = '" THEN BEGIN asAny: REF ANY _ IO.GetRefAny[job.from]; asRope: ROPE _ NARROW[asAny]; RETURN [[GetSR[], myArgClass, NEW [QuotedRep _ [GetSR[], asRope]] ]]; END; IF peek = '| THEN BEGIN cedar: ROPE _ NIL; IF job.from.GetChar[] # '| THEN ERROR; WHILE NOT job.from.EndOf[] DO char: CHAR _ job.from.GetChar[]; IF char = '| THEN BEGIN IF job.from.PeekChar[] # '| THEN EXIT ELSE [] _ job.from.GetChar[]; END; cedar _ cedar.Concat[Rope.FromChar[char]]; ENDLOOP; RETURN [[GetSR[], myArgClass, NEW [CedarLiteralRep _ [GetSR[], cedar]] ]]; END; IF peek = '( THEN BEGIN asAny: REF ANY; asAny _ IO.GetRefAny[job.from !IO.Error, IO.EndOfStream => { Whimper[GetSR[], job, "Syntax error in list"]; asAny _ error; CONTINUE}]; IF asAny = error THEN RETURN [IF expectingArg THEN arglikeError ELSE oplikeError]; RETURN [[GetSR[], myArgClass, NEW [RefAnyListRep _ [GetSR[], NARROW[asAny]]] ]]; END; IF peek IN ['0 .. '9] THEN RETURN [HandleNumber[1]]; IF peek = '- THEN BEGIN IF job.from.GetChar[] # '- THEN ERROR; IF (peek _ job.from.PeekChar[]) = '- THEN BEGIN IF job.from.GetChar[] # '- THEN ERROR; WHILE NOT job.from.EndOf[] DO char: CHAR _ job.from.GetChar[]; IF char = '\n THEN EXIT; IF char = '- THEN BEGIN char _ job.from.GetChar[]; IF char = '- OR char = '\n THEN EXIT; END; ENDLOOP; LOOP; END ELSE IF peek IN ['0 .. '9] THEN RETURN [HandleNumber[-1]] ELSE asRope _ "-"; END ELSE asRope _ job.from.GetTokenRope[MyBreak].token; op _ NARROW[ops.Lookup[asRope]]; IF op = NIL THEN RETURN [[GetSR[], myArgClass, NEW [IDRep _ [GetSR[], asRope]] ]]; IF op.eatsCedar THEN BEGIN char: CHAR _ job.from.GetChar[]; --counter Backup in GetToken parent: TextNode.Ref _ TS.CurInNode[job.from]; TS.SkipChildren[job.from]; useOld _ TRUE; oldSR _ GetSR[]; old _ NEW [CedarSourceRep _ [GetSR[], parent]]; END; IF op.class[expectingArg] = NIL THEN BEGIN job.log.PutF["Syntax error at %g: %g not allowed\n", IO.int[job.from.GetIndex[]], IO.rope[asRope]]; job.errCount _ job.errCount + 1; RETURN [IF expectingArg THEN arglikeError ELSE oplikeError]; END; RETURN [[GetSR[], op.class[expectingArg], op]]; ENDLOOP; END; useOld: BOOLEAN _ FALSE; oldSR: SourceRange; old: REF ANY _ NIL; [] _ job.from.GetIndex[]; [[, expr]] _ OPP.Parse[job, GetToken !OPP.CantReduce, OPP.CantFix, OPP.DoesntFix, OPP.TerminateErr, OPP.LastReduceErr, OPP.InvalidToken => BEGIN job.log.PutF["Congratulations! You trashed the parser (somewhere before %g)... You lose!\n", IO.int[job.from.GetIndex[]]]; job.errCount _ job.errCount + 1; expr _ NIL; CONTINUE; END]; END; Setup: PROC = BEGIN noisyErrClass _ NEW[TokenClassRep _ [2000, 3000, ReduceNoisily]]; myArgClass _ NEW[TokenClassRep _ [0, 0, NIL, [nullSR, noisyErrClass, NIL]]]; ltClass _ NEW[TokenClassRep _ [510, 500, ReduceIntElt]]; gtClass _ NEW[TokenClassRep _ [510, 500, ReduceIntElt]]; eqClass _ NEW[TokenClassRep _ [510, 500, ReduceIntElt]]; colonClass _ NEW[TokenClassRep _ [410, 400, ReduceBinding]]; arrowClass _ NEW[TokenClassRep _ [350, 360, ReduceArrow]]; dashClass _ NEW[TokenClassRep _ [350, 360, ReduceDash]]; assertClass _ NEW[TokenClassRep _ [80, 90, ReduceAssert]]; commaClass _ NEW[TokenClassRep _ [310, 300, ReduceComma, [nullSR, OPP.argClass, omitted]]]; cedarClass _ NEW[TokenClassRep _ [0, 10000, SimplerReduce]]; nameClass _ NEW[TokenClassRep _ [0, 10000, ReduceName]]; directoryClass _ NEW[TokenClassRep _ [0, 275, ReduceDirectory]]; importsClass _ NEW[TokenClassRep _ [0, 275, ReduceImports]]; openClass _ NEW[TokenClassRep _ [0, 275, ReduceOpen]]; libClass _ NEW[TokenClassRep _ [0, 275, ReduceLibrary]]; errorClass _ NEW[TokenClassRep _ [250, 250, ReduceError]]; lambdaClass _ NEW[TokenClassRep _ [0, 150, ReduceLambda]]; returnClass _ NEW[TokenClassRep _ [150, 1000, NIL]]; squareClass _ NEW[TokenClassRep _ [0, 200, ReduceSquare]]; applClass _ NEW[TokenClassRep _ [1000, 200, ReduceAppl]]; rsClass _ NEW[TokenClassRep _ [200, 0, NIL, [nullSR, OPP.argClass, omitted]]]; semiClass _ NEW[TokenClassRep _ [110, 100, ReduceSemi]]; portsProcClass_ NEW[TokenClassRep _ [80, 90, ReducePortsProc]]; applyClass _ NEW[TokenClassRep _ [810, 90, ReduceApply]]; stateClass _ NEW[TokenClassRep _ [80, 90, ReduceState]]; initStateClass _ NEW[TokenClassRep _ [80, 90, ReduceInitState]]; ioCreatorClass _ NEW[TokenClassRep _ [80, 90, ReduceIOCreator]]; ioRefTypeClass _ NEW[TokenClassRep _ [80, 90, ReduceIORefType]]; initializerClass _ NEW[TokenClassRep _ [80, 90, ReduceInitializer]]; bbTestClass _ NEW[TokenClassRep _ [80, 90, ReduceBBTest]]; stTestClass _ NEW[TokenClassRep _ [80, 90, ReduceSTTest]]; initCTPropsClass_ NEW[TokenClassRep_ [80, 90, ReduceInitCTProps]]; expandClass _ NEW[TokenClassRep _ [80, 90, ReduceExpand]]; portsClass_ NEW[TokenClassRep _ [80, 90, ReducePorts]]; cellClass _ NEW[TokenClassRep _ [0, 10, ReduceCell]]; cellEndClass_ NEW[TokenClassRep _ [10, 0]]; FOR et: EvalType IN EvalType DO evalClasses[et] _ NEW[TokenClassRep _ [80, 90, ReduceEval]]; ops.Insert[NEW[OpRep _ [evalKeywords[et], [evalClasses[et], NIL], TRUE]]]; ENDLOOP; ops.Insert[NEW[OpRep _ [":", [colonClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["_", [arrowClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["-", [dashClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["<", [ltClass, NIL]]]]; ops.Insert[NEW[OpRep _ [">", [gtClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["=", [eqClass, NIL]]]]; ops.Insert[NEW[OpRep _ [",", [commaClass, commaClass]]]]; ops.Insert[NEW[OpRep _ ["LAMBDA", [NIL, lambdaClass]]]]; ops.Insert[NEW[OpRep _ ["RETURN", [returnClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["[", [applClass, squareClass]]]]; ops.Insert[NEW[OpRep _ ["]", [rsClass, rsClass]]]]; ops.Insert[NEW[OpRep _ [";", [semiClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["CELLTYPE", [NIL, cellClass]]]]; ops.Insert[NEW[OpRep _ ["EndCellType", [cellEndClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["PORTS", [portsClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["PortsProc", [portsProcClass, NIL], TRUE]]]; ops.Insert[NEW[OpRep _ ["ApplyCode",[applyClass, NIL], TRUE]]]; ops.Insert[NEW[OpRep _ ["Assert", [assertClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["State", [stateClass, NIL], TRUE]]]; ops.Insert[NEW[OpRep _ ["InittableState", [initStateClass, NIL], TRUE]]]; ops.Insert[NEW[OpRep _ ["IOCreator", [ioCreatorClass, NIL], TRUE]]]; ops.Insert[NEW[OpRep _ ["IORefTypeName", [ioRefTypeClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["Initializer", [initializerClass, NIL], TRUE]]]; ops.Insert[NEW[OpRep _ ["Expand", [expandClass, NIL]]]]; ops.Insert[NEW[OpRep _ ["CEDAR", [NIL, cedarClass], TRUE]]]; ops.Insert[NEW[OpRep _ ["NameMaker",[NIL, nameClass], TRUE]]]; ops.Insert[autoName_ NEW[OpRep _ ["AutoName",[NIL, myArgClass], FALSE]]]; ops.Insert[NEW[OpRep _ ["BlackBoxTest", [bbTestClass, NIL], TRUE]]]; ops.Insert[NEW[OpRep _ ["TestStateToo", [stTestClass, NIL], TRUE]]]; ops.Insert[NEW[OpRep _ ["InitCTProps", [initCTPropsClass, NIL], TRUE]]]; ops.Insert[NEW[OpRep _ ["Directory", [NIL, directoryClass]]]]; ops.Insert[NEW[OpRep _ ["Imports", [NIL, importsClass]]]]; ops.Insert[NEW[OpRep _ ["Open", [NIL, openClass]]]]; ops.Insert[NEW[OpRep _ ["Library", [NIL, libClass]]]]; arglikeError _ [nullSR, OPP.argClass, error]; oplikeError _ [nullSR, errorClass, NIL]; END; Setup[]; END. RoseTranslateRead.Mesa Last Edited by: Spreitzer, September 28, 1984 8:18:28 pm PDT Last Edited by: Barth, March 8, 1983 10:43 am Last Edited by: Gasbarro, August 16, 1984 3:42:16 pm PDT to allow comments there, don't test: IF char # '\n THEN ERROR; Κ˜J™Jšœ<™Kšœ˜Kšœ œ˜K˜Kšœœ&˜/Kšœ˜—šœœ˜$Kš˜Kšœ5œœ˜cK˜ Kšœœœœ˜Kšœ œ œ˜6Kšœ œ)œœ˜EKšœ œ#œœ˜@Kšœ œ#œ˜9Kšœ œ!œœ˜=Kšœ œ-œœ˜IKšœ œ(œœ˜DKšœ œ,œ˜BKšœ œ,œœ˜HKšœ œ"œ˜8Kšœ œœœ˜=Kšœ œœœ˜?Kšœœœœ˜IKšœ œ(œœ˜DKšœ œ(œœ˜DKšœ œ,œœ˜HKšœ œœ˜?Kšœ œœ˜;Kšœ œœ˜5Kšœ œœ˜7K˜Kšœœ˜-Kšœ#œ˜(K˜Kšœ˜—K˜K˜K˜Kšœ˜—…—Tpo€