regex interpreter now can build partial correct AST (i forget groups), but in bad shape. building an optimizer.

This commit is contained in:
Youmu Liu
2026-02-06 17:07:03 +08:00
parent 1bfb8b67c4
commit 3a441b270c
13 changed files with 236 additions and 31 deletions
@@ -34,21 +34,22 @@ using System.Threading.Tasks;
namespace StgSharp.RegularAnalysis.TextRegex
{
[Flags]
internal enum RegexElementLabel
public enum RegexElementLabel
{
NONE = 0,
UNIT = 1,
GROUP_BEGIN = 2,
GROUP_END = 4,
COUNT = 8,
ALT = 16,
CONCAT = 32,
UNIT_SPAN = 64,
SEQUENCE = UNIT | UNIT_SPAN,
UNIT_SET = 2,
UNIT_SPAN = 4,
GROUP_BEGIN = 8,
GROUP_END = 16,
COUNT = 32,
CONCAT = 64,
ALT = 128,
SEQUENCE = UNIT | UNIT_SPAN | UNIT_SET,
OPERATOR = COUNT | ALT | CONCAT,
ATOM_BEGIN = UNIT | GROUP_BEGIN | UNIT_SPAN,
ATOM_END = UNIT | GROUP_END | COUNT | UNIT_SPAN,
ATOM_BEGIN = SEQUENCE | GROUP_BEGIN ,
ATOM_END = SEQUENCE | GROUP_END,
}
}