From c6e331fa5672c2979b4387bf1cfa22c2051eedd1 Mon Sep 17 00:00:00 2001 From: Reuben Gardos Reid <5456207+ReubenJ@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:07:24 +0200 Subject: [PATCH] Add `AbstractUniformHole` --- src/rulenode.jl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rulenode.jl b/src/rulenode.jl index eb75ab3..f02096c 100644 --- a/src/rulenode.jl +++ b/src/rulenode.jl @@ -45,13 +45,21 @@ The `domain` is a bitvector, where the `i`th bit is set to true if the `i`th rul """ abstract type AbstractHole <: AbstractRuleNode end +""" + Hole <: AbstractHole + +An [`AbstractUniformHole`](@ref) is a placeholder where certain rules from the grammar can still be applied, +but all rules in the domain are required to have the same childtypes. +""" +abstract type AbstractUniformHole <: AbstractHole end + """ UniformHole <: AbstractHole - `domain`: A bitvector, where the `i`th bit is set to true if the `i`th rule in the grammar can be applied. All rules in the domain are required to have the same childtypes. - `children`: The children of this hole in the expression tree. """ -mutable struct UniformHole <: AbstractHole +mutable struct UniformHole <: AbstractUniformHole domain::BitVector children::Vector{AbstractRuleNode} end