fix errors in interpreter. add a enumerator for tree. working on tree optimizer
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="TestRegexAnalyse"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
// AuthorGroup: Nitload
|
||||
// Copyright (c) Nitload. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -38,11 +38,17 @@ namespace StgSharp
|
||||
public class TestRegexAnalyse
|
||||
{
|
||||
|
||||
private const string regex = @"abc(?<name>abc)";
|
||||
private const string regex = @"ab[1-9]+(?<name>abc)";
|
||||
|
||||
public static void Run()
|
||||
{
|
||||
RegexInterpreter interpreter = RegexInterpreter.Analyze(regex);
|
||||
AbstractSyntaxTree<RegexAstNode, RegexElementLabel> tree = interpreter.Tree;
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
foreach (RegexAstNode node in tree) {
|
||||
Console.WriteLine($"{node.Source.Value}\t{node.Source.Flag}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user