Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: antlr/antlr4
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.13.1
Choose a base ref
...
head repository: antlr/antlr4
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.13.2
Choose a head ref

Commits on Sep 4, 2023

  1. Copy the full SHA
    1855d9a View commit details

Commits on Sep 5, 2023

  1. [JavaScript] Document Node.JS v16 requirement (#4355)

    * docs(js): document Node >= 16 requirement
    
    Document that the ANTLR 4 JavaScript target requires
    Node >= 16.
    
    This has been the case since ANTLR 4.12.0
    
    Fixes: 2c75e64
    
    Signed-off-by: Alois Klink <alois@aloisklink.com>
    
    * docs(js): add badges to README
    
    Add some open-source badges to the README.md,
    taken from https://shields.io/.
    
    The most important one shows which versions of Node.JS
    are supported by the latest version of `antlr4`.
    
    Signed-off-by: Alois Klink <alois@aloisklink.com>
    
    ---------
    
    Signed-off-by: Alois Klink <alois@aloisklink.com>
    aloisklink authored Sep 5, 2023
    Copy the full SHA
    475d790 View commit details
  2. Export DefaultErrorStrategy (#4278)

    Signed-off-by: hdpnguyen <hieu.dac.phuong.nguyen@mgm-tp.com>
    Co-authored-by: hdpnguyen <hieu.dac.phuong.nguyen@mgm-tp.com>
    hieunguyen2211 and hdpnguyen authored Sep 5, 2023
    Copy the full SHA
    200e10c View commit details
  3. Merge branch 'master' into dev

    parrt committed Sep 5, 2023
    Copy the full SHA
    65dfe0d View commit details

Commits on Sep 9, 2023

  1. Add "override" before EOF in TS

    Signed-off-by: GP4cK <gautier.bayzelon@gmail.com>
    GP4cK authored and parrt committed Sep 9, 2023
    Copy the full SHA
    98d6fab View commit details
  2. fix: package.json entrypoints

    Signed-off-by: Alex Miller <codex.nz@gmail.com>
    Codex- authored and parrt committed Sep 9, 2023
    Copy the full SHA
    9043b8a View commit details

Commits on Sep 15, 2023

  1. Update python-target.md (#4417)

    Signed-off-by: eleveyuan <85916131+eleveyuan@users.noreply.github.com>
    eleveyuan authored Sep 15, 2023
    Copy the full SHA
    0eb38a0 View commit details

Commits on Sep 26, 2023

  1. fix: TypeScript: incorrect type in CommonTokenStream

    Signed-off-by: Johannes Heesterman <johannes@elfsquad.io>
    johannesheesterman authored and parrt committed Sep 26, 2023
    Copy the full SHA
    487cb28 View commit details

Commits on Nov 2, 2023

  1. fix: tweak word antrl to antlr (#4459)

    Signed-off-by: h3n4l <oysterdays@gmail.com>
    h3n4l authored Nov 2, 2023
    Copy the full SHA
    2e718eb View commit details

Commits on Nov 7, 2023

  1. docs: fix wrong way to import in go

    Signed-off-by: KevinZonda <33132228+KevinZonda@users.noreply.github.com>
    KevinZonda authored and parrt committed Nov 7, 2023
    Copy the full SHA
    d25d421 View commit details

Commits on Dec 15, 2023

  1. Copy the full SHA
    28eb036 View commit details

Commits on Jan 12, 2024

  1. Update README.md

    Signed-off-by: ericvergnaud <eric.vergnaud@wanadoo.fr>
    ericvergnaud authored Jan 12, 2024
    Copy the full SHA
    ebb511a View commit details

Commits on Jan 21, 2024

  1. added Token.DEFAULT_CHANNEL and Token.HIDDEN_CHANNEL (#4516)

    * added DEFAULT_CHANNEL and HIDDEN_CHANNEL constants
    
    based on:
    https://github.com/antlr/antlr4/blob/ebb511a04a60ae5a605aba65471c07dd854e9303/runtime/JavaScript/src/antlr4/Token.js#L59
    
    https://github.com/antlr/antlr4/blob/ebb511a04a60ae5a605aba65471c07dd854e9303/runtime/JavaScript/src/antlr4/Token.js#L65
    Signed-off-by: Robert Einhorn <robert.einhorn.hu@gmail.com>
    
    * added DEFAULT_CHANNEL and HIDDEN_CHANNEL constants
    
    #4110 (comment)
    Signed-off-by: Robert Einhorn <robert.einhorn.hu@gmail.com>
    
    ---------
    
    Signed-off-by: Robert Einhorn <robert.einhorn.hu@gmail.com>
    RobEin authored Jan 21, 2024
    Copy the full SHA
    d0440f4 View commit details

Commits on Jan 29, 2024

  1. Update README.md

    Signed-off-by: ericvergnaud <eric.vergnaud@wanadoo.fr>
    ericvergnaud authored Jan 29, 2024
    Copy the full SHA
    3c06d0a View commit details

Commits on Feb 7, 2024

  1. Generate meaningful exception message on checkVersion() failure (#4522)

    Currently, loading a parser from an incompatible version results in a message
    like:
    
      Could not deserialize ATN with version  (expected 4).
    
    (see e.g. #4041 )
    
    Change the exception message generation to use ord(version), so it shows e.g.
    the string 3 instead of the character with ordinal 3, which is non-printable
    and the cause for the above cryptic message.
    
    Signed-off-by: Raffaello D. Di Napoli <rafdev@dinapo.li>
    raffaellod authored Feb 7, 2024
    Copy the full SHA
    d0ddb32 View commit details

Commits on Feb 18, 2024

  1. Copy the full SHA
    8127454 View commit details

Commits on Feb 23, 2024

  1. fix: Suppress this-escape warning in generated Parser introduced in J…

    …DK 21.
    
    Signed-off-by: Niels Basjes <niels@basjes.nl>
    nielsbasjes authored and parrt committed Feb 23, 2024
    Copy the full SHA
    851ddee View commit details

Commits on Feb 24, 2024

  1. Remove dead link

    Signed-off-by: Eric Vergnaud <eric.vergnaud@wanadoo.fr>
    ericvergnaud authored and parrt committed Feb 24, 2024
    Copy the full SHA
    f08a19b View commit details

Commits on Feb 27, 2024

  1. Only log exceptions (for example LexerNoViableAltException) if debug …

    …is enabled for _interp.
    
    There is no other way to control this console output right now, seems like missed if check.
    [in progress]: unintentional exception is fired by Lexer along with passing it through error listener at the same time. This behavior changed.
    
    Signed-off-by: Aliaksandr Kukrash <multiarc@gmail.com>
    multiarc authored and ericvergnaud committed Feb 27, 2024
    Copy the full SHA
    bb48237 View commit details
  2. update CharStreams usage and revert change for exception logging

    Signed-off-by: Aliaksandr Kukrash <multiarc@gmail.com>
    multiarc authored and ericvergnaud committed Feb 27, 2024
    Copy the full SHA
    40b4942 View commit details
  3. Fix static method usage

    Signed-off-by: Aliaksandr Kukrash <multiarc@gmail.com>
    multiarc authored and ericvergnaud committed Feb 27, 2024
    Copy the full SHA
    1b3150b View commit details

Commits on Mar 10, 2024

  1. add test spec

    ericvergnaud committed Mar 10, 2024
    Copy the full SHA
    3658336 View commit details
  2. use array view

    ericvergnaud committed Mar 10, 2024
    Copy the full SHA
    cb195da View commit details
  3. oops

    ericvergnaud committed Mar 10, 2024
    Copy the full SHA
    e6ca29d View commit details
  4. refactor BitSet API

    Signed-off-by: Eric Vergnaud <eric.vergnaud@wanadoo.fr>
    ericvergnaud committed Mar 10, 2024
    Copy the full SHA
    967be76 View commit details
  5. document algorithm

    ericvergnaud committed Mar 10, 2024
    Copy the full SHA
    c3692cc View commit details
  6. more tests

    ericvergnaud committed Mar 10, 2024
    Copy the full SHA
    0908b58 View commit details
  7. fix formatting

    ericvergnaud committed Mar 10, 2024
    Copy the full SHA
    b49838a View commit details
  8. reuse slot

    ericvergnaud committed Mar 10, 2024
    Copy the full SHA
    2865844 View commit details

Commits on Mar 11, 2024

  1. add test spec for HashSet

    Signed-off-by: Eric Vergnaud <eric.vergnaud@wanadoo.fr>
    ericvergnaud committed Mar 11, 2024
    Copy the full SHA
    7d4ad89 View commit details
  2. improve HashSet performance

    Signed-off-by: Eric Vergnaud <eric.vergnaud@wanadoo.fr>
    ericvergnaud committed Mar 11, 2024
    Copy the full SHA
    1f5e64b View commit details
  3. Copy the full SHA
    69cfd8e View commit details

Commits on Mar 18, 2024

  1. Add parse listener methods to Parser typescript

    This PR adds the four parse listener methods. The `_parseListeners` field
    could also be set to `ParseTreeListener[]`, but it would _technically_ be
    a breaking change.
    
    I chose to use `ParseTreeListener` instead of `any` in these methods because
    parse listeners cannot actually be `any`; their functions are called without
    checking if they're defined. The current ParseTreeListener interface is the
    minimum requirement to avoid exceptions.
    
    Signed-off-by: Phlosioneer <mattmdrr2@gmail.com>
    Phlosioneer authored and ericvergnaud committed Mar 18, 2024
    Copy the full SHA
    b4c12ec View commit details

Commits on Mar 19, 2024

  1. depricate some methods

    Signed-off-by: Robert Einhorn <robert.einhorn.hu@gmail.com>
    RobEin authored and ericvergnaud committed Mar 19, 2024
    Copy the full SHA
    6ba4f8c View commit details
  2. Add override specifier to typescript copyfrom codegen

    Required for `"noImplicitOverride": true` typescript setting.
    
    I couldn't figure out how to add a test for this situation in the typescript
    test file. It only happens if a rule context class has a subclass.
    
    Signed-off-by: Phlosioneer <mattmdrr2@gmail.com>
    Phlosioneer authored and ericvergnaud committed Mar 19, 2024
    Copy the full SHA
    4a1963b View commit details

Commits on Mar 22, 2024

  1. fix missing 'this'

    Signed-off-by: Eric Vergnaud <eric.vergnaud@wanadoo.fr>
    ericvergnaud committed Mar 22, 2024
    Copy the full SHA
    990fbc2 View commit details

Commits on Mar 27, 2024

  1. Fixing crash bug in TokenStreamRewriter

    Order of operations issue - use before deleting not vice-versa.
    
    Signed-off-by: HS <hs@apotell.com>
    hs-apotell authored and parrt committed Mar 27, 2024
    Copy the full SHA
    0d30259 View commit details

Commits on Apr 1, 2024

  1. Fix incorrect this.channel access

    nextTokenOnChannel was accessing the field `this.channel` instead of the
    parameter `channel`. The buffered token stream class doesn't have a field
    named `channel`, so this exhausted the token buffer instead.
    
    The bug had not been caught because it is only called from `CommonTokenStream`
    with parameter `this.channel`.
    
    Signed-off-by: Phlosioneer <mattmdrr2@gmail.com>
    Phlosioneer authored and ericvergnaud committed Apr 1, 2024
    Copy the full SHA
    2244af3 View commit details

Commits on Apr 2, 2024

  1. golang: Add to quick checks to PredictionContext Equals checks (they …

    …are in use
    
    in other runtimes):
    
    1. If pointers are equal it's the same object
    2. If we are comparing singletons both types must be singletons
    
    Signed-off-by: Eytan Heidingsfeld <32422402+ehmm@users.noreply.github.com>
    ehmm authored and parrt committed Apr 2, 2024
    Copy the full SHA
    6628b00 View commit details

Commits on Apr 6, 2024

  1. [JS] Fix Parser.getSourceName returning undefined

    Parser.getSourceName was expecting a field `sourceName` on `TokenStream`,
    but that doesn't exist on any `TokenStream` implementation. This commit
    fixes the bug by calling `getSourceName`, which *is* defined on
    `BufferedTokenStream`.
    
    This commit also removes some nearby commented-out code that didn't make
    any sense.
    
    Signed-off-by: Phlosioneer <mattmdrr2@gmail.com>
    Phlosioneer authored and ericvergnaud committed Apr 6, 2024
    Copy the full SHA
    b486ce7 View commit details

Commits on Apr 8, 2024

  1. add missing constants

    ericvergnaud committed Apr 8, 2024
    Copy the full SHA
    360c86c View commit details

Commits on Apr 10, 2024

  1. Export InputMismatchException in index.js

    Signed-off-by: Hieu Nguyen <phieu221199@gmail.com>
    hieunguyen2211 authored and ericvergnaud committed Apr 10, 2024
    Copy the full SHA
    281b762 View commit details
  2. Fix Github Actions

    Install composer before using it.
    
    Signed-off-by: Andreas Buhr <andreas@andreasbuhr.de>
    andreasbuhr authored and ericvergnaud committed Apr 10, 2024
    Copy the full SHA
    6a71782 View commit details
  3. Switch CI to macos-12 and PHP 8.3

    Signed-off-by: Andreas Buhr <andreas@andreasbuhr.de>
    andreasbuhr authored and ericvergnaud committed Apr 10, 2024
    Copy the full SHA
    380ce4b View commit details

Commits on May 14, 2024

  1. Fix Linux compilation issue of ProfilingATNSimulator

    * NSEC_PER_SEC is available via CDispatch bindings, which are not currently imported
    * Importing them would be heavy handed compared to replacing with the constant (and leaving a comment)
    
    Signed-off-by: Will Ziener-Dignazio <wzienerdignazio@apple.com>
    WillDignazio authored and parrt committed May 14, 2024
    Copy the full SHA
    c0b7dd0 View commit details

Commits on May 15, 2024

  1. feat: Catch up 4.13.1 minor fixes and performance improvements

    Signed-off-by: Jim.Idle <jimi@idle.ws>
    jimidle authored and parrt committed May 15, 2024
    Copy the full SHA
    41b9360 View commit details
  2. feat: Catches up minor performance improvements and adds a build tag …

    …to build without mutex use
    
    when the user knows there will be no multiple access from go routines
    
    Signed-off-by: Jim.Idle <jimi@idle.ws>
    jimidle authored and parrt committed May 15, 2024
    Copy the full SHA
    057bd36 View commit details
  3. feat: Fix accidental keypress

    Signed-off-by: Jim.Idle <jimi@idle.ws>
    jimidle authored and parrt committed May 15, 2024
    Copy the full SHA
    2647323 View commit details

Commits on May 17, 2024

  1. Update C++ documentation to state that C++17 is required

    Signed-off-by: Andreas Buhr <andreas@andreasbuhr.de>
    andreasbuhr authored and parrt committed May 17, 2024
    Copy the full SHA
    6197d6c View commit details

Commits on May 31, 2024

  1. Fix singleton memory leaks

    Signed-off-by: Nick Nobles <nicholas_nobles@intuit.com>
    Nick Nobles authored and parrt committed May 31, 2024
    Copy the full SHA
    7d4cea9 View commit details
Showing with 1,027 additions and 353 deletions.
  1. +10 −10 .github/workflows/hosted.yml
  2. +4 −4 README.md
  3. +1 −1 antlr4-maven-plugin/pom.xml
  4. +1 −1 doc/cpp-target.md
  5. +15 −15 doc/getting-started.md
  6. +4 −4 doc/go-target.md
  7. +0 −2 doc/javascript-target.md
  8. +1 −1 doc/python-target.md
  9. +50 −50 doc/releasing-antlr.md
  10. +1 −1 doc/swift-target.md
  11. +1 −1 docker/Dockerfile
  12. +3 −3 pom.xml
  13. +1 −1 runtime-testsuite/pom.xml
  14. +19 −0 runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Keyword_1.txt
  15. +19 −0 runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Keyword_2.txt
  16. +19 −0 runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Keyword_3.txt
  17. +19 −0 runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Keyword_4.txt
  18. +19 −0 runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Keyword_5.txt
  19. +19 −0 runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Keyword_6.txt
  20. +1 −1 runtime-testsuite/resources/org/antlr/v4/test/runtime/helpers/package_ts.json
  21. +1 −1 runtime/CSharp/src/Antlr4.csproj
  22. +1 −1 runtime/CSharp/src/Properties/AssemblyInfo.cs
  23. +1 −1 runtime/CSharp/src/README.md
  24. +3 −3 runtime/CSharp/src/Tree/Xpath/XPathLexer.cs
  25. +1 −1 runtime/Cpp/VERSION
  26. +1 −1 runtime/Cpp/cmake/Antlr4Package.md
  27. +1 −1 runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake
  28. +1 −1 runtime/Cpp/cmake/FindANTLR.cmake
  29. +4 −4 runtime/Cpp/cmake/README.md
  30. +1 −1 runtime/Cpp/demo/generate.cmd
  31. +10 −2 runtime/Cpp/runtime/CMakeLists.txt
  32. +12 −9 runtime/Cpp/runtime/src/TokenStreamRewriter.cpp
  33. +1 −1 runtime/Cpp/runtime/src/Version.h
  34. +1 −1 runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp
  35. +3 −3 runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp
  36. +1 −1 runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h
  37. +1 −1 runtime/Dart/lib/src/runtime_meta_data.dart
  38. +1 −1 runtime/Dart/pubspec.yaml
  39. +1 −1 runtime/Go/antlr/README.adoc
  40. +0 −2 runtime/Go/antlr/go.sum
  41. +3 −3 runtime/Go/antlr/v4/antlrdoc.go
  42. +3 −5 runtime/Go/antlr/v4/atn.go
  43. +0 −3 runtime/Go/antlr/v4/atn_config.go
  44. +2 −3 runtime/Go/antlr/v4/jcollect.go
  45. +1 −0 runtime/Go/antlr/v4/ll1_analyzer.go
  46. +41 −0 runtime/Go/antlr/v4/mutex.go
  47. +31 −0 runtime/Go/antlr/v4/mutex_nomutex.go
  48. +6 −6 runtime/Go/antlr/v4/prediction_context.go
  49. +1 −1 runtime/Go/antlr/v4/recognizer.go
  50. +1 −2 runtime/Go/antlr/v4/statistics.go
  51. +53 −0 runtime/Go/antlr/v4/utils.go
  52. +1 −1 runtime/Java/pom.xml
  53. +1 −1 runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java
  54. +5 −1 runtime/JavaScript/README.md
  55. +2 −2 runtime/JavaScript/package-lock.json
  56. +11 −6 runtime/JavaScript/package.json
  57. +110 −0 runtime/JavaScript/spec/BitSetSpec.js
  58. +60 −0 runtime/JavaScript/spec/HashMapSpec.js
  59. +52 −0 runtime/JavaScript/spec/HashSetSpec.js
  60. +2 −3 runtime/JavaScript/spec/IntervalSetSpec.js
  61. +1 −1 runtime/JavaScript/spec/rewriter/Makefile
  62. +2 −2 runtime/JavaScript/spec/rewriter/TokenStreamRewriterSpec.js
  63. +1 −1 runtime/JavaScript/src/antlr4/BufferedTokenStream.js
  64. +2 −1 runtime/JavaScript/src/antlr4/CommonTokenStream.d.ts
  65. +3 −1 runtime/JavaScript/src/antlr4/Lexer.d.ts
  66. +20 −4 runtime/JavaScript/src/antlr4/Lexer.js
  67. +5 −0 runtime/JavaScript/src/antlr4/Parser.d.ts
  68. +2 −8 runtime/JavaScript/src/antlr4/Parser.js
  69. +3 −0 runtime/JavaScript/src/antlr4/Recognizer.d.ts
  70. +9 −1 runtime/JavaScript/src/antlr4/Recognizer.js
  71. +6 −1 runtime/JavaScript/src/antlr4/Token.d.ts
  72. +1 −1 runtime/JavaScript/src/antlr4/action/LexerModeAction.js
  73. +1 −1 runtime/JavaScript/src/antlr4/atn/ATNConfigSet.js
  74. +6 −6 runtime/JavaScript/src/antlr4/atn/LL1Analyzer.js
  75. +10 −10 runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js
  76. +2 −2 runtime/JavaScript/src/antlr4/atn/PredictionMode.js
  77. +1 −1 runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.d.ts
  78. +1 −1 runtime/JavaScript/src/antlr4/error/DiagnosticErrorListener.js
  79. +7 −7 runtime/JavaScript/src/antlr4/{index.d.ts → index.d.cts}
  80. +5 −3 runtime/JavaScript/src/antlr4/index.node.js
  81. +5 −3 runtime/JavaScript/src/antlr4/index.web.js
  82. +83 −13 runtime/JavaScript/src/antlr4/misc/BitSet.js
  83. +68 −38 runtime/JavaScript/src/antlr4/misc/HashMap.js
  84. +77 −28 runtime/JavaScript/src/antlr4/misc/HashSet.js
  85. +1 −1 runtime/JavaScript/src/antlr4/utils/standardEqualsFunction.js
  86. +2 −2 runtime/Python3/pyproject.toml
  87. +1 −1 runtime/Python3/src/antlr4/Recognizer.py
  88. +1 −1 runtime/Python3/src/antlr4/atn/ATNDeserializer.py
  89. +2 −2 runtime/Python3/src/antlr4/xpath/XPathLexer.py
  90. +7 −7 runtime/Python3/tests/TestIntervalSet.py
  91. +2 −2 runtime/Python3/tests/expr/ExprLexer.py
  92. +2 −2 runtime/Python3/tests/expr/ExprParser.py
  93. +1 −1 runtime/Swift/Sources/Antlr4/RuntimeMetaData.swift
  94. +1 −1 runtime/Swift/Sources/Antlr4/atn/ProfilingATNSimulator.swift
  95. +1 −0 scripts/files-to-update.txt
  96. +1 −1 tool-testsuite/pom.xml
  97. +1 −1 tool/pom.xml
  98. +4 −4 tool/resources/org/antlr/v4/tool/templates/codegen/Cpp/Cpp.stg
  99. +1 −1 tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg
  100. +2 −2 tool/resources/org/antlr/v4/tool/templates/codegen/PHP/PHP.stg
  101. +9 −6 tool/resources/org/antlr/v4/tool/templates/codegen/TypeScript/TypeScript.stg
  102. +1 −1 tool/src/org/antlr/v4/codegen/target/CppTarget.java
  103. +9 −1 tool/src/org/antlr/v4/codegen/target/DartTarget.java
  104. +5 −4 tool/src/org/antlr/v4/codegen/target/GoTarget.java
  105. +2 −1 tool/src/org/antlr/v4/codegen/target/JavaScriptTarget.java
  106. +4 −3 tool/src/org/antlr/v4/codegen/target/JavaTarget.java
  107. +2 −1 tool/src/org/antlr/v4/codegen/target/PHPTarget.java
  108. +2 −1 tool/src/org/antlr/v4/codegen/target/Python3Target.java
  109. +3 −3 tool/src/org/antlr/v4/codegen/target/TypeScriptTarget.java
20 changes: 10 additions & 10 deletions .github/workflows/hosted.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
os: [
macos-11,
macos-12,
ubuntu-20.04,
windows-2022
]
@@ -160,7 +160,7 @@ jobs:
fail-fast: false
matrix:
os: [
macos-11,
macos-12,
ubuntu-20.04,
windows-2022
]
@@ -196,6 +196,14 @@ jobs:
repository: antlr/antlr-php-runtime
path: runtime/PHP

- name: Setup PHP 8.2
if: matrix.target == 'php'
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring
tools: composer

- name: Install dependencies
env:
COMPOSER_CACHE_DIR: ${{ github.workspace }}/.cache
@@ -263,14 +271,6 @@ jobs:
with:
go-version: '^1.19'

- name: Setup PHP 8.2
if: matrix.target == 'php'
uses: shivammathur/setup-php@2.22.0
with:
php-version: '8.2'
extensions: mbstring
tools: composer

- name: Setup Swift
if: matrix.target == 'swift'
uses: swift-actions/setup-swift@v1.19.0
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
## Versioning

ANTLR 4 supports 10 target languages
(Cpp, CSharp, Dart, Java, JavaScript, PHP, Python3, Swift, TypeScript),
(Cpp, CSharp, Dart, Java, JavaScript, PHP, Python3, Swift, TypeScript, Go),
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:
@@ -54,7 +54,7 @@ The dedicated Go repo is for `go get` and `import` only. Go runtime development
ANTLR project lead and supreme dictator for life
[University of San Francisco](http://www.usfca.edu/)
* [Sam Harwell](http://tunnelvisionlabs.com/) (Tool co-author, Java and original C# target)
* [Eric Vergnaud](https://github.com/ericvergnaud) (Javascript, Python2, Python3 targets and maintenance of C# target)
* [Eric Vergnaud](https://github.com/ericvergnaud) (Javascript, TypeScript, Python2, Python3 targets and maintenance of C# target)
* [Peter Boyer](https://github.com/pboyer) (Go target)
* [Mike Lischke](http://www.soft-gems.net/) (C++ completed target)
* Dan McLaughlin (C++ initial target)
@@ -77,7 +77,7 @@ 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#, Python3, 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, TypeScript, 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
@@ -96,7 +96,7 @@ You might also find the following pages useful, particularly if you want to mess

Programmers run into parsing problems all the time. Whether it’s a data format like JSON, a network protocol like SMTP, a server configuration file for Apache, a PostScript/PDF file, or a simple spreadsheet macro language—ANTLR v4 and this book will demystify the process. ANTLR v4 has been rewritten from scratch to make it easier than ever to build parsers and the language applications built on top. This completely rewritten new edition of the bestselling Definitive ANTLR Reference shows you how to take advantage of these new features.

You can buy the book [The Definitive ANTLR 4 Reference](http://amzn.com/1934356999) at amazon or an [electronic version at the publisher's site](https://pragprog.com/book/tpantlr2/the-definitive-antlr-4-reference).
You can buy the book [The Definitive ANTLR 4 Reference](http://amzn.com/dp/1934356999) at amazon or an [electronic version at the publisher's site](https://pragprog.com/book/tpantlr2/the-definitive-antlr-4-reference).

You will find the [Book source code](http://pragprog.com/titles/tpantlr2/source_code) useful.

2 changes: 1 addition & 1 deletion antlr4-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
<parent>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.13.1</version>
<version>4.13.2</version>
</parent>
<artifactId>antlr4-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
2 changes: 1 addition & 1 deletion doc/cpp-target.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# C++

The C++ target supports all platforms that can either run MS Visual Studio 2013 (or newer), XCode 7 (or newer) or CMake (C++11 required). All build tools can either create static or dynamic libraries, both as 64bit or 32bit arch. Additionally, XCode can create an iOS library. Also see [Antlr4 for C++ with CMake: A practical example](http://blorente.me/beyond-the-loop/Antlr-cpp-cmake/).
The C++ target supports all platforms that can either run MS Visual Studio 2017 (or newer), XCode 7 (or newer) or CMake (C++17 required). All build tools can either create static or dynamic libraries, both as 64bit or 32bit arch. Additionally, XCode can create an iOS library. Also see [Antlr4 for C++ with CMake: A practical example](http://blorente.me/beyond-the-loop/Antlr-cpp-cmake/).

## How to create a C++ lexer or parser?
This is pretty much the same as creating a Java lexer or parser, except you need to specify the language target, for example:
30 changes: 15 additions & 15 deletions doc/getting-started.md
Original file line number Diff line number Diff line change
@@ -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
...
@@ -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).

@@ -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
@@ -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
...
@@ -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
...
8 changes: 4 additions & 4 deletions doc/go-target.md
Original file line number Diff line number Diff line change
@@ -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

@@ -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
@@ -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
```

2 changes: 0 additions & 2 deletions doc/javascript-target.md
Original file line number Diff line number Diff line change
@@ -40,8 +40,6 @@ Once you've generated the lexer and/or parser code, you need to download the run

The JavaScript runtime is [available from npm](https://www.npmjs.com/package/antlr4).

If you can't use npm, the JavaScript runtime is also available from the ANTLR web site [download section](http://www.antlr.org/download/index.html). The runtime is provided in the form of source code, so no additional installation is required.

We will not document here how to refer to the runtime from your project, since this would differ a lot depending on your project type and IDE.

## How do I get the runtime in my browser?
2 changes: 1 addition & 1 deletion doc/python-target.md
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ must include a reference to the Antlr Python3 runtime.
You should provide a script that builds the program.
```
pip install -r requirements.txt
antlr4 -v 4.13.0 -Dlanguage=Python3 Expr.g4
antlr4 -Dlanguage=Python3 Expr.g4
```
_It is vital that the versions for the
Antlr tool used to generate the parser
Loading