package herdtools7

  1. Overview
  2. Docs

Error handling for Asllib.

type error_handling_time =
  1. | Static
  2. | Dynamic
type error_desc =
  1. | ReservedIdentifier of string
  2. | BadField of string * AST.ty
  3. | MissingField of string list * AST.ty
  4. | BadSlices of error_handling_time * AST.slice list * int
  5. | BadSlice of AST.slice
  6. | EmptySlice
  7. | TypeInferenceNeeded
  8. | UndefinedIdentifier of AST.identifier
  9. | MismatchedReturnValue of string
  10. | BadArity of error_handling_time * AST.identifier * int * int
  11. | BadParameterArity of error_handling_time * AST.version * AST.identifier * int * int
  12. | UnsupportedBinop of error_handling_time * AST.binop * AST.literal * AST.literal
  13. | UnsupportedUnop of error_handling_time * AST.unop * AST.literal
  14. | UnsupportedExpr of error_handling_time * AST.expr
  15. | UnsupportedTy of error_handling_time * AST.ty
  16. | InvalidExpr of AST.expr
  17. | MismatchType of string * AST.type_desc list
  18. | NotYetImplemented of string
  19. | ObsoleteSyntax of string
  20. | ConflictingTypes of AST.type_desc list * AST.ty
  21. | AssertionFailed of AST.expr
  22. | CannotParse
  23. | UnknownSymbol
  24. | NoCallCandidate of string * AST.ty list
  25. | TooManyCallCandidates of string * AST.ty list
  26. | BadTypesForBinop of AST.binop * AST.ty * AST.ty
  27. | CircularDeclarations of string
  28. | ImpureExpression of AST.expr * SideEffect.SES.t
  29. | UnreconciliableTypes of AST.ty * AST.ty
  30. | AssignToImmutable of string
  31. | AlreadyDeclaredIdentifier of string
  32. | BadReturnStmt of AST.ty option
  33. | UnexpectedSideEffect of string
  34. | UncaughtException of string
  35. | OverlappingSlices of AST.slice list * error_handling_time
  36. | BadLDI of AST.local_decl_item
  37. | BadRecursiveDecls of AST.identifier list
  38. | UnrespectedParserInvariant
  39. | BadATC of AST.ty * AST.ty
    (*

    asserting, asserted

    *)
  40. | BadPattern of AST.pattern * AST.ty
  41. | ConstrainedIntegerExpected of AST.ty
  42. | ParameterWithoutDecl of AST.identifier
  43. | BadParameterDecl of AST.identifier * AST.identifier list * AST.identifier list
    (*

    name, expected, actual

    *)
  44. | BaseValueEmptyType of AST.ty
  45. | ArbitraryEmptyType of AST.ty
  46. | BaseValueNonStatic of AST.ty * AST.expr
  47. | SettingIntersectingSlices of AST.bitfield list
  48. | SetterWithoutCorrespondingGetter of AST.func
  49. | NonReturningFunction of AST.identifier
  50. | ConflictingSideEffects of SideEffect.t * SideEffect.t
  51. | UnexpectedATC
  52. | UnreachableReached
  53. | LoopLimitReached
  54. | RecursionLimitReached
  55. | EmptyConstraints
  56. | UnexpectedPendingConstrained
  57. | BitfieldsDontAlign of {
    1. field1_absname : string;
    2. field2_absname : string;
    3. field1_absslices : string;
    4. field2_absslices : string;
    }
  58. | BadPrintType of AST.ty
  59. | ConfigTimeBroken of AST.expr * SideEffect.SES.t
  60. | ConstantTimeBroken of AST.expr * SideEffect.SES.t
  61. | MultipleWrites of AST.identifier
  62. | UnexpectedInitialisationThrow of AST.ty * AST.identifier
exception ASLException of error
type 'a result = ('a, error) Result.t
val fatal : error -> 'a
val fatal_from : 'a AST.annotated -> error_desc -> 'b
val fatal_here : AST.position -> AST.position -> error_desc -> 'a
val fatal_unknown_pos : error_desc -> 'a
val intercept : (unit -> 'a) -> unit -> ('a, error) result
val error_handling_time_to_string : error_handling_time -> string
type warning_desc =
  1. | NoRecursionLimit of AST.identifier list
  2. | NoLoopLimit
  3. | IntervalTooBigToBeExploded of Z.t * Z.t
  4. | ConstraintSetPairToBigToBeExploded of {
    1. op : AST.binop;
    2. left : AST.int_constraint list;
    3. right : AST.int_constraint list;
    4. log_max : int;
      (*

      Maximum size breached by this constraint set pair.

      *)
    }
  5. | RemovingValuesFromConstraints of {
    1. op : AST.binop;
    2. prev : AST.int_constraint list;
    3. after : AST.int_constraint list;
    }
  6. | PragmaUse of AST.identifier
val error_label : error_desc -> string
val warning_label : warning_desc -> string
module PPrint : sig ... end
include module type of struct include PPrint end
val pp_comma_list : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a list -> unit
val pp_type_desc : Format.formatter -> AST.type_desc -> unit
val pp_error_desc : Format.formatter -> error_desc AST.annotated -> unit
val pp_warning_desc : Format.formatter -> warning_desc AST.annotated -> unit
val pp_pos_begin : Format.formatter -> 'a AST.annotated -> unit
val pp_error : Format.formatter -> error_desc AST.annotated -> unit
val pp_warning : Format.formatter -> warning_desc AST.annotated -> unit
val error_desc_to_string : error_desc AST.annotated -> string
val desc_to_string_inf : (Format.formatter -> 'a -> unit) -> 'a -> string
val error_to_string : error_desc AST.annotated -> string
val escape : string -> string
val pp_csv : (Format.formatter -> 'a AST.annotated -> unit) -> ('a -> string) -> out_channel -> 'a AST.annotated -> unit
val pp_error_csv : out_channel -> error_desc AST.annotated -> unit
val pp_warning_csv : out_channel -> warning_desc AST.annotated -> unit
type output_format =
  1. | HumanReadable
  2. | CSV
module type ERROR_PRINTER_CONFIG = sig ... end
module ErrorPrinter (C : ERROR_PRINTER_CONFIG) : sig ... end
OCaml

Innovation. Community. Security.