diff --git a/contributors.txt b/contributors.txt index 54ff875dc..d081c5482 100644 --- a/contributors.txt +++ b/contributors.txt @@ -215,3 +215,4 @@ YYYY/MM/DD, github id, Full name, email 2019/02/06, ralucado, Cristina Raluca Vijulie, ralucris.v[at]gmail[dot]com 2019/03/13, base698, Justin Thomas, justin.thomas1@gmail.com 2019/03/18, carlodri, Carlo Dri, carlo.dri@gmail.com +2019/05/02, askingalot, Andy Collins, askingalot@gmail.com diff --git a/doc/csharp-target.md b/doc/csharp-target.md index 40be51840..a869a82f6 100644 --- a/doc/csharp-target.md +++ b/doc/csharp-target.md @@ -30,7 +30,7 @@ Let's suppose that your grammar is named `MyGrammar`. The tool will generate for Now a fully functioning code might look like the following for start rule `StartRule`: -``` +```csharp using Antlr4.Runtime; using Antlr4.Runtime.Tree; @@ -59,7 +59,7 @@ Let's suppose your MyGrammar grammar comprises 2 rules: "key" and "value". The antlr4 tool will have generated the following listener (only partial code shown here): -``` +```csharp interface IMyGrammarParserListener : IParseTreeListener { void EnterKey (MyGrammarParser.KeyContext context); void ExitKey (MyGrammarParser.KeyContext context); @@ -70,7 +70,7 @@ interface IMyGrammarParserListener : IParseTreeListener { In order to provide custom behavior, you might want to create the following class: -``` +```csharp class KeyPrinter : MyGrammarBaseListener { // override default listener behavior void ExitKey (MyGrammarParser.KeyContext context) { @@ -82,7 +82,7 @@ class KeyPrinter : MyGrammarBaseListener { In order to execute this listener, you would simply add the following lines to the above code: -``` +```csharp ... IParseTree tree = parser.StartRule() - only repeated here for reference KeyPrinter printer = new KeyPrinter();