#pragma once

#include <spicy/ast/all.h>

#define VISITOR_DISPATCHERS \
  if constexpr ( std::is_base_of<spicy::detail::codegen::Production, Erased>::value ) { \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Boolean, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::ByteBlock, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Counter, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Ctor, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Enclosure, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Epsilon, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::ForEach, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::LookAhead, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Sequence, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Skip, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Switch, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::TypeLiteral, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Unit, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Resolved, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::Variable, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
    if ( auto r = do_dispatch_one<Result, spicy::detail::codegen::production::While, Erased, Dispatcher, Iterator>(n, tn, d, i, no_match_so_far) ) return r; \
  } \
 \

