ports/java/jflex/files/patch-jflex
Greg Lewis a69622a594 Add a port of jflex:
JFlex is a lexical analyzer generator for Java written in Java.
It is also a rewrite of the very useful tool JLex which was developed
by Elliot Berk at Princeton University. As Vern Paxon states for his C/C++
tool flex: They do not share any code though.

WWW: http://www.jflex.de/

I've done some clean up to the submitted version of the port.

PR:		62043
Submitted by:	Conor McDermottroe <ports@mcdermottroe.com>
2004-02-18 19:50:33 +00:00

72 lines
1.7 KiB
Plaintext

--- bin/jflex.orig Mon Oct 1 04:18:48 2001
+++ bin/jflex Wed Feb 18 12:19:00 2004
@@ -1,51 +1,19 @@
-#! /bin/bash
+#!/bin/sh
#
-# JFlex start script $Revision: 1.16 $
-#
-# if Java is not in your binary path, you need to supply its
-# location in this script. The script automatically finds
-# JFLEX_HOME when called directly, via binary path, or symbolic
-# link.
-#
-# Site wide installation: simply make a symlink from e.g.
-# /usr/bin/jflex to this script at its original position
-#
-#===================================================================
-#
-# configurables:
-
-# path to the java interpreter
-JAVA=java
-
-# end configurables
-#
-#===================================================================
-#
-
-# calculate true location
-
-PRG=`type $0`
-PRG=${PRG##* }
-
-# If PRG is a symlink, trace it to the real home directory
-
-while [ -L "$PRG" ]
-do
- newprg=$(ls -l ${PRG})
- newprg=${newprg##*-> }
- [ ${newprg} = ${newprg#/} ] && newprg=${PRG%/*}/${newprg}
- PRG="$newprg"
-done
-
-PRG=${PRG%/*}
-JFLEX_HOME=${PRG}/..
-
-# --------------------------------------------------------------------
-
-export CLASSPATH
-CLASSPATH=$JFLEX_HOME/lib/JFlex.jar
-
-$JAVA JFlex.Main $@
+# Replacement for the script that came with JFlex
+# because bash is not necessarily on a FreeBSD
+# machine. Also, we know where the jar is.
+#
+# Conor McDermottroe <ports@mcdermottroe.com>
+
+# Allow the user to override where JFlex.jar lives
+if [ -z "$JAVAJARDIR" ]; then
+ JAVAJARDIR=%%JAVAJARDIR%%
+fi
+
+# Allow the user to specify which java interpreter to use
+if [ -z "$JAVA" ]; then
+ JAVA="`which javavm`"
+fi
-#for more memory:
-#$JAVA -Xmx128m JFlex.Main $@
+$JAVA -jar $JAVAJARDIR/JFlex.jar $@