RegexBytecodeStreamOptimizer.h 497 B

123456789101112131415161718192021
  1. /*
  2. * Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include "Forward.h"
  8. #include <AK/Vector.h>
  9. namespace regex {
  10. class Optimizer {
  11. public:
  12. static void append_alternation(ByteCode& target, ByteCode&& left, ByteCode&& right);
  13. static void append_alternation(ByteCode& target, Span<ByteCode> alternatives);
  14. static void append_character_class(ByteCode& target, Vector<CompareTypeAndValuePair>&& pairs);
  15. };
  16. }