launch_grun.bat 861 B

123456789101112131415161718192021222324
  1. REM this batch is a helper for developers who installed ANTLR4 in their system (and JDK),
  2. REM to launch the ANTLR SDK Tool: GRUN. Grun is a trivial client of the Antlr4 API,
  3. REM it just parses a source. It can output the AST in text mode, with -ast switch.
  4. REM or, like in this batch, a window with a graph visualizer with the -gui switch.
  5. REM This helps when working with the grammar file azslParser.g4 to see what happens
  6. REM to the parse tree.
  7. @echo off
  8. @echo launch_grun is a helper to visualize parse trees from .azsl files
  9. setlocal
  10. if "%~1" == "" (
  11. set /p thepath="Enter path to file to compile: "
  12. ) else (
  13. set thepath=%~1
  14. )
  15. pushd
  16. cd "%~dp0\src\generated\java"
  17. SET CLASSPATH=.;"..\..\external\antlr-4.9.3-complete.jar";%CLASSPATH%
  18. set grun=java -cp %CLASSPATH% org.antlr.v4.gui.TestRig
  19. %grun% azsl compilationUnit -gui "%thepath%"
  20. popd
  21. endlocal