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