mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:28:11 +00:00
LibRegex: Add a basic optimization pass
This currently tries to convert forking loops to atomic groups, and unify the left side of alternations.
This commit is contained in:
parent
913382734c
commit
246ab432ff
9 changed files with 677 additions and 24 deletions
18
Userland/Libraries/LibRegex/RegexBytecodeStreamOptimizer.h
Normal file
18
Userland/Libraries/LibRegex/RegexBytecodeStreamOptimizer.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Forward.h"
|
||||
|
||||
namespace regex {
|
||||
|
||||
class Optimizer {
|
||||
public:
|
||||
static void append_alternation(ByteCode& target, ByteCode& left, ByteCode& right);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue