OronDF343 / AspxParser

Aspx files (aspx, ascx, etc.) parser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage

Source Code Parsing

Use AspxParser:

var parser = new AspxParser(rootDirectory);
var source = new AspxSource(fileName, fileCode);
AspxParseResult aspxTree = parser.Parse(source);

Result AspxParseResult contains a reference to a parse tree RootNode and to a list with parse errors ParserErrors.

Parse Tree Bypass

Use DepthFirstAspxVisitor or DepthFirstAspxWithoutCloseTagVisitor visitors:

public AspxToCsConverter : DepthFirstAspxWithoutCloseTagVisitor<string>
{
    public override string Visit(AspxNode.Root node)
    {
        ...
    }

    public override string Visit(AspxNode.HtmlTag node)
    {
        ...
    }
}

var converter = new AspxToCsConverter();
var result = aspxTree.Root.Accept(converter);

Licence

AspxParser is licensed under the MIT License.

About

Aspx files (aspx, ascx, etc.) parser.

License:MIT License


Languages

Language:C# 100.0%