#! /bin/sh

if [ -z "$SABLECC_HOME" ] ; then
    SABLECC_HOME=/usr/pkg
fi

if [ "$JAVA_HOME" != "" ] ; then
  if [ "$JAVACMD" = "" ] ; then
    JAVACMD=$JAVA_HOME/bin/java
  fi
else
  JAVA_HOME=/usr/pkg/java/openjdk17
  if [ "$JAVACMD" = "" ] ; then
    JAVACMD=$JAVA_HOME/bin/java
  fi
fi

${JAVACMD} -jar ${SABLECC_HOME}/lib/java/sablecc.jar "$@"
