Skip to content

Commit

Permalink
Update 4.13.1 -> 4.13.2
Browse files Browse the repository at this point in the history
  • Loading branch information
parrt committed Aug 3, 2024
1 parent 35ff30d commit b91cecf
Show file tree
Hide file tree
Showing 28 changed files with 51 additions and 50 deletions.
30 changes: 15 additions & 15 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.13.1-complete.jar
Downloading antlr4-4.13.2-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.13.1
ANTLR Parser Generator Version 4.13.2
-o ___ specify output directory where all output is generated
-lib ___ specify location of grammars, tokens files
...
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.13.1-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.2-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.13.1-complete.jar
$ curl -O https://www.antlr.org/download/antlr-4.13.2-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.13.1 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.2 support jdk 1.8

2. Add `antlr-4.13.1-complete.jar` to your `CLASSPATH`:
2. Add `antlr-4.13.2-complete.jar` to your `CLASSPATH`:
```
$ export CLASSPATH=".:/usr/local/lib/antlr-4.13.1-complete.jar:$CLASSPATH"
$ export CLASSPATH=".:/usr/local/lib/antlr-4.13.2-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.13.1-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.13.1-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig'
$ alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.13.2-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.13.2-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.13.1-complete.jar (or whatever version) from [https://www.antlr.org/download.html](https://www.antlr.org/download.html)
1. Download antlr-4.13.2-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.13.1-complete.jar` to CLASSPATH, either:
2. Add `antlr-4.13.2-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.13.1-complete.jar;%CLASSPATH%
SET CLASSPATH=.;C:\Javalib\antlr-4.13.2-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.13.1
ANTLR Parser Generator Version 4.13.2
-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.13.1
or use -jar option on java:

```
$ java -jar /usr/local/lib/antlr-4.13.1-complete.jar
ANTLR Parser Generator Version 4.13.1
$ java -jar /usr/local/lib/antlr-4.13.2-complete.jar
ANTLR Parser Generator Version 4.13.2
-o ___ specify output directory where all output is generated
-lib ___ specify location of .tokens files
...
Expand Down
8 changes: 4 additions & 4 deletions doc/go-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ golang.org/x/exp
```

A complete list of releases can be found on [the release page](https://github.com/antlr/antlr4/releases). The Go
runtime will be tagged using standard Go tags, so release 4.13.1 in the `antlr4-go/antlr` repo, will be tagged with
`v4.13.1` and go get will pick that up from the ANTLR repo.
runtime will be tagged using standard Go tags, so release 4.13.2 in the `antlr4-go/antlr` repo, will be tagged with
`v4.13.2` and go get will pick that up from the ANTLR repo.

#### 3. Configuring `go generate` in your project

Expand All @@ -108,7 +108,7 @@ place the ANTLR grammar files in their own package in your project structure. He
├── myproject
├── parser
│ ├── mygrammar.g4
│ ├── antlr-4.13.1-complete.jar
│ ├── antlr-4.13.2-complete.jar
│ ├── generate.go
│ └── generate.sh
├── parsing # Generated code goes here
Expand All @@ -133,7 +133,7 @@ And the `generate.sh` file will look similar to this:
```shell
#!/bin/sh

