Aspx files (aspx, ascx, etc.) parser.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
AspxParser Append an outer additional props Sep 12, 2018
.gitignore Initial commit to GitHub. Feb 15, 2017
AspxParser.sln
AspxParser.snk Initial commit to GitHub. Feb 15, 2017
LICENSE Initial commit to GitHub. Feb 15, 2017
README.md Removed duplicated info. Feb 16, 2017

README.md

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.