Skip to content

Commit

Permalink
Merge pull request #2311 from alecont/master
Browse files Browse the repository at this point in the history
Updated csharp-target doc
  • Loading branch information
parrt authored Jul 24, 2018
2 parents 400f4bd + 04f6924 commit 4f75699
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ YYYY/MM/DD, github id, Full name, email
2017/12/20, kbsletten, Kyle Sletten, kbsletten@gmail.com
2017/12/27, jkmar, Jakub Marciniszyn, marciniszyn.jk@gmail.com
2018/02/11, io7m, Mark Raynsford, code@io7m.com
2018/05/15, johnvanderholt, jan dillingh johnvanderholte@gmail.com
2018/15/05, johnvanderholt, jan dillingh johnvanderholte@gmail.com
2018/05/23, srvance, Stephen Vance, steve@vance.com
2018/06/14, alecont, Alessandro Contenti, alecontenti@hotmail.com
2018/05/15, johnvanderholt, jan dillingh johnvanderholte@gmail.com
2018/06/16, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com
5 changes: 3 additions & 2 deletions doc/csharp-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You will find full instructions on the [Git repo page for ANTLR C# runtime](http

Let's suppose that your grammar is named `MyGrammar`. The tool will generate for you the following files:

* MyGrammarLexer.cs
* MyGrammarLexer.cs
* MyGrammarParser.cs
* MyGrammarListener.cs (if you have not activated the -no-listener option)
* MyGrammarBaseListener.cs (if you have not activated the -no-listener option)
Expand All @@ -32,14 +32,15 @@ Now a fully functioning code might look like the following for start rule `Start

```
using Antlr4.Runtime;
using Antlr4.Runtime.Tree;
public void MyParseMethod() {
String input = "your text to parse here";
ICharStream stream = CharStreams.fromstring(input);
ITokenSource lexer = new MyGrammarLexer(stream);
ITokenStream tokens = new CommonTokenStream(lexer);
MyGrammarParser parser = new MyGrammarParser(tokens);
parser.buildParseTrees = true;
parser.BuildParseTree = true;
IParseTree tree = parser.StartRule();
}
```
Expand Down

0 comments on commit 4f75699

Please sign in to comment.