Using new file structure. Use new regexir display method. Fix line dependency error in prefix analysing.
Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
// 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:D3}] {Prefix}, {AsCommand()}";
|
||||
}
|
||||
|
||||
protected abstract string AsCommand();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user