This is only required by the developer to re-generate the lexer/parser based on a grammar file.


Download antlr4:

cd /usr/local/lib
sudo curl -O

Add some convenience aliases to .bash_aliases:

export CLASSPATH=".:/usr/local/lib/antlr-4.9.3-complete.jar:$CLASSPATH"
alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.9.3-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
alias grun='java org.antlr.v4.gui.TestRig'

Extra alias used in py3antlr4book examples:

alias antlr4py3='antlr4 -Dlanguage=Python3'

Antlr API reference:

Upgrading the Antlr version

  • Download latest jar file (See above)

  • Install latest python packages:

    python3 -m pip install --user -U antlr4-python3-runtime speedy-antlr-tool mypy
  • Download C++ runtime source distribution from

    • Extract zip

    • Update: <zip file>/runtime/src to systemrdl/parser/ext/antlr4-cpp-runtime

  • Update systemrdl/parser/ to point to the latest antlr jar

  • Run systemrdl/parser/

  • Increment systemrdl minor version

  • Update antlr runtime version pins in

  • Run unit tests

  • Publish release!