Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated csharp-target doc #2311

Merged
merged 3 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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