alias antlr4='java -Xmx500M -cp "./antlr-4.13.1-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
alias antlr4='java -Xmx500M -cp "./antlr-4.13.2-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
antlr4 -Dlanguage=Go -no-visitor -package parsing *.g4
```

Expand Down
2 changes: 1 addition & 1 deletion doc/swift-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Add Antlr4 as a dependency to your `Package.swift` file. For more information, p


```swift
.package(url: "https://github.com/antlr/antlr4", from: "4.13.1")
.package(url: "https://github.com/antlr/antlr4", from: "4.13.2")
```

## Swift access levels
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM eclipse-temurin:11 AS builder

WORKDIR /opt/antlr4

ARG ANTLR_VERSION="4.13.1"
ARG ANTLR_VERSION="4.13.2"
ARG MAVEN_OPTS="-Xmx1G"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"@types/node": "^18.0.5"
},
"dependencies": {
"antlr4": "^4.13.1"
"antlr4": "^4.13.2"
}
}
2 changes: 1 addition & 1 deletion runtime/CSharp/src/Antlr4.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Company>The ANTLR Organization</Company>
<Version>4.13.1</Version>
<Version>4.13.2</Version>
<NeutralLanguage>en-US</NeutralLanguage>
<TargetFramework Condition="'$(OS)' != 'Windows_NT'">netstandard2.0</TargetFramework>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net45;netstandard2.0</TargetFrameworks>
Expand Down
2 changes: 1 addition & 1 deletion runtime/CSharp/src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
using System.Reflection;

[assembly: CLSCompliant(true)]
[assembly: AssemblyVersion("4.13.1")]
[assembly: AssemblyVersion("4.13.2")]
2 changes: 1 addition & 1 deletion runtime/CSharp/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.13.1.jar -Dlanguage=CSharp grammar.g4``
At minimal, the cmd line should look as follows: ``java -jar antlr4-4.13.2.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.

Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.13.1
4.13.2
2 changes: 1 addition & 1 deletion runtime/Cpp/cmake/Antlr4Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.13.1-complete.jar)
set(ANTLR4_JAR_LOCATION ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.13.2-complete.jar)
# generate lexer
antlr4_generate(
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ else()
set(ANTLR4_SHARED_LIBRARIES
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dll.a)
set(ANTLR4_RUNTIME_LIBRARIES
${ANTLR4_OUTPUT_DIR}/cygantlr4-runtime-4.13.1.dll)
${ANTLR4_OUTPUT_DIR}/cygantlr4-runtime-4.13.2.dll)
elseif(APPLE)
set(ANTLR4_RUNTIME_LIBRARIES
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dylib)
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/cmake/FindANTLR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.13.1-complete.jar)
NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.13.2-complete.jar)
endif()

if(ANTLR_EXECUTABLE AND Java_JAVA_EXECUTABLE)
Expand Down
6 changes: 3 additions & 3 deletions runtime/Cpp/cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.13.1)
# set(ANTLR4_ZIP_REPOSITORY https://github.com/antlr/antlr4/archive/refs/tags/4.13.1.zip)
# set(ANTLR4_TAG 4.13.2)
# set(ANTLR4_ZIP_REPOSITORY https://github.com/antlr/antlr4/archive/refs/tags/4.13.2.zip)
# add external build for antlrcpp
include(ExternalAntlr4Cpp)
Expand All @@ -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.13.1-complete.jar)
set(ANTLR_EXECUTABLE /home/user/antlr-4.13.2-complete.jar)
# add macros to generate ANTLR Cpp code from grammar
find_package(ANTLR REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/demo/generate.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.13.1-complete.jar
set LOCATION=antlr-4.13.2-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
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/runtime/src/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#define ANTLRCPP_VERSION_MAJOR 4
#define ANTLRCPP_VERSION_MINOR 13
#define ANTLRCPP_VERSION_PATCH 1
#define ANTLRCPP_VERSION_PATCH 2

#define ANTLRCPP_MAKE_VERSION(major, minor, patch) ((major) * 100000 + (minor) * 1000 + (patch))

Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/lib/src/runtime_meta_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class RuntimeMetaData {
/// omitted, the {@code -} (hyphen-minus) appearing before it is also
/// omitted.</li>
/// </ul>
static final String VERSION = '4.13.1';
static final String VERSION = '4.13.2';

/// Gets the currently executing version of the ANTLR 4 runtime library.
///
Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "antlr4"
version: "4.13.1"
version: "4.13.2"
description: "New Dart runtime for ANTLR4."
homepage: "https://github.com/antlr/antlr4"
license: "BSD-3-Clause"
Expand Down
6 changes: 3 additions & 3 deletions runtime/Go/antlr/v4/antlrdoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ANTLR4 that it is compatible with (I.E. uses the /v4 path).
However, this was found to be problematic, as it meant that with the runtime embedded so far underneath the root
of the repo, the `go get` and related commands could not properly resolve the location of the go runtime source code.
This meant that the reference to the runtime in your `go.mod` file would refer to the correct source code, but would not
list the release tag such as @4.13.1 - this was confusing, to say the least.
list the release tag such as @4.13.2 - this was confusing, to say the least.
As of 4.13.0, the runtime is now available as a go module in its own repo, and can be imported as `github.com/antlr4-go/antlr`
(the go get command should also be used with this path). See the main documentation for the ANTLR4 project for more information,
Expand Down Expand Up @@ -49,7 +49,7 @@ Here is a general/recommended template for an ANTLR based recognizer in Go:
.
├── parser
│ ├── mygrammar.g4
│ ├── antlr-4.13.1-complete.jar
│ ├── antlr-4.13.2-complete.jar
│ ├── generate.go
│ └── generate.sh
├── parsing - generated code goes here
Expand All @@ -71,7 +71,7 @@ And the generate.sh file will look similar to this:
#!/bin/sh
alias antlr4='java -Xmx500M -cp "./antlr4-4.13.1-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
alias antlr4='java -Xmx500M -cp "./antlr4-4.13.2-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
antlr4 -Dlanguage=Go -no-visitor -package parsing *.g4
depending on whether you want visitors or listeners or any other ANTLR options. Not that another option here
Expand Down
2 changes: 1 addition & 1 deletion runtime/Go/antlr/v4/recognizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var tokenTypeMapCache = make(map[string]int)
var ruleIndexMapCache = make(map[string]int)

func (b *BaseRecognizer) checkVersion(toolVersion string) {
runtimeVersion := "4.13.1"
runtimeVersion := "4.13.2"
if runtimeVersion != toolVersion {
fmt.Println("ANTLR runtime and generated code versions disagree: " + runtimeVersion + "!=" + toolVersion)
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class RuntimeMetaData {
* omitted.</li>
* </ul>
*/
public static final String VERSION = "4.13.1";
public static final String VERSION = "4.13.2";

/**
* Gets the currently executing version of the ANTLR 4 runtime library.
Expand Down
4 changes: 2 additions & 2 deletions runtime/JavaScript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/JavaScript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "antlr4",
"version": "4.13.1",
"version": "4.13.2",
"type": "module",
"description": "JavaScript runtime for ANTLR4",
"browser": "dist/antlr4.web.mjs",
Expand Down
2 changes: 1 addition & 1 deletion runtime/JavaScript/spec/rewriter/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ANTLR_VERSION = 4.13.1
ANTLR_VERSION = 4.13.2
ANTLR_JAR = .antlr/antlr-$(ANTLR_VERSION)-complete.jar

.antlr:
Expand Down
2 changes: 1 addition & 1 deletion runtime/JavaScript/src/antlr4/Recognizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class Recognizer {
}

checkVersion(toolVersion) {
const runtimeVersion = "4.13.1";
const runtimeVersion = "4.13.2";
if (runtimeVersion!==toolVersion) {
console.log("ANTLR runtime and generated code versions disagree: "+runtimeVersion+"!="+toolVersion);
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/Python3/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"

[project]
name = "antlr4-python3-runtime"
version = "4.13.1"
version = "4.13.2"
authors = [{name = "Eric Vergnaud", email = "eric.vergnaud@wanadoo.fr"}, {name = "Terence Parr"}, {name = "Sam Harwell"}]
license = {text = "BSD"}
description = "ANTLR 4.13.1 runtime for Python 3"
description = "ANTLR 4.13.2 runtime for Python 3"
urls = {Homepage = "http://www.antlr.org"}
dependencies = ["typing ; python_version<'3.5'"]

Expand Down
2 changes: 1 addition & 1 deletion runtime/Python3/src/antlr4/Recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def extractVersion(self, version):
return major, minor

def checkVersion(self, toolVersion):
runtimeVersion = "4.13.1"
runtimeVersion = "4.13.2"
rvmajor, rvminor = self.extractVersion(runtimeVersion)
tvmajor, tvminor = self.extractVersion(toolVersion)
if rvmajor!=tvmajor or rvminor!=tvminor:
Expand Down
2 changes: 1 addition & 1 deletion runtime/Swift/Sources/Antlr4/RuntimeMetaData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class RuntimeMetaData {
/// omitted, the `-` (hyphen-minus) appearing before it is also
/// omitted.
///
public static let VERSION: String = "4.13.1"
public static let VERSION: String = "4.13.2"

///
/// Gets the currently executing version of the ANTLR 4 runtime library.
Expand Down
1 change: 1 addition & 0 deletions scripts/files-to-update.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ runtime-testsuite/resources/org/antlr/v4/test/runtime/helpers/package_ts.json
* doc/getting-started.md
* doc/swift-target.md
* doc/getting-started.md
* doc/go-target.md

# runtime/Swift/Tests/Antlr4Tests/RuntimeMetaDataTests.swift This is special so must manually edit

Expand Down

0 comments on commit b91cecf

Please sign in to comment.