<<>> <> <> <> <> DIRECTORY ConvertUnsafe USING [ToRope], MessageTab USING [], MimosaLog USING [ErrorCode], Rope USING [ROPE], Symbols USING [TransferMode, TypeClass], Tree USING [NodeName]; MessageTabImpl: PROGRAM IMPORTS ConvertUnsafe EXPORTS MessageTab = { ROPE: TYPE = Rope.ROPE; NodePrintName: PUBLIC PROC [name: Tree.NodeName] RETURNS [ROPE] = { str: STRING ¬ NIL; SELECT name FROM list => str ¬ "list"; item => str ¬ "item"; decl => str ¬ "decl"; typedecl => str ¬ "typedecl"; basicTC => str ¬ "basicTC"; enumeratedTC => str ¬ "enumeratedTC"; recordTC => str ¬ "recordTC"; monitoredTC => str ¬ "monitoredTC"; variantTC => str ¬ "variantTC"; refTC => str ¬ "refTC"; pointerTC => str ¬ "pointerTC"; listTC => str ¬ "listTC"; arrayTC => str ¬ "arrayTC"; arraydescTC => str ¬ "arraydescTC"; sequenceTC => str ¬ "sequenceTC"; procTC => str ¬ "procTC"; processTC => str ¬ "processTC"; portTC => str ¬ "portTC"; signalTC => str ¬ "signalTC"; errorTC => str ¬ "errorTC"; programTC => str ¬ "programTC"; anyTC => str ¬ "anyTC"; definitionTC => str ¬ "definitionTC"; unionTC => str ¬ "unionTC"; relativeTC => str ¬ "relativeTC"; subrangeTC => str ¬ "subrangeTC"; longTC => str ¬ "longTC"; opaqueTC => str ¬ "opaqueTC"; zoneTC => str ¬ "zoneTC"; linkTC => str ¬ "linkTC"; varTC => str ¬ "varTC"; implicitTC => str ¬ "implicitTC"; frameTC => str ¬ "frameTC"; discrimTC => str ¬ "discrimTC"; paintTC => str ¬ "paintTC"; optionTC => str ¬ "optionTC"; spareTC => str ¬ "spareTC?"; unit => str ¬ "unit"; diritem => str ¬ "diritem"; module => str ¬ "module"; body => str ¬ "body"; inline => str ¬ "inline"; lambda => str ¬ "lambda"; block => str ¬ "block"; assign => str ¬ "assign"; extract => str ¬ "extract"; if => str ¬ "if"; case => str ¬ "case"; casetest => str ¬ "casetest"; caseswitch => str ¬ "caseswitch"; bind => str ¬ "bind"; do => str ¬ "do"; forseq => str ¬ "forseq"; upthru => str ¬ "upthru"; downthru => str ¬ "downthru"; return => str ¬ "return"; result => str ¬ "result"; goto => str ¬ "goto"; exit => str ¬ "exit"; loop => str ¬ "loop"; free => str ¬ "free"; resume => str ¬ "resume"; reject => str ¬ "reject"; continue => str ¬ "continue"; retry => str ¬ "retry"; catchmark => str ¬ "catchmark"; restart => str ¬ "restart"; stop => str ¬ "stop"; lock => str ¬ "lock"; wait => str ¬ "wait"; notify => str ¬ "notify"; broadcast => str ¬ "broadcast"; unlock => str ¬ "unlock"; null => str ¬ "null"; label => str ¬ "label"; open => str ¬ "open"; enable => str ¬ "enable"; catch => str ¬ "catch"; dst => str ¬ "dst"; lste => str ¬ "lste"; lstf => str ¬ "lstf"; syscall => str ¬ "syscall"; checked => str ¬ "checked"; lst => str ¬ "lst"; spareS3 => str ¬ "spareS3"; subst => str ¬ "subst"; call => str ¬ "call"; portcall => str ¬ "portcall"; signal => str ¬ "signal"; error => str ¬ "error"; syserror => str ¬ "syserror"; xerror => str ¬ "xerror"; start => str ¬ "start"; join => str ¬ "join"; apply => str ¬ "apply"; callx => str ¬ "callx"; portcallx => str ¬ "portcallx"; signalx => str ¬ "signalx"; errorx => str ¬ "errorx"; syserrorx => str ¬ "syserrorx"; startx => str ¬ "startx"; fork => str ¬ "fork"; joinx => str ¬ "joinx"; index => str ¬ "index"; dindex => str ¬ "dindex"; seqindex => str ¬ "seqindex"; reloc => str ¬ "reloc"; construct => str ¬ "construct"; union => str ¬ "union"; rowcons => str ¬ "rowcons"; sequence => str ¬ "sequence"; listcons => str ¬ "listcons"; substx => str ¬ "substx"; ifx => str ¬ "ifx"; casex => str ¬ "casex"; bindx => str ¬ "bindx"; assignx => str ¬ "assignx"; extractx => str ¬ "extractx"; or => str ¬ "or"; and => str ¬ "and"; relE => str ¬ "relE"; relN => str ¬ "relN"; relL => str ¬ "relL"; relGE => str ¬ "relGE"; relG => str ¬ "relG"; relLE => str ¬ "relLE"; in => str ¬ "in"; notin => str ¬ "notin"; plus => str ¬ "plus"; minus => str ¬ "minus"; times => str ¬ "times"; div => str ¬ "div"; mod => str ¬ "mod"; power => str ¬ "power"; dot => str ¬ "dot"; cdot => str ¬ "cdot"; dollar => str ¬ "dollar"; create => str ¬ "create"; not => str ¬ "not"; uminus => str ¬ "uminus"; addr => str ¬ "addr"; uparrow => str ¬ "uparrow"; min => str ¬ "min"; max => str ¬ "max"; ord => str ¬ "ord"; val => str ¬ "val"; abs => str ¬ "abs"; all => str ¬ "all"; size => str ¬ "size"; first => str ¬ "first"; last => str ¬ "last"; pred => str ¬ "pred"; succ => str ¬ "succ"; arraydesc => str ¬ "arraydesc"; length => str ¬ "length"; base => str ¬ "base"; loophole => str ¬ "loophole"; nil => str ¬ "nil"; new => str ¬ "new"; void => str ¬ "void"; clit => str ¬ "clit"; llit => str ¬ "llit"; cast => str ¬ "cast"; check => str ¬ "check"; float => str ¬ "float"; pad => str ¬ "pad"; chop => str ¬ "chop"; safen => str ¬ "safen"; syscallx => str ¬ "syscallx"; narrow => str ¬ "narrow"; istype => str ¬ "istype"; openx => str ¬ "openx"; mwconst => str ¬ "mwconst"; cons => str ¬ "cons"; atom => str ¬ "atom"; typecode => str ¬ "typecode"; stringinit => str ¬ "stringinit"; textlit => str ¬ "textlit"; signalinit => str ¬ "signalinit"; procinit => str ¬ "procinit"; intOO => str ¬ "intOO"; intOC => str ¬ "intOC"; intCO => str ¬ "intCO"; intCC => str ¬ "intCC"; thread => str ¬ "thread"; none => str ¬ "none"; exlist => str ¬ "exlist"; initlist => str ¬ "initlist"; ditem => str ¬ "ditem"; lengthen => str ¬ "lengthen"; shorten => str ¬ "shorten"; self => str ¬ "self"; gcrt => str ¬ "gcrt"; proccheck => str ¬ "proccheck"; entry => str ¬ "entry"; internal => str ¬ "internal"; invalid => str ¬ "INVALID"; ENDCASE; RETURN [ConvertUnsafe.ToRope[str]]; }; TypePrintName: PUBLIC PROC [class: Symbols.TypeClass] RETURNS [ROPE] = { str: STRING ¬ NIL; SELECT class FROM mode => str ¬ "mode"; basic => str ¬ "basic"; signed => str ¬ "signed"; unsigned => str ¬ "unsigned"; real => str ¬ "real"; enumerated => str ¬ "enumerated"; record => str ¬ "record"; ref => str ¬ "ref"; array => str ¬ "array"; arraydesc => str ¬ "arraydesc"; transfer => str ¬ "transfer"; definition => str ¬ "definition"; union => str ¬ "union"; sequence => str ¬ "sequence"; relative => str ¬ "relative"; subrange => str ¬ "subrange"; opaque => str ¬ "opaque"; zone => str ¬ "zone"; any => str ¬ "any"; nil => str ¬ "NIL"; ENDCASE; RETURN [ConvertUnsafe.ToRope[str]]; }; ModePrintName: PUBLIC PROC [mode: Symbols.TransferMode] RETURNS [ROPE] = { str: STRING ¬ NIL; SELECT mode FROM proc => str ¬ "proc"; port => str ¬ "port"; signal => str ¬ "signal"; error => str ¬ "error"; process => str ¬ "process"; program => str ¬ "program"; other => str ¬ "other"; none => str ¬ "none"; ENDCASE; RETURN [ConvertUnsafe.ToRope[str]]; }; OpName: PUBLIC PROC [name: Tree.NodeName[$assignx..$uparrow]] RETURNS [ROPE] = { str: STRING ¬ NIL; SELECT name FROM assignx => str ¬ "_"; extractx => str ¬ "_"; or => str ¬ " OR "; and => str ¬ " AND "; relE => str ¬ "="; relN => str ¬ "#"; relL => str ¬ "<"; relGE => str ¬ ">="; relG => str ¬ ">"; relLE => str ¬ "<="; in => str ¬ " IN "; notin => str ¬ " NOT IN "; plus => str ¬ "+"; minus => str ¬ "-"; times => str ¬ "*"; div => str ¬ "/"; mod => str ¬ " MOD "; power => str ¬ " ** "; dot => str ¬ "."; cdot => str ¬ "."; dollar => str ¬ "."; create => str ¬ " NEW "; not => str ¬ " NOT "; uminus => str ¬ "-"; addr => str ¬ "@"; uparrow => str ¬ "^"; ENDCASE; RETURN [ConvertUnsafe.ToRope[str]]; }; FnName: PUBLIC PROC [name: Tree.NodeName[$min..$new]] RETURNS [ROPE] = { str: STRING ¬ NIL; SELECT name FROM min => str ¬ "MIN"; max => str ¬ "MAX"; ord => str ¬ "ORD"; val => str ¬ "VAL"; abs => str ¬ "ABS"; all => str ¬ "ALL"; size => str ¬ "SIZE"; first => str ¬ "FIRST"; last => str ¬ "LAST"; pred => str ¬ "PRED"; succ => str ¬ "SUCC"; arraydesc => str ¬ "DESCRIPTOR"; length => str ¬ "LENGTH"; base => str ¬ "BASE"; loophole => str ¬ "LOOPHOLE"; nil => str ¬ "NIL"; new => str ¬ "NEW"; ENDCASE; RETURN [ConvertUnsafe.ToRope[str]]; }; ApplName: PUBLIC PROC [name: Tree.NodeName[$apply..$joinx]] RETURNS [ROPE] = { str: STRING ¬ NIL; SELECT name FROM apply => str ¬ "APPLY"; callx => str ¬ "APPLY"; portcallx => str ¬ ""; signalx => str ¬ "SIGNAL"; errorx => str ¬ "ERROR"; syserrorx => str ¬ "ERROR"; startx => str ¬ "START"; fork => str ¬ "FORK"; joinx => str ¬ "JOIN"; ENDCASE; RETURN [ConvertUnsafe.ToRope[str]]; }; FApplName: PUBLIC PROC [name: Tree.NodeName[$restart..$broadcast]] RETURNS [ROPE] = { str: STRING ¬ NIL; SELECT name FROM restart => str ¬ "RESTART"; stop => str ¬ "STOP"; lock => str ¬ "LOCK"; wait => str ¬ "WAIT"; notify => str ¬ "NOTIFY"; broadcast => str ¬ "BROADCAST"; ENDCASE; RETURN [ConvertUnsafe.ToRope[str]]; }; ErrorMessages: PUBLIC PROC [code: MimosaLog.ErrorCode] RETURNS [ROPE] = { str: STRING ¬ NIL; SELECT code FROM <<>> <> compilerError => str ¬ "FATAL COMPILER ERROR"; unimplemented => str ¬ "unimplemented construct"; other => str ¬ "unspecified error"; aborted => str ¬ "compilation aborted"; <> arraySize => str ¬ "array too large for implementation"; attrClash => str ¬ "invalid attribute combination"; bodyType => str ¬ "illegal initialization to body"; catchLabel => str ¬ "misplaced RETRY or CONTINUE"; descriptor => str ¬ "misused DESCRIPTOR"; discrimForm => str ¬ "incorrect discrimination"; exit => str ¬ "misplaced EXIT or LOOP"; illDefinedReturn => str ¬ "default return of anonymous value"; implicitCall => str ¬ "implicit system call"; indexType => str ¬ "illegal index type"; inlineChecked => str ¬ "MACHINE CODE cannot be CHECKED"; inlineType => str ¬ "illegal initialization to MACHINE CODE"; instLength => str ¬ "instruction has incorrect length"; interfaceString => str ¬ "string literals not permitted in DEFINITIONS"; keys => str ¬ "keywords not permitted"; long => str ¬ "misused LONG"; longPath => str ¬ "must be in MDS"; machDep => str ¬ "type must be MACHINE DEPENDENT"; misplacedCatch => str ¬ "misplaced catch phrase"; misplacedEntry => str ¬ "unmonitored ENTRY or INTERNAL"; misplacedMonitorRef => str ¬ "unmonitored WAIT or NOTIFY"; misplacedResume => str ¬ "misplaced REJECT or RESUME"; misplacedReturn => str ¬ "misplaced RETURN"; misplacedStop => str ¬ "misplaced STOP"; misplacedType => str ¬ "misplaced opaque type declaration"; mixedPositions => str ¬ "mixed explicit and implicit field positions"; noAccess => str ¬ "attempt to access private fields"; nonOrderedType => str ¬ "index or interval type must be ordered"; nonTypeCons => str ¬ "unrecognizable type constructor"; nonVoidStmt => str ¬ "procedure used as a statement returns a value"; opaqueTest => str ¬ "discrimination on opaque types is unimplemented"; relative => str ¬ "misused RELATIVE"; stateVector => str ¬ "state vector has improper offset"; staticNesting => str ¬ "body or catch phrase nested too deeply"; subrangeNesting => str ¬ "interval bounds are out of range"; unsafeBlock => str ¬ "improper use of an unsafe block"; var => str ¬ "misused VAR"; <<>> <> unknownId => str ¬ "is undeclared"; unknownField => str ¬ "is not valid as a field selector"; <<>> <> ambiguousId => str ¬ "is ambiguous without discrimination"; duplicateId => str ¬ "is multiply defined"; missingImport => str ¬ "is an unmatched implicit import"; unknownTag => str ¬ "is not a legal variant tag"; duplicateTag => str ¬ "labels multiple variants"; unknownVariant => str ¬ "does not name a variant"; unknownKey => str ¬ "is not valid as a key"; duplicateKey => str ¬ "is repeated as a key"; omittedKey => str ¬ "cannot be defaulted"; openId => str ¬ "must label a record"; fileName => str ¬ "cannot be opened"; fileWrong => str ¬ "found in wrong version"; moduleId => str ¬ "is not a module name"; <<>> <> addressOverflow => str ¬ "exceeds addressing limits"; circularType => str ¬ "leads to a circular type definition"; circularValue => str ¬ "has ill-defined or circular value"; elision => str ¬ "cannot be defaulted or voided"; enumOrder => str ¬ "is out of order"; exportAttr => str ¬ "is exported with incorrect attributes"; exportClash => str ¬ "is exported with incorrect type"; fieldPosition => str ¬ "has invalid field width or alignment"; forwardRef => str ¬ "is used before set"; internalCall => str ¬ "is a misused INTERNAL"; missingBase => str ¬ "requires a base value"; missingInit => str ¬ "requires an initial value"; missingLock => str ¬ "required for lock"; nonDefinition => str ¬ "improperly defined for a DEFINITIONS module"; nonTagType => str ¬ "has a type illegal for a tag"; nonTypeId => str ¬ "is not a type"; notImported => str ¬ "must come from an imported interface"; position => str ¬ "cannot have a specified position"; privateId => str ¬ "is private"; recordGap => str ¬ "is followed by a gap"; recordOverlap => str ¬ "overlaps another field"; recursiveInline => str ¬ "is INLINE and recursive"; typeLength => str ¬ "has unknown or ill-defined size"; updateClash => str ¬ "must be exported as READONLY"; varExport => str ¬ "has no exportable value"; <> boundsFault => str ¬ "is out of range"; controlId => str ¬ "is an improper control variable"; defaultForm => str ¬ "has an invalid default"; duplicateLabel => str ¬ "is multiply defined"; missingBinding => str ¬ "lacks a tag needed for discrimination"; misusedInline => str ¬ "is an incorrectly used inline"; mixedRepresentation => str ¬ "has signed/unsigned ambiguity"; noApplication => str ¬ "does not allow an argument list"; nonAddressable => str ¬ "does not allow indirect reference"; nonConstant => str ¬ "has nonconstant value"; nonInterface => str ¬ "must have an interface type"; nonLHS => str ¬ "is not a variable"; nonVar => str ¬ "is not address (@) of a variable"; nonVariantLabel => str ¬ "specifies an inadmissable test"; noTarget => str ¬ "requires explicit type"; notImExPortable => str ¬ "is not importable/exportable"; noVariants => str ¬ "has no variants"; overflow => str ¬ "overflows"; operandSize => str ¬ "has a size exceeding implementation limits"; scopeFault => str ¬ "is being assigned out of scope"; sizeClash => str ¬ "has incorrect or ambiguous length"; spuriousBinding => str ¬ "explicit selection not permitted"; typeClash => str ¬ "has incorrect type"; unknownLabel => str ¬ "is undeclared"; unsafeOperation => str ¬ "uses an unsafe operation"; unsafeSelection => str ¬ "is discriminated unsafely"; <> missingAttr => str ¬ "has no "; missingOp => str ¬ "has a type with no "; unsafeOp => str ¬ "uses an unsafe "; <<>> <> bodyEntries => str ¬ "too many procedure or signal definitions"; exportedVars => str ¬ "too many exported variables"; interfaceEntries => str ¬ "too many interface items"; listShort => str ¬ "too few elements in list"; listLong => str ¬ "too many elements in list"; <> pointerInit => str ¬ "multiple initialization with a pointer"; unreachable => str ¬ "unreachable code"; <<>> <> paddedField => str ¬ "has been padded"; privateExport => str ¬ "is private but matches an export"; uninitialized => str ¬ "appears uninitialized"; unusedExport => str ¬ "receives no exported values"; unusedId => str ¬ "is never referenced"; unusedImport => str ¬ "supplies no imported values"; voidExport => str ¬ "matches a constant in an exported interface"; <<>> <> replString => str ¬ "has global strings preventing replacement"; replId => str ¬ "has incompatible attributes for replacement"; <<>> <> emptyArray => str ¬ "has zero length"; fileVersion => str ¬ "referenced in different versions"; unsignedCompare => str ¬ "will use unsigned comparison"; doubleEntry => str ¬ "attempts to claim lock while the lock is held"; <> notPortable => str ¬ "may not be portable"; looksUgly => str ¬ "looks ugly"; reallyFunky => str ¬ "is really funky"; ENDCASE; RETURN [ConvertUnsafe.ToRope[str]]; }; }.