package asli

  1. Overview
  2. Docs

Module LibASL.Asl_visitorSource

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.

Sourceclass 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.

Sourceval visit_exprs : aslVisitor -> Asl_ast.expr list -> Asl_ast.expr list
Sourceval visit_patterns : aslVisitor -> Asl_ast.pattern list -> Asl_ast.pattern list
Sourceval visit_types : aslVisitor -> Asl_ast.ty list -> Asl_ast.ty list
Sourceval visit_type : aslVisitor -> Asl_ast.ty -> Asl_ast.ty
Sourceval visit_lexprs : aslVisitor -> Asl_ast.lexpr list -> Asl_ast.lexpr list
Sourceval with_locals : (Asl_ast.ty * Asl_ast.ident) list -> aslVisitor -> (aslVisitor -> 'a) -> 'a
Sourceval visit_stmts : aslVisitor -> Asl_ast.stmt list -> Asl_ast.stmt list
Sourceval visit_args : aslVisitor -> (Asl_ast.ty * Asl_ast.ident) list -> (Asl_ast.ty * Asl_ast.ident) list
Sourceval 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.