package asli

  1. Overview
  2. Docs

ASL visitor class

ASL visitor class

For each datatype in the ASL AST, a visitor defines what actions it wants to perform on values of that type.

class type aslVisitor = object ... end

ASL visitor functions

The following set of recursive functions are the ASL specific part of the visitor class. For each data constructor of each datatype, they invoke visitors on each field of the data constructor and then reconstruct the corresponding data constructor.

These functions implement the space-saving optimisation of only reconstructing the constructor if the sub-values are different.

val visit_exprs : aslVisitor -> Asl_ast.expr list -> Asl_ast.expr list
val visit_var : aslVisitor -> Asl_ast.ident -> Asl_ast.ident
val visit_lvar : aslVisitor -> Asl_ast.ident -> Asl_ast.ident
val visit_e_elsif : aslVisitor -> Asl_ast.e_elsif -> Asl_ast.e_elsif
val visit_slice : aslVisitor -> Asl_ast.slice -> Asl_ast.slice
val visit_patterns : aslVisitor -> Asl_ast.pattern list -> Asl_ast.pattern list
val visit_pattern : aslVisitor -> Asl_ast.pattern -> Asl_ast.pattern
val visit_expr : aslVisitor -> Asl_ast.expr -> Asl_ast.expr
val visit_types : aslVisitor -> Asl_ast.ty list -> Asl_ast.ty list
val visit_type : aslVisitor -> Asl_ast.ty -> Asl_ast.ty
val visit_lexprs : aslVisitor -> Asl_ast.lexpr list -> Asl_ast.lexpr list
val visit_lexpr : aslVisitor -> Asl_ast.lexpr -> Asl_ast.lexpr
val with_locals : (Asl_ast.ty * Asl_ast.ident) list -> aslVisitor -> (aslVisitor -> 'a) -> 'a
val visit_stmts : aslVisitor -> Asl_ast.stmt list -> Asl_ast.stmt list
val visit_stmt : aslVisitor -> Asl_ast.stmt -> Asl_ast.stmt
val visit_s_elsif : aslVisitor -> Asl_ast.s_elsif -> Asl_ast.s_elsif
val visit_alt : aslVisitor -> Asl_ast.alt -> Asl_ast.alt
val visit_catcher : aslVisitor -> Asl_ast.catcher -> Asl_ast.catcher
val visit_mapfield : aslVisitor -> Asl_ast.mapfield -> Asl_ast.mapfield
val visit_sformal : aslVisitor -> Asl_ast.sformal -> Asl_ast.sformal
val visit_encoding : aslVisitor -> Asl_ast.encoding -> Asl_ast.encoding
val visit_decode_case : aslVisitor -> Asl_ast.decode_case -> Asl_ast.decode_case
val visit_decode_alt : aslVisitor -> Asl_ast.decode_alt -> Asl_ast.decode_alt
val visit_decode_body : aslVisitor -> Asl_ast.decode_body -> Asl_ast.decode_body
val visit_args : aslVisitor -> (Asl_ast.ty * Asl_ast.ident) list -> (Asl_ast.ty * Asl_ast.ident) list
val arg_of_sformal : Asl_ast.sformal -> Asl_ast.ty * Asl_ast.ident
val args_of_encoding : Asl_ast.encoding -> (Asl_ast.ty * Asl_ast.ident) list

nopAslVisitor class

The nopAslVisitor class defines a visitor that recursively visits the entire tree making no change. In practice, all uses of the visitor framework are based on defining a subclass of this type.

OCaml

Innovation. Community. Security.