add a scanner, but this seems to be a wrong solution. Change open-source head

This commit is contained in:
Youmu Liu
2026-07-07 18:20:38 +08:00
parent b053567eb7
commit 1705d7c245
276 changed files with 3468 additions and 7205 deletions
@@ -0,0 +1,75 @@
// -----------------------------------------------------------------------------
// file="RegexIR.Abstraction"
// Project: StgSharp
// Copyright (c) Nitload.
// SPDX-License-Identifier: MIT
// -----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.RegularAnalysis.Text
{
internal interface IRegexComplex
{
bool IsFullyOptimized { get; set; }
int CommandCount { get; set; }
}
internal interface IRegexSequence
{
string Pattern { get; }
}
internal interface IRegexCount
{
bool IsGreedy { get; }
bool IsStar { get; }
bool IsPlus { get; }
int Min { get; }
int Max { get; }
}
internal abstract class RegexIR
{
protected RegexIR(
RegexIRCommand command
)
{
CommandMask = command;
}
public bool SingleLineResultRequired { get; set; }
public int SingleLineResultIndex { get; set; }
public RegexIRPrefix Prefix { get; set; }
internal RegexIRCommand CommandMask { get; init; }
internal string AsCommand(
int lineNum
)
{
return $"[{lineNum}]\t{Prefix}\t{AsCommand()}";
}
protected abstract string AsCommand();
}
}