package herdtools7

  1. Overview
  2. Docs

Pretty-printers for ASL ASTs.

Utils

type 'a printer = Format.formatter -> 'a -> unit

A general pretty-printer type.

val pp_print_seq : ?pp_sep:unit printer -> 'a printer -> 'a Seq.t printer

Re-exported from stdlib 4.12, print q sequence from its elements.

val pp_pos : 'a AST.annotated printer
val pp_pos_str : 'a AST.annotated -> string

Print a position.

AST pretty-printers

val pp_literal : AST.literal printer

Print a literal from its components.

val pp_expr : AST.expr printer

Pretty-print an expression.

val pp_ty : AST.ty printer

Pretty-print a type.

val pp_typed_identifier : AST.typed_identifier printer

Pretty-print a variable and its type.

val pp_lexpr : AST.lexpr printer

Pretty-print the left-hand side of an assignment.

val pp_for_direction : AST.for_direction -> string

Pretty-print keyword of for loop direction

val pp_stmt : AST.stmt printer

Pretty-print a statement.

val pp_slice_list : AST.slice list printer

Pretty-print a list of slices.

val pp_int_constraints : AST.int_constraint list printer

Pretty-print a list of int constraints.

val pp_local_decl_item : AST.local_decl_item printer

Pretty-print a local declaration item.

val pp_t : AST.t printer

Print an AST from printer for a literal

val pp_version : [ `ASLv0 | `ASLv1 | `Any ] printer

Print the ASL version.

val pp_scope : AST.scope printer

Print a scope.

Pretty-print to strings

val literal_to_string : AST.literal -> string

Converts a literal into a string.

val binop_to_string : AST.binop -> string

Writes a binop as an ASL operator.

val unop_to_string : AST.unop -> string

Writes a unop as an ASL operator.

val ty_to_string : AST.ty -> string

Converts a type into a string.

val t_to_string : AST.t -> string

t_to_string v_to_string ast is a string representing ast with literals printed with v_to_string.

OCaml

Innovation. Community. Security.