Update README.md

This commit is contained in:
Ivan Kochurkin 2020-12-02 21:11:56 +03:00
parent ab7265958b
commit b09a185890
1 changed files with 9 additions and 12 deletions

View File

@ -2,15 +2,13 @@
### Note to historical users
Versions of ANTLR 4.4.x and before managed the C#
target as part of a [separate tool provided by Sam Harwell](https://github.com/tunnelvisionlabs/antlr4cs/releases/tag/v4.3.0).
Versions of ANTLR 4.4.x and before managed the C#
target as part of a [separate tool provided by Sam Harwell](https://github.com/tunnelvisionlabs/antlr4cs/releases/tag/v4.6.6).
As of 4.5, we our releasing a (mono-compatible) C# target together
with the main tool.
Mono compatibility makes it possible to use ANTLR 4 in any C# development
environment, including of course Microsoft Visual Studio, but also Xamarin Studio, which runs on MacOS X.
Given Microsoft's recent commitment to *cross-platform developer experiences*,
we believe this is a great opportunity for C# developers.
The current version is written using netstandard2.0 and netstandard2.1, it's possible
to use it on different platforms (Windows, MacOS X, Linux, and other).
Releasing the runtime with the tool ensures that you can get the exact same behavior across many languages: Java, C#, Python, JavaScript, Go, Swift and C++.
@ -59,22 +57,21 @@ Use the GUI or the following command in the Package Manager Console:
Install-Package Antlr4.Runtime.Standard
```
### Step 6: You're done!
Of course, the generated code is not going to meet your requirement by magic.
There are 3 ways to use the generated code:
- by generating a parse tree, and traversing it using a listener. This is the most common method.
- by generating a parse tree, and traversing it using a visitor. This requires the -visitor option, and is a bit more work.
- by providing code within your grammar, which gets executed when your input files are parsed.
- by generating a parse tree, and traversing it using a visitor. This requires the `-visitor` option, and is a bit more work.
- by providing code within your grammar, which gets executed when your input files are parsed.
While the latter works, it is no longer the recommended approach, because it is not portable, and harder to maintain. More importantly, it breaks the parsing when your code breaks.
See the web site for examples of using the generated code.
To learn more about ANTLR 4, read [the book](http://a.co/2n4rJlb).
### Visual Studio integration
If you require tighter Visual Studio integration, you can use the tools from [Tunnel Vision Labs](http://tunnelvisionlabs.com/).
If you require tighter Visual Studio integration, you can use the tools from [Tunnel Vision Labs](http://tunnelvisionlabs.com/).
(please note however that they use a different tool and runtime)