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