Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

JavascriptparserforCsyntax

Is there any simple ready-to-use JS-parser (node.js) of C# syntax?

The only choice I found so far is ANTLR4, but it requires Java to build JS-parser, has very complicated API and finally I wasn't able to successfully build JS-parser with it. It generated JS-files with incorrect syntax.

In specific. I have a bunch of files of C# source files.

let src = {
    'file1.cs': 'src...',
    'file2.cs': 'src...'
};

I need something like

let parser = require('magic-csharp-parser');
for (let fileName in src) {
    let ast = parser.parse(src[fileName]); // traversable syntax tree
}

Comments