Module IR__Annot

The Smallfoot Intermediate Language: Annotations

module F = Stdlib.Format
type t = {
class_name : string;

name of the annotation

parameters : parameter list;
}

Type to represent an @Annotation with potentially complex parameter values such as arrays or other annotations.

and parameter = {
name : string option;
value : value;
}
and value =
| Str of string
| Bool of bool
| Enum of {
class_typ : IR.Typ.t;
value : string;
}
| Array of value list
| Class of IR.Typ.t
| Annot of t

Type to represent possible annotation parameter values. Note that support for numeric parameters is missing for now due to an issue with MaximumSharing and int64.

val compare : t -> t -> int
val compare_parameter : parameter -> parameter -> int
val compare_value : value -> value -> int
val compare : t -> t -> int
val compare_parameter : parameter -> parameter -> int
val compare_value : value -> value -> int
val volatile : t

annotation for fields marked with the "volatile" keyword

val final : t

annotation for fields marked with the "final" keyword

val has_matching_str_value : pred:(string -> bool) -> value -> bool

Check if annotation parameter value contains a string satisfying a predicate. For convenience it works both with raw Str and Str inside Array.

val find_parameter : t -> name:string -> value option
val pp : F.formatter -> t -> unit

Pretty print an annotation.

module Item : sig ... end
module Class : sig ... end
module Method : sig ... end