diff --git a/doc/releasing-antlr.md b/doc/releasing-antlr.md index 92b77d0dd6..42d6d7f2fb 100644 --- a/doc/releasing-antlr.md +++ b/doc/releasing-antlr.md @@ -25,21 +25,21 @@ 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.13.1 -$ git push origin :refs/tags/4.13.1 -$ git push upstream :refs/tags/4.13.1 +$ git tag -d 4.13.2 +$ git push origin :refs/tags/4.13.2 +$ git push upstream :refs/tags/4.13.2 ``` ### Go release tags *I don't think this is necessary anymore as we have moved it release branch to https://github.com/antlr4-go/antlr* -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.13.1 and v4.13.1. +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.13.2 and v4.13.2. ``` -$ git tag -a runtime/Go/antlr/v4/v4.13.1 -m "Go runtime module only" -$ git push upstream runtime/Go/antlr/v4/v4.13.1 -$ git push origin runtime/Go/antlr/v4/v4.13.1 +$ git tag -a runtime/Go/antlr/v4/v4.13.2 -m "Go runtime module only" +$ git push upstream runtime/Go/antlr/v4/v4.13.2 +$ git push origin runtime/Go/antlr/v4/v4.13.2 ``` @@ -51,13 +51,13 @@ There are a number of files that require inversion number be updated. Here is a simple script to display any line from the critical files with, say, `4.11.1` in it. Here's an example run of the script: ```bash -~/antlr/code/antlr4 $ python scripts/update_antlr_version.py 4.10 4.11.0 -Updating ANTLR version from 4.10 to 4.11.0 +~/antlr/code/antlr4 $ python scripts/update_antlr_version.py 4.13.1 4.13.2 +Updating ANTLR version from 4.13.1 to 4.13.2 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 -4.10 appears on 2 lines so _not_ updating /tmp/antlr4/runtime/JavaScript/package-lock.json -4.10 not in /tmp/antlr4/doc/releasing-antlr.md +4.13.1 appears on 2 lines so _not_ updating /tmp/antlr4/runtime/JavaScript/package-lock.json +4.13.1 not in /tmp/antlr4/doc/releasing-antlr.md ``` Make sure this file doesn't have `-SNAPSHOT` when releasing! @@ -77,7 +77,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.13.1 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.13.2 in `~/antlr/code/antlr-php-runtime/src/RuntimeMetaData.php` in the separate repository, commit, and push. ``` cd ~/antlr/code/antlr-php-runtime/src @@ -94,19 +94,19 @@ git push origin master ## 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.13.1 parser for XPath using 4.13.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. +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.13.2 parser for XPath using 4.13.2 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. ```bash cd ~/antlr/code/antlr4/runtime/Cpp/runtime/src/tree/xpath -java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.1-SNAPSHOT/antlr4-4.13.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Cpp XPathLexer.g4 +java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.2-SNAPSHOT/antlr4-4.13.2-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Cpp XPathLexer.g4 cd ~/antlr/code/antlr4/runtime/CSharp/src/Tree/Xpath -java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.1-SNAPSHOT/antlr4-4.13.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=CSharp XPathLexer.g4 +java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.2-SNAPSHOT/antlr4-4.13.2-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.13.1-SNAPSHOT/antlr4-4.13.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 Expr.g4 +java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.2-SNAPSHOT/antlr4-4.13.2-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 Expr.g4 cd ~/antlr/code/antlr4/runtime/Python3/src/antlr4/xpath -java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.1-SNAPSHOT/antlr4-4.13.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 XPathLexer.g4 +java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.2-SNAPSHOT/antlr4-4.13.2-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 XPathLexer.g4 ``` ## Maven Repository Settings @@ -156,7 +156,7 @@ Here is the file template ## Maven deploy snapshot -The goal is to get a snapshot, such as `4.13.1-SNAPSHOT`, to the staging server: [antlr4 tool](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4/4.13.1-SNAPSHOT/) and [antlr4 java runtime](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-runtime/4.13.1-SNAPSHOT/). +The goal is to get a snapshot, such as `4.13.2-SNAPSHOT`, to the staging server: [antlr4 tool](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4/4.13.2-SNAPSHOT/) and [antlr4 java runtime](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-runtime/4.13.2-SNAPSHOT/). Do this: @@ -227,18 +227,18 @@ It will start out by asking you the version number: ``` ... -What is the release version for "ANTLR 4"? (org.antlr:antlr4-master) 4.13.1: : 4.13.1 -What is the release version for "ANTLR 4 Runtime"? (org.antlr:antlr4-runtime) 4.13.1: : -What is the release version for "ANTLR 4 Tool"? (org.antlr:antlr4) 4.13.1: : -What is the release version for "ANTLR 4 Maven plugin"? (org.antlr:antlr4-maven-plugin) 4.13.1: : -What is the release version for "ANTLR 4 Runtime Test Generator"? (org.antlr:antlr4-runtime-testsuite) 4.13.1: : -What is the release version for "ANTLR 4 Tool Tests"? (org.antlr:antlr4-tool-testsuite) 4.13.1: : -What is SCM release tag or label for "ANTLR 4"? (org.antlr:antlr4-master) antlr4-master-4.13.1: : 4.13.1 -What is the new development version for "ANTLR 4"? (org.antlr:antlr4-master) 4.13.2-SNAPSHOT: +What is the release version for "ANTLR 4"? (org.antlr:antlr4-master) 4.13.2: : 4.13.2 +What is the release version for "ANTLR 4 Runtime"? (org.antlr:antlr4-runtime) 4.13.2: : +What is the release version for "ANTLR 4 Tool"? (org.antlr:antlr4) 4.13.2: : +What is the release version for "ANTLR 4 Maven plugin"? (org.antlr:antlr4-maven-plugin) 4.13.2: : +What is the release version for "ANTLR 4 Runtime Test Generator"? (org.antlr:antlr4-runtime-testsuite) 4.13.2: : +What is the release version for "ANTLR 4 Tool Tests"? (org.antlr:antlr4-tool-testsuite) 4.13.2: : +What is SCM release tag or label for "ANTLR 4"? (org.antlr:antlr4-master) antlr4-master-4.13.2: : 4.13.2 +What is the new development version for "ANTLR 4"? (org.antlr:antlr4-master) 4.13.3-SNAPSHOT: ... ``` -Maven will go through your pom.xml files to update versions from 4.13.1-SNAPSHOT to 4.13.1 for release and then to 4.13.2-SNAPSHOT after release, which is done with: +Maven will go through your pom.xml files to update versions from 4.13.2-SNAPSHOT to 4.13.2 for release and then to 4.13.2-SNAPSHOT after release, which is done with: ```bash mvn release:perform -Darguments="-DskipTests" @@ -252,7 +252,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.13.1/antlr4-runtime-4.13.1.jar](https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.13.1/antlr4-runtime-4.13.1.jar) +    [https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.13.2/antlr4-runtime-4.13.2.jar](https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.13.2/antlr4-runtime-4.13.2.jar) All releases should be here: [https://repo1.maven.org/maven2/org/antlr/antlr4-runtime](https://repo1.maven.org/maven2/org/antlr/antlr4-runtime). @@ -278,7 +278,7 @@ Move (and zip) target to website: ```bash cd src -zip -r ~/antlr/sites/website-antlr4/download/antlr-javascript-runtime-4.13.1.zip . +zip -r ~/antlr/sites/website-antlr4/download/antlr-javascript-runtime-4.13.2.zip . ``` ### CSharp @@ -369,7 +369,7 @@ On a Mac (with XCode 7+ installed): ```bash cd ~/antlr/code/antlr4/runtime/Cpp ./deploy-macos.sh -cp antlr4-cpp-runtime-macos.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.1-macos.zip +cp antlr4-cpp-runtime-macos.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.2-macos.zip ``` On any Mac or Linux machine: @@ -377,7 +377,7 @@ On any Mac or Linux machine: ```bash cd ~/antlr/code/antlr4/runtime/Cpp ./deploy-source.sh -cp antlr4-cpp-runtime-source.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.1-source.zip +cp antlr4-cpp-runtime-source.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.2-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). @@ -385,16 +385,16 @@ On a Windows machine the build scripts checks if VS 2017 and/or VS 2019 are inst ```bash cd ~/antlr/code/antlr4/runtime/Cpp deploy-windows.cmd Community -cp antlr4-cpp-runtime-vs2019.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.1-vs2019.zip +cp antlr4-cpp-runtime-vs2019.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.2-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.13.1-macos.zip -git add antlr4-cpp-runtime-4.13.1-windows.zip -git add antlr4-cpp-runtime-4.13.1-source.zip +git add antlr4-cpp-runtime-4.13.2-macos.zip +git add antlr4-cpp-runtime-4.13.2-windows.zip +git add antlr4-cpp-runtime-4.13.2-source.zip git commit -a -m 'update C++ runtime' git push origin gh-pages popd @@ -421,7 +421,7 @@ Otherwise enter `N` to ignore the warning. Jars are in: ``` -~/.m2/repository/org/antlr/antlr4-runtime/4.13.1/antlr4-runtime-4.13.1 +~/.m2/repository/org/antlr/antlr4-runtime/4.13.2/antlr4-runtime-4.13.2 ``` ### Update version and copy jars / api @@ -430,36 +430,36 @@ Copy javadoc and java jars to website using this script: ```bash cd ~/antlr/code/antlr4 -python scripts/deploy_to_website.py 4.13.0 4.13.1 +python scripts/deploy_to_website.py 4.13.1 4.13.2 ``` Output: ```bash -Updating ANTLR version from 4.13.0 to 4.13.1 +Updating ANTLR version from 4.13.1 to 4.13.2 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.13.1-javadoc.jar - api/JavaTool updated from antlr4-4.13.1-javadoc.jar + api/Java updated from antlr4-runtime-4.13.2-javadoc.jar + api/JavaTool updated from antlr4-4.13.2-javadoc.jar Jars copied: - antlr-4.13.1-complete.jar - antlr-runtime-4.13.1.jar + antlr-4.13.2-complete.jar + antlr-runtime-4.13.2.jar Please look for and add new api files!! Then MANUALLY commit/push: -git commit -a -m 'Update website, javadoc, jars to 4.13.1' +git commit -a -m 'Update website, javadoc, jars to 4.13.2' git push origin gh-pages ``` @@ -467,7 +467,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.13.1' +git commit -a -m 'Update website, javadoc, jars to 4.13.2' git push origin gh-pages ``` @@ -479,9 +479,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.13.1/antlr4-runtime-4.13.1-javadoc.jar +jar xvf ~/.m2/repository/org/antlr/antlr4-runtime/4.13.2/antlr4-runtime-4.13.2-javadoc.jar cd ../JavaTool -jar xvf ~/.m2/repository/org/antlr/antlr4/4.13.1/antlr4-4.13.1-javadoc.jar +jar xvf ~/.m2/repository/org/antlr/antlr4/4.13.2/antlr4-4.13.2-javadoc.jar git commit -a -m 'freshen api doc' git push origin gh-pages ``` diff --git a/runtime/CSharp/src/Tree/Xpath/XPathLexer.cs b/runtime/CSharp/src/Tree/Xpath/XPathLexer.cs index 160dc8cea5..274106d0a3 100644 --- a/runtime/CSharp/src/Tree/Xpath/XPathLexer.cs +++ b/runtime/CSharp/src/Tree/Xpath/XPathLexer.cs @@ -1,14 +1,14 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// ANTLR Version: 4.11.2-SNAPSHOT +// ANTLR Version: 4.13.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -// Generated from XPathLexer.g4 by ANTLR 4.11.2-SNAPSHOT +// Generated from XPathLexer.g4 by ANTLR 4.13.1 // Unreachable code detected #pragma warning disable 0162 @@ -27,7 +27,7 @@ using Antlr4.Runtime.Misc; using DFA = Antlr4.Runtime.Dfa.DFA; -[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.11.2-SNAPSHOT")] +[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.1")] [System.CLSCompliant(false)] public partial class XPathLexer : Lexer { protected static DFA[] decisionToDFA; diff --git a/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp b/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp index 4d7448a89b..bba8a150b8 100644 --- a/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +++ b/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp @@ -1,5 +1,5 @@ -// Generated from XPathLexer.g4 by ANTLR 4.13.0 +// Generated from XPathLexer.g4 by ANTLR 4.13.1 #include "XPathLexer.h" @@ -45,7 +45,7 @@ ::antlr4::internal::OnceFlag xpathlexerLexerOnceFlag; #if ANTLR4_USE_THREAD_LOCAL_CACHE static thread_local #endif -XPathLexerStaticData *xpathlexerLexerStaticData = nullptr; +std::unique_ptr xpathlexerLexerStaticData = nullptr; void xpathlexerLexerInitialize() { #if ANTLR4_USE_THREAD_LOCAL_CACHE @@ -103,7 +103,7 @@ void xpathlexerLexerInitialize() { for (size_t i = 0; i < count; i++) { staticData->decisionToDFA.emplace_back(staticData->atn->getDecisionState(i), i); } - xpathlexerLexerStaticData = staticData.release(); + xpathlexerLexerStaticData = std::move(staticData); } } diff --git a/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h b/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h index 8757bf2a51..556e95050b 100644 --- a/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h +++ b/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h @@ -1,5 +1,5 @@ -// Generated from XPathLexer.g4 by ANTLR 4.13.0 +// Generated from XPathLexer.g4 by ANTLR 4.13.1 #pragma once diff --git a/runtime/Python3/src/antlr4/xpath/XPathLexer.py b/runtime/Python3/src/antlr4/xpath/XPathLexer.py index eff3533ada..d608d466a8 100644 --- a/runtime/Python3/src/antlr4/xpath/XPathLexer.py +++ b/runtime/Python3/src/antlr4/xpath/XPathLexer.py @@ -1,4 +1,4 @@ -# Generated from XPathLexer.g4 by ANTLR 4.11.2-SNAPSHOT +# Generated from XPathLexer.g4 by ANTLR 4.13.1 from antlr4 import * from io import StringIO import sys @@ -63,7 +63,7 @@ class XPathLexer(Lexer): def __init__(self, input=None, output:TextIO = sys.stdout): super().__init__(input, output) - self.checkVersion("4.11.2-SNAPSHOT") + self.checkVersion("4.13.1") self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) self._actions = None self._predicates = None diff --git a/runtime/Python3/tests/expr/ExprLexer.py b/runtime/Python3/tests/expr/ExprLexer.py index 706e5380b6..674b13977d 100644 --- a/runtime/Python3/tests/expr/ExprLexer.py +++ b/runtime/Python3/tests/expr/ExprLexer.py @@ -1,4 +1,4 @@ -# Generated from Expr.g4 by ANTLR 4.11.2-SNAPSHOT +# Generated from Expr.g4 by ANTLR 4.13.1 from antlr4 import * from io import StringIO import sys @@ -87,7 +87,7 @@ class ExprLexer(Lexer): def __init__(self, input=None, output:TextIO = sys.stdout): super().__init__(input, output) - self.checkVersion("4.11.2-SNAPSHOT") + self.checkVersion("4.13.1") self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) self._actions = None self._predicates = None diff --git a/runtime/Python3/tests/expr/ExprParser.py b/runtime/Python3/tests/expr/ExprParser.py index 4bc05b298c..d80c08ba05 100644 --- a/runtime/Python3/tests/expr/ExprParser.py +++ b/runtime/Python3/tests/expr/ExprParser.py @@ -1,4 +1,4 @@ -# Generated from Expr.g4 by ANTLR 4.11.2-SNAPSHOT +# Generated from Expr.g4 by ANTLR 4.13.1 # encoding: utf-8 from antlr4 import * from io import StringIO @@ -86,7 +86,7 @@ class ExprParser ( Parser ): def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) - self.checkVersion("4.11.2-SNAPSHOT") + self.checkVersion("4.13.1") self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache) self._predicates = None