RegexParser.Patterns.BasePattern.FormatAsTree C# (CSharp) Method

FormatAsTree() public method

public FormatAsTree ( int indentLevel, bool expandCharPatterns ) : string
indentLevel int
expandCharPatterns bool
return string
        public string FormatAsTree(int indentLevel, bool expandCharPatterns)
        {
            if (expandCharPatterns)
                return ToPrettyPrint().FormatAsTree(indentLevel);
            else
                return ToPrettyPrint().FormatAsTree(indentLevel,
                                                    VariableFormatSpecifier.ExpandedExceptTags(PatternType.Char.ToString()));
        }

Same methods

BasePattern::FormatAsTree ( int indentLevel ) : string

Usage Example

Ejemplo n.º 1
0
        private static void displayASTTransform(string patternText, BasePattern beforePattern, BasePattern afterPattern)
        {
            Console.WriteLine("Pattern Text:\n    {0}", patternText.ShowVerbatim());
            Console.WriteLine("Before Transform:");
            Console.WriteLine(beforePattern.FormatAsTree(1));
            Console.WriteLine("After Transform{0}:", afterPattern.Equals(beforePattern) ? " (unchanged)" : "");
            Console.WriteLine(afterPattern.FormatAsTree(1));

            Console.Write("\n");
        }