source: other-projects/gli-rsyntax-textarea/REGENERATE-FLEX.sh@ 25684

Last change on this file since 25684 was 25684, checked in by davidb, 10 years ago

Improved reporting of what processing was undertaken, and other adjustments to make the scripts work on Cygwin under Windows

File size: 1.2 KB
Line 
1#!/bin/bash
2
3pushd src/java/org/fife/ui/rsyntaxtextarea/modes/ > /dev/null
4
5
6editedFlex=0;
7unchangedFlex=0;
8
9flex_jar=$GEXTRSYNTAX/lib/JFlex.jar
10
11if [ "x$GSDLOS" = "xcygwin" ] ; then
12 flex_jar=`cygpath -w $flex_jar | sed 's/\\\\/\\\\\\\\/g'`
13elif [ "x$GSDLOS" = "xmingw" ] ; then
14 flex_jar=`echo $flex_jar | sed 's/^\/\(.\)/\1:/' | sed 's@/@\\\\@g'`
15fi
16
17
18for f in *.flex ; do
19# echo "Checking $f ..."
20 j="${f%.*}.java"
21 if [ "$f" -nt "$j" ] ; then
22 echo ""
23 echo "****"
24 echo "* Regenerating $f"
25 echo "****"
26 echo ""
27
28 java -cp "$flex_jar" JFlex.Main $f
29 #bash -x jflex $f
30
31 cat $j \
32 | sed 's/yyreset/YYRESETOLD/g' \
33 | sed 's/YYRESETNEW/yyreset/g' \
34 | sed 's/zzRefill/YYREFILLOLD/g' \
35 | sed 's/ZZREFILLNEW/zzRefill/g' \
36 > $j.new
37
38 /bin/mv $j.new $j
39 ((editedFlex +=1))
40
41 else
42# echo "... does not need to be regenerated"
43 ((unchangedFlex +=1))
44 fi
45
46
47done
48
49echo "===="
50echo "$unchangedFlex Flex files unchanged"
51echo ""
52
53if [ $editedFlex -ge "1" ] ; then
54 echo ""
55 echo "****"
56 echo "* $editedFlex flex file(s) regenerated."
57 echo "* Use ./COMPILE.sh to recompile the modified code and regenerate the jar file"
58 echo "****"
59 echo ""
60fi
61
62popd > /dev/null
63
Note: See TracBrowser for help on using the repository browser.