Alex Rivera | Logout

When do we use ANTLR

Asked 2011-08-24T14:56:13.043
32

Can anyone please guide me the purpose of using ANTLR dlls in a ASP.Net, C# project.

I just noticed antlr.runtime, Antlr3.Runtime, Antlr3.Utlility assemblies being referenced in some project.

Will be great if can cite some real world examples or any link to a web page will be useful.

Edit
Report

1 Answer

3

You would need these dll's if you are parsing any text at runtime using an antlr grammar.

Typically there are two steps.

1) run the java antlr parser over your .g files to generate a C# lexer, C# grammar and possibly C# tree walkers.

2) Build those files into your application. Those files will work in conjunction with the antlr.runtime dll, or antlr3.runtime dll if you're using ANTLR version 3.

Your C# program can now parse text files using the grammar that you compiled in step 1.

answered 2011-08-24T20:31:52.910

Your Answer