Commit d1d06faf authored by Miklos Magyari's avatar Miklos Magyari
Browse files

Added -av switch to .g4 compilation scripts so an alternative antlr version...


Added -av switch to .g4 compilation scripts so an alternative antlr version can be specified other than default 4.3
Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent 113d92b9
......@@ -11,10 +11,26 @@
@rem #
@rem ###############################################################################
@echo off
@set ANTLR_VERSION=4.3
:loop
@if not "%1"=="" (
@if "%1"=="-av" (
@set ANTLR_VERSION=%2
@shift
)
@shift
@goto :loop
)
@echo Using antlr version %ANTLR_VERSION%
@set CURDIR=%cd%
@set DIR=%~dp0
@set WORKSPACE_PATH=%DIR%\..
@set ANTLR=-cp %HOMEDRIVE%%HOMEPATH%\lib\\antlr-4.3-complete.jar org.antlr.v4.Tool
@set ANTLR=-cp %HOMEDRIVE%%HOMEPATH%\lib\\antlr-%ANTLR_VERSION%-complete.jar org.antlr.v4.Tool
@cd %WORKSPACE_PATH%\org.eclipse.titan.runtime\src\org\eclipse\titan\runtime\core\cfgparser\
@java %ANTLR% RuntimeCfgLexer.g4 -no-listener -no-visitor -encoding UTF-8 -package org.eclipse.titan.runtime.core.cfgparser
......
......@@ -21,7 +21,24 @@
set -e
set -o pipefail
ANTLR4="java -classpath $HOME/lib/antlr-4.3-complete.jar org.antlr.v4.Tool"
ANTLR_VERSION=4.3
while :
do
case $1 in
-av)
ANTLR_VERSION=$2
shift
;;
*)
break;
esac
shift
done
ANTLR4="java -classpath $HOME/lib/antlr-${ANTLR_VERSION}-complete.jar org.antlr.v4.Tool"
echo Using antlr version $ANTLR_VERSION
# script directory
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-which-directory-it-is-stored-in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment