diff --git a/doc/getting-started.md b/doc/getting-started.md index 02f5b39d05..30fe070efd 100644 --- a/doc/getting-started.md +++ b/doc/getting-started.md @@ -6,7 +6,7 @@ Hi and welcome to the version 4 release of ANTLR! It's named after the fearless ANTLR is really two things: a tool that translates your grammar to a parser/lexer in Java (or other target language) and the runtime 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.10-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.10.1-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). @@ -16,22 +16,22 @@ 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.10-complete.jar +$ curl -O https://www.antlr.org/download/antlr-4.10.1-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`. -2. Add `antlr-4.10-complete.jar` to your `CLASSPATH`: +2. Add `antlr-4.10.1-complete.jar` to your `CLASSPATH`: ``` -$ export CLASSPATH=".:/usr/local/lib/antlr-4.10-complete.jar:$CLASSPATH" +$ export CLASSPATH=".:/usr/local/lib/antlr-4.10.1-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.10-complete.jar:$CLASSPATH" org.antlr.v4.Tool' -$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.10-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig' +$ alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.10.1-complete.jar:$CLASSPATH" org.antlr.v4.Tool' +$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.10.1-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig' ``` ### WINDOWS @@ -39,13 +39,13 @@ $ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.10-complete.jar:$CLASSPA (*Thanks to Graham Wideman*) 0. Install Java (version 1.7 or higher) -1. Download antlr-4.10-complete.jar (or whatever version) from [https://www.antlr.org/download/](https://www.antlr.org/download/) +1. Download antlr-4.10.1-complete.jar (or whatever version) from [https://www.antlr.org/download/](https://www.antlr.org/download/) Save to your directory for 3rd party Java libraries, say `C:\Javalib` -2. Add `antlr-4.10-complete.jar` to CLASSPATH, either: +2. Add `antlr-4.10.1-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.10-complete.jar;%CLASSPATH% +SET CLASSPATH=.;C:\Javalib\antlr-4.10.1-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 @@ -71,7 +71,7 @@ Either launch org.antlr.v4.Tool directly: ``` $ java org.antlr.v4.Tool -ANTLR Parser Generator Version 4.10 +ANTLR Parser Generator Version 4.10.1 -o ___ specify output directory where all output is generated -lib ___ specify location of .tokens files ... @@ -80,8 +80,8 @@ ANTLR Parser Generator Version 4.10 or use -jar option on java: ``` -$ java -jar /usr/local/lib/antlr-4.10-complete.jar -ANTLR Parser Generator Version 4.10 +$ java -jar /usr/local/lib/antlr-4.10.1-complete.jar +ANTLR Parser Generator Version 4.10.1 -o ___ specify output directory where all output is generated -lib ___ specify location of .tokens files ... diff --git a/doc/releasing-antlr.md b/doc/releasing-antlr.md index cff0cf4852..39143434a0 100644 --- a/doc/releasing-antlr.md +++ b/doc/releasing-antlr.md @@ -14,7 +14,7 @@ git merge dev ### Turn on DCO Enforcement -As of 4.10, we will be using the Linux DCO not the previous contributors license agreement that required signing the file. Now, we use the DCO and contributors must use `-s` on each commit to the branch associated with a pull request. +As of 4.10.1, we will be using the Linux DCO not the previous contributors license agreement that required signing the file. Now, we use the DCO and contributors must use `-s` on each commit to the branch associated with a pull request. See [GitHub App DCO](https://github.com/apps/dco). @@ -25,14 +25,14 @@ Make sure this feature is turned on for the `antlr4` repo upon release. Wack any existing tag as mvn will create one and it fails if already there. ``` -$ git tag -d 4.10 -$ git push origin :refs/tags/4.10 -$ git push upstream :refs/tags/4.10 +$ git tag -d 4.10.1 +$ git push origin :refs/tags/4.10.1 +$ git push upstream :refs/tags/4.10.1 ``` ### Go release tags -It seems that [Go needs a `v` in the release git tag](https://go.dev/ref/mod#glos-version) so make sure that we double up with 4.10 and v4.10. +It seems that [Go needs a `v` in the release git tag](https://go.dev/ref/mod#glos-version) so make sure that we double up with 4.10.1 and v4.10.1. ## Bump version in code and other files @@ -40,11 +40,11 @@ It seems that [Go needs a `v` in the release git tag](https://go.dev/ref/mod#glo There are a number of files that require inversion number be updated. -(In a `pred-4.10` branch) Here is a simple script to display any line from the critical files with, say, `4.10` in it. Here's an example run of the script: +(In a `pred-4.10.1` branch) Here is a simple script to display any line from the critical files with, say, `4.10.1` in it. Here's an example run of the script: ```bash -~/antlr/code/antlr4 $ python scripts/update_antlr_version.py 4.9.3 4.10 -Updating ANTLR version from 4.9.3 to 4.10 +~/antlr/code/antlr4 $ python scripts/update_antlr_version.py 4.9.3 4.10.1 +Updating ANTLR version from 4.9.3 to 4.10.1 Set ANTLR repo root (default ~/antlr/code/antlr4): Perform antlr4 `mvn clean` and wipe build dirs Y/N? (default no): Ok, not cleaning antlr4 dir @@ -63,7 +63,7 @@ Commit to repository. ### PHP runtime -We only have to copy the PHP runtime into the ANTLR repository to run the unittests. But, we still need to bump the version to 4.10 in `~/antlr/code/antlr-php-runtime/src/RuntimeMetaData.php` in the separate repository, commit, and push. +We only have to copy the PHP runtime into the ANTLR repository to run the unittests. But, we still need to bump the version to 4.10.1 in `~/antlr/code/antlr-php-runtime/src/RuntimeMetaData.php` in the separate repository, commit, and push. ``` cd ~/antlr/code/antlr-php-runtime/src @@ -74,19 +74,19 @@ git commit -a -m "Update PHP Runtime to latest version" ## Build XPath parsers -This section addresses a [circular dependency regarding XPath](https://github.com/antlr/antlr4/issues/3600). In the java target I avoided a circular dependency (gen 4.10 parser for XPath using 4.10 which needs it to build) by hand building the parser: runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPath.java. Probably we won't have to rerun this for the patch releases, just major ones that alter the ATN serialization. +This section addresses a [circular dependency regarding XPath](https://github.com/antlr/antlr4/issues/3600). In the java target I avoided a circular dependency (gen 4.10.1 parser for XPath using 4.10.1 which needs it to build) by hand building the parser: runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPath.java. Probably we won't have to rerun this for the patch releases, just major ones that alter the ATN serialization. ``` cd ~/antlr/code/antlr4/runtime/CSharp/src/Tree/Xpath -java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.10-SNAPSHOT/antlr4-4.10-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=CSharp XPathLexer.g4 +java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.10.1-SNAPSHOT/antlr4-4.10.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=CSharp XPathLexer.g4 cd ~/antlr/code/antlr4/runtime/Python3/tests/expr -java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.10-SNAPSHOT/antlr4-4.10-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python2 Expr.g4 -java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.10-SNAPSHOT/antlr4-4.10-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python2 XPathLexer.g4 +java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.10.1-SNAPSHOT/antlr4-4.10.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python2 Expr.g4 +java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.10.1-SNAPSHOT/antlr4-4.10.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python2 XPathLexer.g4 cd ~/antlr/code/antlr4/runtime/Python3/tests/expr -java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.10-SNAPSHOT/antlr4-4.10-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 Expr.g4 -java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.10-SNAPSHOT/antlr4-4.10-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 XPathLexer.g4 +java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.10.1-SNAPSHOT/antlr4-4.10.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 Expr.g4 +java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.10.1-SNAPSHOT/antlr4-4.10.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 XPathLexer.g4 ``` ## Maven Repository Settings @@ -136,7 +136,7 @@ Here is the file template ## Maven deploy snapshot -The goal is to get a snapshot, such as `4.10-SNAPSHOT`, to the staging server: [antlr4 tool](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4/4.10-SNAPSHOT/) and [antlr4 java runtime](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-runtime/4.10-SNAPSHOT/). +The goal is to get a snapshot, such as `4.10.1-SNAPSHOT`, to the staging server: [antlr4 tool](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4/4.10.1-SNAPSHOT/) and [antlr4 java runtime](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-runtime/4.10.1-SNAPSHOT/). Do this: @@ -145,15 +145,15 @@ $ mvn install -DskipTests # seems required to get the jar files visible to mave $ mvn deploy -DskipTests ... [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ antlr4-tool-testsuite --- -Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10-SNAPSHOT/maven-metadata.xml -Uploading: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10-SNAPSHOT/antlr4-tool-testsuite-4.10-20161211.173752-1.jar -Uploaded: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10-SNAPSHOT/antlr4-tool-testsuite-4.10-20161211.173752-1.jar (3 KB at 3.4 KB/sec) -Uploading: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10-SNAPSHOT/antlr4-tool-testsuite-4.10-20161211.173752-1.pom -Uploaded: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10-SNAPSHOT/antlr4-tool-testsuite-4.10-20161211.173752-1.pom (3 KB at 6.5 KB/sec) +Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10.1-SNAPSHOT/maven-metadata.xml +Uploading: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10.1-SNAPSHOT/antlr4-tool-testsuite-4.10.1-20161211.173752-1.jar +Uploaded: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10.1-SNAPSHOT/antlr4-tool-testsuite-4.10.1-20161211.173752-1.jar (3 KB at 3.4 KB/sec) +Uploading: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10.1-SNAPSHOT/antlr4-tool-testsuite-4.10.1-20161211.173752-1.pom +Uploaded: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10.1-SNAPSHOT/antlr4-tool-testsuite-4.10.1-20161211.173752-1.pom (3 KB at 6.5 KB/sec) Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/maven-metadata.xml Downloaded: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/maven-metadata.xml (371 B at 1.4 KB/sec) -Uploading: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10-SNAPSHOT/maven-metadata.xml -Uploaded: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10-SNAPSHOT/maven-metadata.xml (774 B at 1.8 KB/sec) +Uploading: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10.1-SNAPSHOT/maven-metadata.xml +Uploaded: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/4.10.1-SNAPSHOT/maven-metadata.xml (774 B at 1.8 KB/sec) Uploading: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/maven-metadata.xml Uploaded: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-tool-testsuite/maven-metadata.xml (388 B at 0.9 KB/sec) [INFO] ------------------------------------------------------------------------ @@ -206,22 +206,29 @@ You should see 0x37 in generated .class files after 0xCAFEBABE; see [Java SE 11 ^^ ``` +Also verify run time is 1.8: + +```bash +od -h runtime/Java/target/classes/org/antlr/v4/runtime/Token.class | head -1 +0000000 feca beba 0000 3400 2500 0007 0722 2300 +``` + It will start out by asking you the version number: ``` ... -What is the release version for "ANTLR 4"? (org.antlr:antlr4-master) 4.10: : 4.10 -What is the release version for "ANTLR 4 Runtime"? (org.antlr:antlr4-runtime) 4.10: : -What is the release version for "ANTLR 4 Tool"? (org.antlr:antlr4) 4.10: : -What is the release version for "ANTLR 4 Maven plugin"? (org.antlr:antlr4-maven-plugin) 4.10: : -What is the release version for "ANTLR 4 Runtime Test Generator"? (org.antlr:antlr4-runtime-testsuite) 4.10: : -What is the release version for "ANTLR 4 Tool Tests"? (org.antlr:antlr4-tool-testsuite) 4.10: : -What is SCM release tag or label for "ANTLR 4"? (org.antlr:antlr4-master) antlr4-master-4.10: : 4.10 -What is the new development version for "ANTLR 4"? (org.antlr:antlr4-master) 4.10.1-SNAPSHOT: +What is the release version for "ANTLR 4"? (org.antlr:antlr4-master) 4.10.1: : 4.10.1 +What is the release version for "ANTLR 4 Runtime"? (org.antlr:antlr4-runtime) 4.10.1: : +What is the release version for "ANTLR 4 Tool"? (org.antlr:antlr4) 4.10.1: : +What is the release version for "ANTLR 4 Maven plugin"? (org.antlr:antlr4-maven-plugin) 4.10.1: : +What is the release version for "ANTLR 4 Runtime Test Generator"? (org.antlr:antlr4-runtime-testsuite) 4.10.1: : +What is the release version for "ANTLR 4 Tool Tests"? (org.antlr:antlr4-tool-testsuite) 4.10.1: : +What is SCM release tag or label for "ANTLR 4"? (org.antlr:antlr4-master) antlr4-master-4.10.1: : 4.10.1 +What is the new development version for "ANTLR 4"? (org.antlr:antlr4-master) 4.10.2-SNAPSHOT: ... ``` -Maven will go through your pom.xml files to update versions from 4.10-SNAPSHOT to 4.10 for release and then to 4.10.1-SNAPSHOT after release, which is done with: +Maven will go through your pom.xml files to update versions from 4.10.1-SNAPSHOT to 4.10.1 for release and then to 4.10.2-SNAPSHOT after release, which is done with: ```bash mvn release:perform -Darguments="-DskipTests" @@ -235,7 +242,7 @@ Now, go here: and on the left click "Staging Repositories". You click the staging repo and close it, then you refresh, click it and release it. It's done when you see it here: -    [https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.10/antlr4-runtime-4.10.jar](https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.10/antlr4-runtime-4.10.jar) +    [https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.10.1/antlr4-runtime-4.10.1.jar](https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.10.1/antlr4-runtime-4.10.1.jar) All releases should be here: [https://repo1.maven.org/maven2/org/antlr/antlr4-runtime](https://repo1.maven.org/maven2/org/antlr/antlr4-runtime). @@ -258,7 +265,7 @@ Move (and zip) target to website: ```bash cd src -zip -r ~/antlr/sites/website-antlr4/download/antlr-javascript-runtime-4.10.zip . +zip -r ~/antlr/sites/website-antlr4/download/antlr-javascript-runtime-4.10.1.zip . ``` ### CSharp @@ -288,7 +295,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. Determining projects to restore... Restored /Users/parrt/antlr/code/antlr4/runtime/CSharp/src/Antlr4.csproj (in 340 ms). Antlr4 -> /Users/parrt/antlr/code/antlr4/runtime/CSharp/src/bin/Release/netstandard2.0/Antlr4.Runtime.Standard.dll - Successfully created package '/Users/parrt/antlr/code/antlr4/runtime/CSharp/src/bin/Release/Antlr4.Runtime.Standard.4.10.0.nupkg'. + Successfully created package '/Users/parrt/antlr/code/antlr4/runtime/CSharp/src/bin/Release/Antlr4.Runtime.Standard.4.10.1.0.nupkg'. Build succeeded. 0 Warning(s) @@ -309,7 +316,7 @@ Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD license Assembly bin/Release/netstandard2.0/Antlr4.Runtime.Standard.dll is strongnamed. $ tree /Users/parrt/antlr/code/antlr4/runtime/CSharp/src/bin/Release/ /Users/parrt/antlr/code/antlr4/runtime/CSharp/src/bin/Release/ -├── Antlr4.Runtime.Standard.4.10.0.nupkg +├── Antlr4.Runtime.Standard.4.10.1.0.nupkg └── netstandard2.0 ├── Antlr4.Runtime.Standard.deps.json ├── Antlr4.Runtime.Standard.dll @@ -393,7 +400,7 @@ On a Mac (with XCode 7+ installed): ```bash cd runtime/Cpp ./deploy-macos.sh -cp antlr4-cpp-runtime-macos.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.10-macos.zip +cp antlr4-cpp-runtime-macos.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.10.1-macos.zip ``` On any Mac or Linux machine: @@ -401,7 +408,7 @@ On any Mac or Linux machine: ```bash cd runtime/Cpp ./deploy-source.sh -cp antlr4-cpp-runtime-source.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.10-source.zip +cp antlr4-cpp-runtime-source.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.10.1-source.zip ``` On a Windows machine the build scripts checks if VS 2017 and/or VS 2019 are installed and builds binaries for each, if found. This script requires 7z to be installed (http://7-zip.org then do `set PATH=%PATH%;C:\Program Files\7-Zip\` from DOS not powershell). @@ -409,16 +416,16 @@ On a Windows machine the build scripts checks if VS 2017 and/or VS 2019 are inst ```bash cd runtime/Cpp deploy-windows.cmd Community -cp antlr4-cpp-runtime-vs2019.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.10-vs2019.zip +cp antlr4-cpp-runtime-vs2019.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.10.1-vs2019.zip ``` Move target to website (**_rename to a specific ANTLR version first if needed_**): ```bash pushd ~/antlr/sites/website-antlr4/download -git add antlr4-cpp-runtime-4.10-macos.zip -git add antlr4-cpp-runtime-4.10-windows.zip -git add antlr4-cpp-runtime-4.10-source.zip +git add antlr4-cpp-runtime-4.10.1-macos.zip +git add antlr4-cpp-runtime-4.10.1-windows.zip +git add antlr4-cpp-runtime-4.10.1-source.zip git commit -a -m 'update C++ runtime' git push origin gh-pages popd @@ -450,7 +457,7 @@ mvn -DskipTests javadoc:jar -q install # get lots of errors but works Jars are in: ``` -~/.m2/repository/org/antlr/antlr4-runtime/4.10/antlr4-runtime-4.10 +~/.m2/repository/org/antlr/antlr4-runtime/4.10.1/antlr4-runtime-4.10.1 ``` ### Update version and copy jars / api @@ -459,36 +466,36 @@ Copy javadoc and java jars to website using this script: ```bash cd ~/antlr/code/antlr4 -python scripts/deploy_to_website.py 4.9.3 4.10 +python scripts/deploy_to_website.py 4.9.3 4.10.1 ``` Output: ```bash -Updating ANTLR version from 4.9.3 to 4.10 +Updating ANTLR version from 4.9.3 to 4.10.1 Set ANTLR website root (default /Users/parrt/antlr/sites/website-antlr4): Version string updated. Please commit/push: Javadoc copied: - api/Java updated from antlr4-runtime-4.10-javadoc.jar - api/JavaTool updated from antlr4-4.10-javadoc.jar + api/Java updated from antlr4-runtime-4.10.1-javadoc.jar + api/JavaTool updated from antlr4-4.10.1-javadoc.jar Jars copied: - antlr-4.10-complete.jar - antlr-runtime-4.10.jar + antlr-4.10.1-complete.jar + antlr-runtime-4.10.1.jar Please look for and add new api files!! Then MANUALLY commit/push: -git commit -a -m 'Update website, javadoc, jars to 4.10' +git commit -a -m 'Update website, javadoc, jars to 4.10.1' git push origin gh-pages ``` @@ -496,7 +503,7 @@ Once it's done, you must do the following manually: ``` cd ~/antlr/sites/website-antlr4 -git commit -a -m 'Update website, javadoc, jars to 4.10' +git commit -a -m 'Update website, javadoc, jars to 4.10.1' git push origin gh-pages ``` @@ -508,9 +515,9 @@ cd ~/antlr/sites/website-antlr4/api git checkout gh-pages git pull origin gh-pages cd Java -jar xvf ~/.m2/repository/org/antlr/antlr4-runtime/4.10/antlr4-runtime-4.10-javadoc.jar +jar xvf ~/.m2/repository/org/antlr/antlr4-runtime/4.10.1/antlr4-runtime-4.10.1-javadoc.jar cd ../JavaTool -jar xvf ~/.m2/repository/org/antlr/antlr4/4.10/antlr4-4.10-javadoc.jar +jar xvf ~/.m2/repository/org/antlr/antlr4/4.10.1/antlr4-4.10.1-javadoc.jar git commit -a -m 'freshen api doc' git push origin gh-pages ``` diff --git a/doc/swift-target.md b/doc/swift-target.md index 21313deef9..4c11faad1d 100644 --- a/doc/swift-target.md +++ b/doc/swift-target.md @@ -131,7 +131,7 @@ Add Antlr4 as a dependency to your `Package.swift` file. For more information, p ```swift -.package(name: "Antlr4", url: "https://github.com/antlr/antlr4", from: "4.10" +.package(name: "Antlr4", url: "https://github.com/antlr/antlr4", from: "4.10.1" ``` ## Swift access levels diff --git a/docker/Dockerfile b/docker/Dockerfile index 7ff0ddc6f3..9bbd338f93 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,7 @@ FROM adoptopenjdk/openjdk11:alpine AS builder WORKDIR /opt/antlr4 -ARG ANTLR_VERSION="4.10" +ARG ANTLR_VERSION="4.10.1" ARG MAVEN_OPTS="-Xmx1G" diff --git a/runtime/CSharp/src/Antlr4.csproj b/runtime/CSharp/src/Antlr4.csproj index aac3a5804f..ec4ddf2213 100644 --- a/runtime/CSharp/src/Antlr4.csproj +++ b/runtime/CSharp/src/Antlr4.csproj @@ -1,7 +1,7 @@  The ANTLR Organization - 4.10 + 4.10.1 en-US netstandard2.0 net45;netstandard2.0 diff --git a/runtime/CSharp/src/Properties/AssemblyInfo.cs b/runtime/CSharp/src/Properties/AssemblyInfo.cs index 6666031698..1bbfc3a5c2 100644 --- a/runtime/CSharp/src/Properties/AssemblyInfo.cs +++ b/runtime/CSharp/src/Properties/AssemblyInfo.cs @@ -6,4 +6,4 @@ using System.Reflection; [assembly: CLSCompliant(true)] -[assembly: AssemblyVersion("4.10")] +[assembly: AssemblyVersion("4.10.1")] diff --git a/runtime/CSharp/src/README.md b/runtime/CSharp/src/README.md index 771253596f..2223c061b6 100644 --- a/runtime/CSharp/src/README.md +++ b/runtime/CSharp/src/README.md @@ -41,7 +41,7 @@ See the docs and the book to learn about writing lexer and parser grammars. ### Step 4: Generate the C# code This can be done either from the cmd line, or by adding a custom pre-build command in your project. -At minimal, the cmd line should look as follows: ``java -jar antlr4-4.10.jar -Dlanguage=CSharp grammar.g4`` +At minimal, the cmd line should look as follows: ``java -jar antlr4-4.10.1.jar -Dlanguage=CSharp grammar.g4`` This will generate the files, which you can then integrate in your project. This is just a quick start. The tool has many useful options to control generation, please refer to its documentation. diff --git a/runtime/Cpp/VERSION b/runtime/Cpp/VERSION index 8d39259a80..ad96464c4b 100644 --- a/runtime/Cpp/VERSION +++ b/runtime/Cpp/VERSION @@ -1 +1 @@ -4.10 +4.10.1 diff --git a/runtime/Cpp/cmake/Antlr4Package.md b/runtime/Cpp/cmake/Antlr4Package.md index 9b4d8584c3..653cf5ec1d 100644 --- a/runtime/Cpp/cmake/Antlr4Package.md +++ b/runtime/Cpp/cmake/Antlr4Package.md @@ -96,7 +96,7 @@ target_link_libraries( Parsertest PRIVATE find_package(antlr4-generator REQUIRED) # Set path to generator - set(ANTLR4_JAR_LOCATION ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.10-complete.jar) + set(ANTLR4_JAR_LOCATION ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.10.1-complete.jar) # generate lexer antlr4_generate( diff --git a/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake b/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake index 6d07ba16cb..a64233ae04 100644 --- a/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake +++ b/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake @@ -38,7 +38,7 @@ else() set(ANTLR4_SHARED_LIBRARIES ${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dll.a) set(ANTLR4_RUNTIME_LIBRARIES - ${ANTLR4_OUTPUT_DIR}/cygantlr4-runtime-4.10.dll) + ${ANTLR4_OUTPUT_DIR}/cygantlr4-runtime-4.10.1.dll) elseif(APPLE) set(ANTLR4_RUNTIME_LIBRARIES ${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dylib) diff --git a/runtime/Cpp/cmake/FindANTLR.cmake b/runtime/Cpp/cmake/FindANTLR.cmake index 4a34d730d1..418d9dee03 100644 --- a/runtime/Cpp/cmake/FindANTLR.cmake +++ b/runtime/Cpp/cmake/FindANTLR.cmake @@ -2,7 +2,7 @@ find_package(Java QUIET COMPONENTS Runtime) if(NOT ANTLR_EXECUTABLE) find_program(ANTLR_EXECUTABLE - NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.10-complete.jar) + NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.10.1-complete.jar) endif() if(ANTLR_EXECUTABLE AND Java_JAVA_EXECUTABLE) diff --git a/runtime/Cpp/cmake/README.md b/runtime/Cpp/cmake/README.md index 61e7186b4c..08186b120f 100644 --- a/runtime/Cpp/cmake/README.md +++ b/runtime/Cpp/cmake/README.md @@ -29,8 +29,8 @@ set(ANTLR4_WITH_STATIC_CRT OFF) # By default the latest version of antlr4 will be used. You can specify a # specific, stable version by setting a repository tag value or a link # to a zip file containing the libary source. -# set(ANTLR4_TAG 4.10) -# set(ANTLR4_ZIP_REPOSITORY https://github.com/antlr/antlr4/archive/refs/tags/4.10.zip) +# set(ANTLR4_TAG 4.10.1) +# set(ANTLR4_ZIP_REPOSITORY https://github.com/antlr/antlr4/archive/refs/tags/4.10.1.zip) # add external build for antlrcpp include(ExternalAntlr4Cpp) @@ -39,7 +39,7 @@ include_directories(${ANTLR4_INCLUDE_DIRS}) # set variable pointing to the antlr tool that supports C++ # this is not required if the jar file can be found under PATH environment -set(ANTLR_EXECUTABLE /home/user/antlr-4.10-complete.jar) +set(ANTLR_EXECUTABLE /home/user/antlr-4.10.1-complete.jar) # add macros to generate ANTLR Cpp code from grammar find_package(ANTLR REQUIRED) diff --git a/runtime/Cpp/demo/generate.cmd b/runtime/Cpp/demo/generate.cmd index 53619c742f..dfb75838ea 100644 --- a/runtime/Cpp/demo/generate.cmd +++ b/runtime/Cpp/demo/generate.cmd @@ -6,7 +6,7 @@ :: Download the ANLTR jar and place it in the same folder as this script (or adjust the LOCATION var accordingly). -set LOCATION=antlr-4.10-complete.jar +set LOCATION=antlr-4.10.1-complete.jar java -jar %LOCATION% -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4 ::java -jar %LOCATION% -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest -XdbgST TLexer.g4 TParser.g4 ::java -jar %LOCATION% -Dlanguage=Java -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4 diff --git a/runtime/Cpp/runtime/src/Version.h b/runtime/Cpp/runtime/src/Version.h index d18c275b1c..cf8d3ca29d 100644 --- a/runtime/Cpp/runtime/src/Version.h +++ b/runtime/Cpp/runtime/src/Version.h @@ -29,7 +29,7 @@ #define ANTLRCPP_VERSION_MAJOR 4 #define ANTLRCPP_VERSION_MINOR 10 -#define ANTLRCPP_VERSION_PATCH 0 +#define ANTLRCPP_VERSION_PATCH 1 #define ANTLRCPP_MAKE_VERSION(major, minor, patch) ((major) * 100000 + (minor) * 1000 + (patch)) diff --git a/runtime/Dart/lib/src/runtime_meta_data.dart b/runtime/Dart/lib/src/runtime_meta_data.dart index f0af12f3dc..b6d6c73cfe 100644 --- a/runtime/Dart/lib/src/runtime_meta_data.dart +++ b/runtime/Dart/lib/src/runtime_meta_data.dart @@ -66,7 +66,7 @@ class RuntimeMetaData { /// omitted, the {@code -} (hyphen-minus) appearing before it is also /// omitted. /// - static final String VERSION = '4.10'; + static final String VERSION = '4.10.1'; /// Gets the currently executing version of the ANTLR 4 runtime library. /// diff --git a/runtime/Dart/pubspec.yaml b/runtime/Dart/pubspec.yaml index f59fd1f8ef..388fd3f2cb 100644 --- a/runtime/Dart/pubspec.yaml +++ b/runtime/Dart/pubspec.yaml @@ -1,5 +1,5 @@ name: "antlr4" -version: "4.10.0" +version: "4.10.1" description: "New Dart runtime for ANTLR4." homepage: "https://github.com/antlr/antlr4" license: "BSD-3-Clause" diff --git a/runtime/Go/antlr/recognizer.go b/runtime/Go/antlr/recognizer.go index d7c1079b1e..93efcf355d 100644 --- a/runtime/Go/antlr/recognizer.go +++ b/runtime/Go/antlr/recognizer.go @@ -49,7 +49,7 @@ var tokenTypeMapCache = make(map[string]int) var ruleIndexMapCache = make(map[string]int) func (b *BaseRecognizer) checkVersion(toolVersion string) { - runtimeVersion := "4.10" + runtimeVersion := "4.10.1" if runtimeVersion != toolVersion { fmt.Println("ANTLR runtime and generated code versions disagree: " + runtimeVersion + "!=" + toolVersion) } diff --git a/runtime/Java/pom.xml b/runtime/Java/pom.xml index e2a19e9187..2636724152 100644 --- a/runtime/Java/pom.xml +++ b/runtime/Java/pom.xml @@ -105,15 +105,16 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.8 - 1.8 - - + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 8 + 1.8 + 1.8 + + diff --git a/runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java b/runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java index 3b18a98de7..a7cda7bedb 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java +++ b/runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java @@ -67,7 +67,7 @@ public class RuntimeMetaData { * omitted. * */ - public static final String VERSION = "4.10"; + public static final String VERSION = "4.10.1"; /** * Gets the currently executing version of the ANTLR 4 runtime library. diff --git a/runtime/JavaScript/package-lock.json b/runtime/JavaScript/package-lock.json index 600e4840b0..86012df7c3 100644 --- a/runtime/JavaScript/package-lock.json +++ b/runtime/JavaScript/package-lock.json @@ -1,12 +1,12 @@ { "name": "antlr4", - "version": "4.10.0", + "version": "4.10.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "antlr4", - "version": "4.10.0", + "version": "4.10.1", "license": "BSD-3-Clause", "devDependencies": { "@babel/preset-env": "^7.16.11", diff --git a/runtime/JavaScript/package.json b/runtime/JavaScript/package.json index 51cb034aeb..157249a387 100644 --- a/runtime/JavaScript/package.json +++ b/runtime/JavaScript/package.json @@ -1,6 +1,6 @@ { "name": "antlr4", - "version": "4.10.0", + "version": "4.10.1", "type": "module", "description": "JavaScript runtime for ANTLR4", "main": "src/antlr4/index.js", diff --git a/runtime/JavaScript/src/antlr4/Recognizer.js b/runtime/JavaScript/src/antlr4/Recognizer.js index e28a321cb1..e6b9852597 100644 --- a/runtime/JavaScript/src/antlr4/Recognizer.js +++ b/runtime/JavaScript/src/antlr4/Recognizer.js @@ -15,7 +15,7 @@ export default class Recognizer { } checkVersion(toolVersion) { - const runtimeVersion = "4.10"; + const runtimeVersion = "4.10.1"; if (runtimeVersion!==toolVersion) { console.log("ANTLR runtime and generated code versions disagree: "+runtimeVersion+"!="+toolVersion); } diff --git a/runtime/Python2/setup.py b/runtime/Python2/setup.py index e8bab93aba..e7eded0e16 100644 --- a/runtime/Python2/setup.py +++ b/runtime/Python2/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -v = '4.10' +v = '4.10.1' setup( name='antlr4-python2-runtime', version=v, diff --git a/runtime/Python2/src/antlr4/Recognizer.py b/runtime/Python2/src/antlr4/Recognizer.py index 99462d409b..8df1419933 100644 --- a/runtime/Python2/src/antlr4/Recognizer.py +++ b/runtime/Python2/src/antlr4/Recognizer.py @@ -30,7 +30,7 @@ def extractVersion(self, version): return major, minor def checkVersion(self, toolVersion): - runtimeVersion = "4.10" + runtimeVersion = "4.10.1" rvmajor, rvminor = self.extractVersion(runtimeVersion) tvmajor, tvminor = self.extractVersion(toolVersion) if rvmajor!=tvmajor or rvminor!=tvminor: diff --git a/runtime/Python3/setup.py b/runtime/Python3/setup.py index a9af2bb557..e91a9f33e6 100644 --- a/runtime/Python3/setup.py +++ b/runtime/Python3/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -v = '4.10' +v = '4.10.1' setup( name='antlr4-python3-runtime', diff --git a/runtime/Python3/src/antlr4/Recognizer.py b/runtime/Python3/src/antlr4/Recognizer.py index 371d9aaa43..b94de2980c 100644 --- a/runtime/Python3/src/antlr4/Recognizer.py +++ b/runtime/Python3/src/antlr4/Recognizer.py @@ -34,7 +34,7 @@ def extractVersion(self, version): return major, minor def checkVersion(self, toolVersion): - runtimeVersion = "4.10" + runtimeVersion = "4.10.1" rvmajor, rvminor = self.extractVersion(runtimeVersion) tvmajor, tvminor = self.extractVersion(toolVersion) if rvmajor!=tvmajor or rvminor!=tvminor: diff --git a/runtime/Swift/Sources/Antlr4/RuntimeMetaData.swift b/runtime/Swift/Sources/Antlr4/RuntimeMetaData.swift index eb7afa44d5..d08a985e69 100644 --- a/runtime/Swift/Sources/Antlr4/RuntimeMetaData.swift +++ b/runtime/Swift/Sources/Antlr4/RuntimeMetaData.swift @@ -63,7 +63,7 @@ public class RuntimeMetaData { /// omitted, the `-` (hyphen-minus) appearing before it is also /// omitted. /// - public static let VERSION: String = "4.10" + public static let VERSION: String = "4.10.1" /// /// Gets the currently executing version of the ANTLR 4 runtime library. diff --git a/scripts/files-to-update.txt b/scripts/files-to-update.txt index 47034fec04..81293b4d0d 100644 --- a/scripts/files-to-update.txt +++ b/scripts/files-to-update.txt @@ -5,6 +5,7 @@ # # Lines starting with '*' allow multiple changes in single file +docker/Dockerfile runtime/Go/antlr/recognizer.go runtime/Python3/setup.py runtime/Python3/src/antlr4/Recognizer.py @@ -31,7 +32,7 @@ runtime/JavaScript/src/antlr4/Recognizer.js # Allow doc files to have multiple values updated * doc/swift-target.md * doc/dart-target.md -# doc/releasing-antlr.md # Do this one manually +doc/releasing-antlr.md # Do this one manually; it'll fail because of multiple lines but we get warning * doc/getting-started.md * doc/swift-target.md * doc/getting-started.md diff --git a/scripts/update_antlr_version.py b/scripts/update_antlr_version.py index 81a5f4b284..15ea733eb1 100644 --- a/scripts/update_antlr_version.py +++ b/scripts/update_antlr_version.py @@ -53,11 +53,11 @@ def update_file(qfname, multi, before, after): count = sum(before in line for line in lines) if count>1 and not multi: print(f"{before} appears on {count} lines so _not_ updating {qfname}") - - # print(f"{before} => {after} in {qfname}") - text = text.replace(before, after) - with open(qfname, "w", encoding="UTF-8") as f: - f.write(text) + else: + # print(f"{before} => {after} in {qfname}") + text = text.replace(before, after) + with open(qfname, "w", encoding="UTF-8") as f: + f.write(text) def update_files(ROOT, before, after):