[antlr-interest] ANTLR under CScarp

Johannes Luber jaluber at gmx.de
Mon Feb 25 03:38:11 PST 2008


thomas.molthahn at wago.com schrieb:
>  Hi,
> 
>  I'm currently writting my exam about a compiler for a simple script
>  language.
>  However, I am programming the compiler surface (like a rich test box
>  with some functions) based on C# (Microsoft Visual Studio 2005)
>  and .NET 2.0 (or .NET x.x).
> 
>  Now I was wondering if there is any ANTLR DLL I can refer to,
>  making ANTLR work in the C# development inviroment.
> 
>  "So that I just can take the text of the rich text box, run ANTLR
>  (parse it through) and get a error output back".

That doesn't work quite that. Compilers use a driver program (in your 
case the rich box program) which takes the input and feeds it into a 
lexer, which in turn feeds the parser, which in turn possibly feeds the 
tree parser. The lexer, parser and possibly tree parser are generated 
from ANTLR grammars. There are a few assemblies included in the ANTLR 
distribution, under the runtime path for CSharp. Reference them as 
necessary.

Johannes


More information about the antlr-interest mailing list