2021-09-12 13:00:27 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Forward.h"
|
2021-10-03 15:31:25 +00:00
|
|
|
#include <AK/Vector.h>
|
2021-09-12 13:00:27 +00:00
|
|
|
|
|
|
|
namespace regex {
|
|
|
|
|
|
|
|
class Optimizer {
|
|
|
|
public:
|
2021-09-13 19:15:22 +00:00
|
|
|
static void append_alternation(ByteCode& target, ByteCode&& left, ByteCode&& right);
|
2022-02-19 23:55:21 +00:00
|
|
|
static void append_alternation(ByteCode& target, Span<ByteCode> alternatives);
|
2021-10-03 15:31:25 +00:00
|
|
|
static void append_character_class(ByteCode& target, Vector<CompareTypeAndValuePair>&& pairs);
|
2021-09-12 13:00:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|