Parsing .aspx and .ascx files to use in a VSCode Prettier Plugin

504 views Asked by At

I've searched with no luck to find a parser for .aspx and .ascx files that could be used to create a VSCode formatting plugin using the Prettier extension.

I've resorted to creating my own parser from scratch, which I have mostly done successfully but I have reached a point where the edge cases are causing the complexity to be difficult to manage.

I am using the Parser Generator called Jison https://github.com/zaach/jison

I am wondering if I am overcomplicating this issue and if it is possible to combine two parsers to return the Abstract Syntax Tree necessary to format the Grammar using Prettier. Does anyone know of a good way to achieve this? I am new to the concept of parsing so this may be simpler than I am making it out to be.

I need to be able to support all valid HTML with embedded C# (deliminated by tags such as <%, <%=, <%@, <%#). As well as Javascript that also has embedded C#, and Jquery.

Any help or idea is greatly appreciated.

I can include my code if needed for reference but I am looking more for ideas than specific code help.

0

There are 0 answers