Skip to content

Commit

Permalink
Merge branch 'dev' into fix-dependabot-warnings
Browse files Browse the repository at this point in the history
Signed-off-by: ericvergnaud <eric.vergnaud@wanadoo.fr>
  • Loading branch information
ericvergnaud authored Sep 4, 2023
2 parents aa40c19 + 1a96b1c commit 5a7b4d4
Show file tree
Hide file tree
Showing 215 changed files with 2,404 additions and 15,352 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ jobs:
javascript,
typescript,
php,
python2,
python3,
# swift,
]
Expand Down Expand Up @@ -233,13 +232,6 @@ jobs:
if: startswith(matrix.os, 'windows') && (matrix.target == 'cpp')
uses: microsoft/setup-msbuild@v1.1

- name: Set up Python 2
if: matrix.target == 'python2'
uses: actions/setup-python@v4
with:
python-version: '2.x'
architecture: 'x64'

- name: Set up Python 3
if: matrix.target == 'python3'
uses: actions/setup-python@v4
Expand All @@ -257,7 +249,7 @@ jobs:
if: matrix.target == 'csharp'
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '6.0.x'
dotnet-version: '7.0.x'

- name: Setup Dart 2.12.1
if: matrix.target == 'dart'
Expand Down Expand Up @@ -316,7 +308,6 @@ jobs:
cd runtime-testsuite
switch ("${{ matrix.target }}")
{
python2 { mvn -X '-Dantlr-python2-exec="${{ env.pythonLocation }}\python.exe"' '-Dtest=python2.**' test }
python3 { mvn -X '-Dantlr-python3-exec="${{ env.pythonLocation }}\python.exe"' '-Dtest=python3.**' test }
default { mvn -X '-Dtest=${{ matrix.target }}.**' test }
}
Expand All @@ -331,7 +322,6 @@ jobs:
cd runtime-testsuite
case ${{ matrix.target }} in
python2) mvn -X '-Dantlr-python2-exec=${{ env.pythonLocation }}/bin/python' '-Dtest=python2.**' test ;;
python3) mvn -X '-Dantlr-python3-exec=${{ env.pythonLocation }}/bin/python' '-Dtest=python3.**' test ;;
*) mvn -X '-Dtest=${{ matrix.target }}.**' test ;;
esac
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ runtime/Cpp/runtime/libantlr4-runtime.4.10.1.dylib
runtime/Cpp/runtime/libantlr4-runtime.a
runtime/Cpp/runtime/libantlr4-runtime.dylib
/runtime/Cpp/runtime/libantlr4-runtime.4.12.0.dylib
/runtime/Cpp/runtime/libantlr4-runtime.4.13.0.dylib

