RuntimeMetaData class

This class provides access to the current version of the ANTLR 4 runtime library as compile-time and runtime constants, along with methods for checking for matching version numbers and notifying listeners in the case where a version mismatch is detected.

The runtime version information is provided by {@link #VERSION} and {@link #getRuntimeVersion()}. Detailed information about these values is provided in the documentation for each member.

The runtime version check is implemented by {@link #checkVersion}. Detailed information about incorporating this call into user code, as well as its use in generated code, is provided in the documentation for the method.

Version strings x.y and x.y.z are considered "compatible" and no error would be generated. Likewise, version strings x.y-SNAPSHOT and x.y.z are considered "compatible" because the major and minor components x.y are the same in each.

To trap any error messages issued by this code, use System.setErr() in your main() startup code.

@since 4.3

Constructors

RuntimeMetaData()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

runtimeVersion String
Gets the currently executing version of the ANTLR 4 runtime library.
no setter
VERSION String
A compile-time constant containing the current version of the ANTLR 4 runtime library.
final

Static Methods

checkVersion(String? generatingToolVersion, String compileTimeVersion) → void
This method provides the ability to detect mismatches between the version of ANTLR 4 used to generate a parser, the version of the ANTLR runtime a parser was compiled against, and the version of the ANTLR runtime which is currently executing.
getMajorMinorVersion(String version) String
Gets the major and minor version numbers from a version string. For details about the syntax of the input version. E.g., from x.y.z return x.y.