1 | open Extracted.Errors |
---|
2 | open Extracted.ErrorMessages |
---|
3 | |
---|
4 | let error_to_string = function |
---|
5 | | NotTerminated -> "NotTerminated" |
---|
6 | | AssemblyTooLarge -> "AssemblyTooLarge" |
---|
7 | | MISSING -> "MISSING" |
---|
8 | | EXTERNAL -> "EXTERNAL" |
---|
9 | | Jump_expansion_failed |
---|
10 | | ValueIsNotABoolean -> "ValueIsNotABoolean" |
---|
11 | | BadCast -> "BadCast" |
---|
12 | | BadlyTypedTerm -> "BadlyTypedTerm" |
---|
13 | | UnknownIdentifier -> "UnknownIdentifier" |
---|
14 | | BadLvalueTerm -> "BadLvalueTerm" |
---|
15 | | FailedLoad -> "FailedLoad" |
---|
16 | | FailedOp -> "FailedOp" |
---|
17 | | WrongNumberOfParameters -> "WrongNumberOfParameters" |
---|
18 | | FailedStore -> "FailedStore" |
---|
19 | | NonsenseState -> "NonsenseState" |
---|
20 | | ReturnMismatch -> "ReturnMismatch" |
---|
21 | | UnknownLabel -> "UnknownLabel" |
---|
22 | | BadFunctionValue -> "BadFunctionValue" |
---|
23 | | MainMissing -> "MainMissing" |
---|
24 | | UnknownField -> "UnknownField" |
---|
25 | | UndeclaredIdentifier -> "UndeclaredIdentifier" |
---|
26 | | BadlyTypedAccess -> "BadlyTypedAccess" |
---|
27 | | BadLvalue -> "BadLvalue" |
---|
28 | | MissingField -> "MissingField" |
---|
29 | | FIXME -> "FIXME" |
---|
30 | | MissingLabel -> "MissingLabel" |
---|
31 | | ParamGlobalMixup -> "ParamGlobalMixup" |
---|
32 | | DuplicateLabel -> "DuplicateLabel" |
---|
33 | | TypeMismatch -> "TypeMismatch" |
---|
34 | | UnknownLocal -> "UnknownLocal" |
---|
35 | | FailedConstant -> "FailedConstant" |
---|
36 | | BadState -> "BadState" |
---|
37 | | StoppedMidIO -> "StoppedMidIO" |
---|
38 | | UnsupportedOp -> "UnsupportedOp" |
---|
39 | | CorruptedPointer -> "CorruptedPointer" |
---|
40 | | NotATwoBytesPointer -> "NotATwoBytesPointer" |
---|
41 | | ValueNotABoolean -> "ValueNotABoolean" |
---|
42 | | NotAnInt32Val |
---|
43 | | WrongLength -> "WrongLength" |
---|
44 | | InitDataStoreFailed -> "InitDataStoreFailed" |
---|
45 | | DuplicateVariable -> "DuplicateVariable" |
---|
46 | | MissingId -> "MissingId" |
---|
47 | | IllTypedEvent -> "IllTypedEvent" |
---|
48 | | InternalStackFull -> "InternalStackFull" |
---|
49 | | InternalStackEmpty -> "InternalStackEmpty" |
---|
50 | | BadProgramCounter -> "BadProgramCounter" |
---|
51 | | ProgramCounterOutOfCode -> "ProgramCounterOutOfCode" |
---|
52 | | PointNotFound -> "PointNotFound" |
---|
53 | | LabelNotFound -> "LabelNotFound" |
---|
54 | | MissingSymbol -> "MissingSymbol" |
---|
55 | | BadFunction -> "BadFunction" |
---|
56 | | SuccessorNotProvided -> "SuccessorNotProvided" |
---|
57 | | BadPointer -> "BadPointer" |
---|
58 | | NoSuccessor -> "NoSuccessor" |
---|
59 | | MissingStackSize -> "MissingStackSize" |
---|
60 | | ExternalMain -> "ExternalMain" |
---|
61 | | BadRegister -> "BadRegister" |
---|
62 | | BadMain -> "BadMain" |
---|
63 | | MissingRegister -> "MissingRegister" |
---|
64 | | MissingStatement -> "MissingStatement" |
---|
65 | | BadJumpTable -> "BadJumpTable" |
---|
66 | | BadJumpValue -> "BadJumpValue" |
---|
67 | | FinalState -> "FinalState" |
---|
68 | | EmptyStack -> "EmptyStack" |
---|
69 | | OutOfBounds -> "OutOfBounds" |
---|
70 | | UnexpectedIO -> "UnexpectedIO" |
---|
71 | | TerminatedEarly -> "TerminatedEarly" |
---|
72 | | RepeatedCostLabel -> "RepeatedCostLabel" |
---|
73 | | BadCostLabelling -> "BadCostLabelling" |
---|
74 | | FunctionNotFound -> "FunctionNotFound" |
---|
75 | | FrameErrorOnPop -> "FrameErrorOnPop" |
---|
76 | | FrameErrorOnPush -> "FrameErrorOnPush" |
---|
77 | | BlockInFramesCorrupted -> "BlockInFramesCorrupted" |
---|
78 | | FramesEmptyOnPop -> "FramesEmptyOnPop" |
---|
79 | | RepeatedCostLabel0 -> "RepeatedCostLabel0" |
---|
80 | | StackOverflow -> "StackOverflow" |
---|
81 | |
---|
82 | |
---|
83 | |
---|
84 | let rec conv_list l = |
---|
85 | (match l with |
---|
86 | | Extracted.List.Nil -> [ ] |
---|
87 | | Extracted.List.Cons (h, t) -> h::conv_list t) |
---|
88 | |
---|
89 | let errormsg m = |
---|
90 | String.concat " " |
---|
91 | (conv_list |
---|
92 | (Extracted.List.map |
---|
93 | (function Extracted.Errors.MSG e -> error_to_string e | _ -> "") |
---|
94 | m)) |
---|