Type hierarchy within Clang.jl

I’m using Clang.jl to automatically generate julia wrappers over C structs, lets call them MyType1, MyType2, etc:

struct MyType1
    # generated by Clang.jl
end
struct MyType2
    # generated by Clang.jl
end

However, these are (as all concretes types by default) direct subtypes of Any. Instead I would like the generated types to be

abstract type AbstractMyType end
abstract type AbstractMyType1 <: AbstractMyType end
abstract type AbstractMyType2 <: AbstractMyType end
(...)
struct MyType1 <: AbstractMyType1
    # generated by Clang.jl
end
struct MyType2 <: AbstractMyType2
    # generated by Clang.jl
end

Is this possible?

It’s possible as long as you know how to manipulate Julia AST.