Skip to content

PositiveTechnologies/AspxParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages