Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Johannes Luber (Maintainer)
jaluber AT gmx.de

Kunle Odutola
kunle UNDERSCORE odutola AT hotmail.com

Micheal Jordan

Contents

...

If you want to setup and start using ANTLR with C# as quickly as possible please see the FAQ page on using ANTLR, ANTLRWorks, and CC#.

However this current page (not the FAQ page) provides architectural and background information useful to understanding the workings and usage of ANTLR and C#.

...

For an example grammar named MyGrammar, the following table list the files that would be generated by ANTLR 3.1+ using the CSharp2 (and CSharp) target.

Panel
bgColor#FFFFFF
borderStylenone
titleMyGrammar.gborderStylenone
Code Block
grammar MyGrammar;

options
{
    language=CSharp2;
}
// rest of grammar follows
....
Panel
bgColor#FFFFFF
borderStylenone

MyGrammarLexer.cs
MyGrammarParser.cs

 

Panel
bgColor#FFFFFF
borderStylenone
titleMyGrammar.gborderStylenone
Code Block
lexer grammar MyGrammar;

options
{
    language=CSharp2;
}
// rest of grammar follows
....
Panel
bgColor#FFFFFF
borderStylenone

MyGrammar.cs

Under ANLTR 3.0.x:
MyGrammarLexer.cs

Panel
bgColor#FFFFFF
borderStylenone
titleMyGrammar.g
borderStylenone
Code Block
parser grammar MyGrammar;

options
{
    language=CSharp2;
}
// rest of grammar follows
....
Panel
bgColor#FFFFFF
borderStylenone

MyGrammar.cs

Under ANLTR 3.0.x:
MyGrammarParser.cs

Panel
bgColor#FFFFFF
borderStylenone
titleMyGrammar.gborderStylenone
Code Block
tree grammar MyGrammar;

options
{
    language=CSharp2;
}
// rest of grammar follows
....
Panel
bgColor#FFFFFF
borderStylenone

MyGrammar.cs

 

...