且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我们什么时候使用ANTLR

更新时间:2022-11-24 13:47:51

您会,如果您解析需要这些dll的使用ANTLR语法在运行时的任何文字。

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

通常有两个步骤。

1)运行Java ANTLR解析器在你.G文件生成一个C#词法分析器,C#语法和可能的C#树步行者。

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

2)建立这些文件到您的应用程序。这些文件将与antlr.runtime DLL,或者如果你使用ANTLR版本3 antlr3.runtime DLL一起工作。

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.

您C#程序现在可以解析文本文件使用您在步骤1编译语法。

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