# Go test and performance trace files
**/*.pprof
4 changes: 4 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ let package = Package(
name: "Antlr4Static",
type: .static,
targets: ["Antlr4"]),
.library(
name: "Antlr4Dynamic",
type: .dynamic,
targets: ["Antlr4"]),
],
targets: [
.target(
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

## Versioning

ANTLR 4 supports 10 target languages, and ensuring consistency across these targets is a unique and highly valuable feature.
ANTLR 4 supports 10 target languages
(Cpp, CSharp, Dart, Java, JavaScript, PHP, Python3, Swift, TypeScript),
and ensuring consistency across these targets is a unique and highly valuable feature.
To ensure proper support of this feature, each release of ANTLR is a complete release of the tool and the 10 runtimes, all with the same version.
As such, ANTLR versioning does not strictly follow semver semantics:

Expand All @@ -38,11 +40,13 @@ The default branch for this repo is [`master`](https://github.com/antlr/antlr4/t

<img src="doc/images/new-antlr-branches.png" width="500">

Targets such as Go that pull directly from the repository can use the default `master` branch but can also pull from the active `dev` branch:
The Go target now has its own dedicated repo:

```bash
$ go get github.com/antlr/antlr4/runtime/Go/antlr@dev
$ go get github.com/antlr4-go/antlr
```
**Note**
The dedicated Go repo is for `go get` and `import` only. Go runtime development is still performed in the main `antlr/antlr4` repo.

## Authors and major contributors

Expand Down Expand Up @@ -73,7 +77,12 @@ ANTLR project lead and supreme dictator for life
* [Official site](http://www.antlr.org/)
* [Documentation](https://github.com/antlr/antlr4/blob/master/doc/index.md)
* [FAQ](https://github.com/antlr/antlr4/blob/master/doc/faq/index.md)
* [ANTLR code generation targets](https://github.com/antlr/antlr4/blob/master/doc/targets.md)<br>(Currently: Java, C#, Python2|3, JavaScript, Go, C++, Swift, Dart, PHP)
* [ANTLR code generation targets](https://github.com/antlr/antlr4/blob/master/doc/targets.md)<br>(Currently: Java, C#, Python3, JavaScript, Go, C++, Swift, Dart, PHP)
* _Note: As of version 4.14, we are dropping support for Python 2. We love the Python
community, but Python 2 support was officially halted in Jan 2020. More recently,
GiHub also dropped support for Python 2, which has made it impossible for us to
maintain a consistent level of quality across targets (we use GitHub for our CI).
Long live Python 3!_
* [Java API](http://www.antlr.org/api/Java/index.html)
* [ANTLR v3](http://www.antlr3.org/)
* [v3 to v4 Migration, differences](https://github.com/antlr/antlr4/blob/master/doc/faq/general.md)
Expand Down
2 changes: 1 addition & 1 deletion antlr4-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.12.1-SNAPSHOT</version>
<version>4.13.1-SNAPSHOT</version>
</parent>
<artifactId>antlr4-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion doc/IDEs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Integrating ANTLR into Development Systems

The Java target is the reference implementation mirrored by other targets. The following pages help you integrate ANTLR into development environments and build systems appropriate for your target language. As of December 2016, we have Java, C#, Python 2, Python 3, JavaScript, Go, C++, and Swift targets.
The Java target is the reference implementation mirrored by other targets. The following pages help you integrate ANTLR into development environments and build systems appropriate for your target language. As of December 2016, we have Java, C#, Python 3, JavaScript, Go, C++, and Swift targets.

The easiest thing is probably just to use an [ANTLR plug-in](http://www.antlr.org/tools.html) for your favorite development environment.
1 change: 0 additions & 1 deletion doc/antlr-project-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ In order to perform the tests on all target languages, the following tools shoul

* dotnet
* Node.js
* Python 2
* Python 3
* Go
* Swift
Expand Down
1 change: 0 additions & 1 deletion doc/csharp-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public void MyParseMethod() {
ITokenSource lexer = new MyGrammarLexer(stream);
ITokenStream tokens = new CommonTokenStream(lexer);
MyGrammarParser parser = new MyGrammarParser(tokens);
parser.BuildParseTree = true;
IParseTree tree = parser.StartRule();
}
```
Expand Down
1 change: 0 additions & 1 deletion doc/dart-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ void main(List<String> args) async {
final tokens = CommonTokenStream(lexer);
final parser = JSONParser(tokens);
parser.addErrorListener(DiagnosticErrorListener());
parser.buildParseTree = true;
final tree = parser.json();
ParseTreeWalker.DEFAULT.walk(TreeShapeListener(), tree);
}
Expand Down
32 changes: 16 additions & 16 deletions doc/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ That command creates `antlr4` and `antlr4-parse` executables that, if necessary,

```bash
$ antlr4
Downloading antlr4-4.12.0-complete.jar
Downloading antlr4-4.13.0-complete.jar
ANTLR tool needs Java to run; install Java JRE 11 yes/no (default yes)? y
Installed Java in /Users/parrt/.jre/jdk-11.0.15+10-jre; remove that dir to uninstall
ANTLR Parser Generator Version 4.12.0
ANTLR Parser Generator Version 4.13.0
-o ___ specify output directory where all output is generated
-lib ___ specify location of grammars, tokens files
...
Expand All @@ -44,7 +44,7 @@ On Windows, the `pip` command doesn't just work---you need to add the `...\local

1. Go to the Microsoft Store
2. Search in Microsoft Store for Python
3. Select the newest version of Python (3.10).
3. Select the newest version of Python (3.11).
4. Click the "Get" button. Store installs python and pip at "c:\Users...\AppData\Local\Microsoft\WindowsApps\python.exe" and "c:\Users...\AppData\Local\Microsoft\WindowsApps\pip.exe", respectively. And, it updates the search path immediately with the install.
5. Open a "cmd" terminal.
6. You can now type "python" and "pip", and "pip install antlr4-tools". 7. Unfortunately, it does not add that to the search path.
Expand Down Expand Up @@ -130,7 +130,7 @@ ExprBaseListener.h ExprLexer.h ExprListener.h ExprParser.h

ANTLR is really two things: a tool written in Java that translates your grammar to a parser/lexer in Java (or other target language) and the runtime library needed by the generated parsers/lexers. Even if you are using the ANTLR Intellij plug-in or ANTLRWorks to run the ANTLR tool, the generated code will still need the runtime library.

The first thing you should do is probably download and install a development tool plug-in. Even if you only use such tools for editing, they are great. Then, follow the instructions below to get the runtime environment available to your system to run generated parsers/lexers. In what follows, I talk about antlr-4.12.0-complete.jar, which has the tool and the runtime and any other support libraries (e.g., ANTLR v4 is written in v3).
The first thing you should do is probably download and install a development tool plug-in. Even if you only use such tools for editing, they are great. Then, follow the instructions below to get the runtime environment available to your system to run generated parsers/lexers. In what follows, I talk about antlr-4.13.0-complete.jar, which has the tool and the runtime and any other support libraries (e.g., ANTLR v4 is written in v3).

If you are going to integrate ANTLR into your existing build system using mvn, ant, or want to get ANTLR into your IDE such as eclipse or intellij, see [Integrating ANTLR into Development Systems](https://github.com/antlr/antlr4/blob/master/doc/IDEs.md).

Expand All @@ -140,38 +140,38 @@ If you are going to integrate ANTLR into your existing build system using mvn, a
1. Download
```
$ cd /usr/local/lib
$ curl -O https://www.antlr.org/download/antlr-4.12.0-complete.jar
$ curl -O https://www.antlr.org/download/antlr-4.13.0-complete.jar
```
Or just download in browser from website:
[https://www.antlr.org/download.html](https://www.antlr.org/download.html)
and put it somewhere rational like `/usr/local/lib`.

if you are using lower version jdk, just download from [website download](https://github.com/antlr/website-antlr4/tree/gh-pages/download) for previous version, and antlr version before 4.12.0 support jdk 1.8
if you are using lower version jdk, just download from [website download](https://github.com/antlr/website-antlr4/tree/gh-pages/download) for previous version, and antlr version before 4.13.0 support jdk 1.8

2. Add `antlr-4.12.0-complete.jar` to your `CLASSPATH`:
2. Add `antlr-4.13.0-complete.jar` to your `CLASSPATH`:
```
$ export CLASSPATH=".:/usr/local/lib/antlr-4.12.0-complete.jar:$CLASSPATH"
$ export CLASSPATH=".:/usr/local/lib/antlr-4.13.0-complete.jar:$CLASSPATH"
```
It's also a good idea to put this in your `.bash_profile` or whatever your startup script is.

3. Create aliases for the ANTLR Tool, and `TestRig`.
```
$ alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.12.0-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.12.0-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig'
$ alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.13.0-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.13.0-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig'
```

### WINDOWS

(*Thanks to Graham Wideman*)

0. Install Java (version 1.7 or higher)
1. Download antlr-4.12.0-complete.jar (or whatever version) from [https://www.antlr.org/download.html](https://www.antlr.org/download.html)
1. Download antlr-4.13.0-complete.jar (or whatever version) from [https://www.antlr.org/download.html](https://www.antlr.org/download.html)
Save to your directory for 3rd party Java libraries, say `C:\Javalib`
2. Add `antlr-4.12.0-complete.jar` to CLASSPATH, either:
2. Add `antlr-4.13.0-complete.jar` to CLASSPATH, either:
* Permanently: Using System Properties dialog > Environment variables > Create or append to `CLASSPATH` variable
* Temporarily, at command line:
```
SET CLASSPATH=.;C:\Javalib\antlr-4.12.0-complete.jar;%CLASSPATH%
SET CLASSPATH=.;C:\Javalib\antlr-4.13.0-complete.jar;%CLASSPATH%
```
3. Create short convenient commands for the ANTLR Tool, and TestRig, using batch files or doskey commands:
* Batch files (in directory in system PATH) antlr4.bat and grun.bat
Expand All @@ -197,7 +197,7 @@ Either launch org.antlr.v4.Tool directly:

```
$ java org.antlr.v4.Tool
ANTLR Parser Generator Version 4.12.0
ANTLR Parser Generator Version 4.13.0
-o ___ specify output directory where all output is generated
-lib ___ specify location of .tokens files
...
Expand All @@ -206,8 +206,8 @@ ANTLR Parser Generator Version 4.12.0
or use -jar option on java:

```
$ java -jar /usr/local/lib/antlr-4.12.0-complete.jar
ANTLR Parser Generator Version 4.12.0
$ java -jar /usr/local/lib/antlr-4.13.0-complete.jar
ANTLR Parser Generator Version 4.13.0
-o ___ specify output directory where all output is generated
-lib ___ specify location of .tokens files
...
Expand Down
Loading

0 comments on commit 5a7b4d4

Please sign in to comment.