// Copyright 2026 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_REGEXP_REGEXP_NODE_PRINTER_H_ #define V8_REGEXP_REGEXP_NODE_PRINTER_H_ #ifdef V8_ENABLE_REGEXP_DIAGNOSTICS #include "irregexp/imported/regexp-nodes.h" #include "irregexp/imported/regexp-printer.h" namespace v8 { namespace internal { namespace regexp { template class NodePrinter; template <> class NodePrinter : public NodePrinterBase, public NodeVisitor { public: NodePrinter(std::ostream& os, GraphLabeller* labeller, Zone* zone) : NodePrinterBase(os, labeller, zone, 'n') {} NodePrinter(const PrinterBase& other, GraphLabeller* labeller) : NodePrinterBase(other, labeller, 'n') {} using NodePrinterBase::PrintNodeLabel; #define DECLARE_VISIT(Type) void Visit##Type(Type##Node* that) override; FOR_EACH_NODE_TYPE(DECLARE_VISIT) #undef DECLARE_VISIT void PrintGuard(const Guard* guard); void PrintNodeLabel(const Node* node, const char* name); void PrintSuccess(const SeqNode* node); }; using RegExpGraphNodePrinter = NodePrinter; } // namespace regexp } // namespace internal } // namespace v8 #endif // V8_ENABLE_REGEXP_DIAGNOSTICS #endif // V8_REGEXP_REGEXP_NODE_PRINTER_H_