Skip to content

Commit 36ddcb2

Browse files
author
Florent Bécart
committed
Add javacc-5.0 folder (required for ant build)
1 parent 67c9150 commit 36ddcb2

File tree

158 files changed

+34321
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+34321
-0
lines changed

javacc-5.0/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2006, Sun Microsystems, Inc.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice,
8+
this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above copyright
10+
notice, this list of conditions and the following disclaimer in the
11+
documentation and/or other materials provided with the distribution.
12+
* Neither the name of the Sun Microsystems, Inc. nor the names of its
13+
contributors may be used to endorse or promote products derived from
14+
this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26+
THE POSSIBILITY OF SUCH DAMAGE.
27+

javacc-5.0/bin/javacc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
JAR="`dirname $0`/lib/javacc.jar"
3+
4+
case "`uname`" in
5+
CYGWIN*) JAR="`cygpath --windows -- "$JAR"`" ;;
6+
esac
7+
8+
java -classpath "$JAR" javacc "$@"
9+

javacc-5.0/bin/javacc.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
@echo off
3+
4+
java -classpath "%~dp0lib\javacc.jar;%~dp0lib\javacc.jar;%~f0\..\lib\javacc.jar" javacc %1 %2 %3 %4 %5 %6 %7 %8 %9

javacc-5.0/bin/jjdoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
JAR="`dirname $0`/lib/javacc.jar"
3+
4+
case "`uname`" in
5+
CYGWIN*) JAR="`cygpath --windows -- "$JAR"`" ;;
6+
esac
7+
8+
java -classpath "$JAR" jjdoc "$@"
9+

javacc-5.0/bin/jjdoc.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
@echo off
3+
4+
java -classpath "%~dp0lib\javacc.jar;%~f0\..\lib\javacc.jar" jjdoc %1 %2 %3 %4 %5 %6 %7 %8 %9

javacc-5.0/bin/jjrun

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
#!/bin/sh
2+
####################################################################
3+
#
4+
# Copyright (C) 2006 Andrew Tomazos <andrew@tomazos.com>
5+
#
6+
# This program is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU General Public License
8+
# as published by the Free Software Foundation; either version 2
9+
# of the License, or (at your option) any later version.
10+
#
11+
####################################################################
12+
#
13+
# jjrun 1.0d1
14+
#
15+
# - Build and execute a JavaCC .jj file in one command
16+
#
17+
# - Requires javacc, java, make and sh
18+
#
19+
# - TODO: If you use something other than SimpleCharStream you
20+
# will need to modify the OBJECTS variable below
21+
#
22+
# - TODO: Only tested on GNU/Linux
23+
#
24+
####################################################################
25+
26+
# $PROGFILE: This programs file path
27+
PROGFILE=$0
28+
29+
# $VERSION: This programs version
30+
VERSION=1.0d1
31+
32+
# $PROGNAME: This programs name
33+
PROGNAME=`basename $0`
34+
35+
# If project not specified output usage and exit
36+
if [ ! $1 ]
37+
then
38+
echo "USAGE: $PROGNAME <jjfile>"
39+
exit 1
40+
fi
41+
42+
# $PROJECT: The jj file to run
43+
PROJECT=`basename $1 .jj`
44+
45+
# $MAKEFILE: An automatically generated makefile
46+
MAKEFILE=$PROJECT.mk
47+
48+
# $FORCE: forces the regeneration of the makefile
49+
FORCE=$2
50+
51+
52+
# If the specified project does not exist than exit
53+
if [ ! -f $PROJECT.jj ]
54+
then
55+
echo ERROR: $PROGNAME: File not found $PROJECT.jj
56+
exit 1
57+
fi
58+
59+
# If forcing makefile regeneration than delete the makefile
60+
if [ $FORCE ]
61+
then
62+
rm $MAKEFILE
63+
fi
64+
65+
# If the makefile does not exist than generate it
66+
if [ ! -f $MAKEFILE ]
67+
then
68+
echo $PROGNAME: Generating $MAKEFILE...
69+
70+
#### START jjrun_makefile_header_here_doc
71+
cat > $MAKEFILE <<jjrun_makefile_header_here_doc
72+
# Automatically generated makefile for $PROJECT by $PROGNAME $VERSION
73+
74+
# Copyright (C) 2006 Andrew Tomazos <andrew@tomazos.com>
75+
#
76+
# This program is free software; you can redistribute it and/or
77+
# modify it under the terms of the GNU General Public License
78+
# as published by the Free Software Foundation; either version 2
79+
# of the License, or (at your option) any later version.
80+
81+
# ${PROJECT}: Name of the project
82+
PROJECT=$PROJECT
83+
84+
# ${MAKEFILE}: Filename of this makefile
85+
MAKEFILE=$MAKEFILE
86+
87+
# ${PROGFILE}: Filepath of $PROGNAME
88+
PROGFILE=$PROGFILE
89+
90+
jjrun_makefile_header_here_doc
91+
#### END jjrun_makefile_header_here_doc
92+
93+
#### START jjrun_makefile_main_here_doc
94+
cat >> $MAKEFILE <<'jjrun_makefile_main_here_doc'
95+
96+
# ${JJ}: The original .jj file
97+
JJ=${PROJECT}.jj
98+
99+
# ${AUTOGENS}: The automatically generated classed of javacc
100+
AUTOGENS= \
101+
${PROJECT} \
102+
${PROJECT}Constants \
103+
${PROJECT}TokenManager
104+
105+
# ${BOILERS}: The boilerplate classes generated by javacc
106+
BOILERS= \
107+
SimpleCharStream \
108+
ParseException \
109+
Token \
110+
TokenMgrError
111+
112+
# ${OBJECTS}: The names of the classes output by javacc
113+
OBJECTS=${AUTOGENS} ${BOILERS}
114+
115+
# ${BOILERSOURCES}: The boilerplater sources files output by javacc
116+
BOILERSOURCES=$(addsuffix .java, ${BOILERS})
117+
118+
# ${SOURCES}: The source files output by javacc
119+
SOURCES=$(addsuffix .java, ${OBJECTS})
120+
121+
# ${CLASSES}: The class files compiled with javac from the output of javacc
122+
CLASSES=$(addsuffix .class, ${OBJECTS})
123+
124+
# ${MANIFEST}: filename of the manifest for the final jar file
125+
MANIFEST=${PROJECT}.mf
126+
127+
# ${JAR}: filename of the final jar file
128+
JAR=${PROJECT}.jar
129+
130+
# make build rule to make JAR
131+
build: ${JAR}
132+
133+
# make ${JAR}: build the jar file
134+
${JAR}: ${SOURCES} ${MANIFEST}
135+
@echo ${MAKEFILE}: Building ${JAR}...
136+
javac ${SOURCES}
137+
jar cvfm ${JAR} ${MANIFEST} ${CLASSES}
138+
rm ${CLASSES}
139+
140+
# make clean: remove all generated jar files
141+
clean:
142+
@echo ${MAKEFILE}: Cleaning ${PROJECT}...
143+
@-rm ${JAR} ${SOURCES} ${MANIFEST}
144+
145+
# make ${SOURCES}: compile the jj file into java sources
146+
${SOURCES}: ${JJ}
147+
@echo ${MAKEFILE}: Compiling ${JJ}...
148+
@javacc ${JJ}
149+
touch -c ${BOILERSOURCES}
150+
151+
# make ${MANIFEST}: rule to make
152+
${MANIFEST}:
153+
@echo ${MAKEFILE}: Creating manifest...
154+
@echo Manifest-Version: 1.0 > ${MANIFEST}
155+
@echo Main-Class: ${PROJECT} >> ${MANIFEST}
156+
157+
${MAKEFILE}: ${PROGFILE}
158+
@echo ${MAKEFILE}: Regenerating ${MAKEFILE}
159+
@${PROGFILE} ${PROJECT} FORCE
160+
161+
jjrun_makefile_main_here_doc
162+
# END jjrun_makefile_main_here_doc
163+
164+
fi
165+
166+
# If this was a forced regeneration than stop here
167+
if [ $FORCE ]
168+
then
169+
exit 0
170+
fi
171+
172+
# Execute the makefile to rebuild the jar file if necessary
173+
echo $PROGNAME: Executing $MAKEFILE...
174+
make -f $MAKEFILE
175+
176+
# Execute the jar file
177+
echo $PROGNAME: Executing $PROJECT.jar...
178+
java -jar $PROJECT.jar
179+

javacc-5.0/bin/jjtree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
JAR="`dirname $0`/lib/javacc.jar"
3+
4+
case "`uname`" in
5+
CYGWIN*) JAR="`cygpath --windows -- "$JAR"`" ;;
6+
esac
7+
8+
java -classpath "$JAR" jjtree "$@"
9+

javacc-5.0/bin/jjtree.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
@echo off
3+
4+
java -classpath "%~dp0lib\javacc.jar;%~f0\..\lib\javacc.jar" jjtree %1 %2 %3 %4 %5 %6 %7 %8 %9

javacc-5.0/bin/lib/javacc.jar

292 KB
Binary file not shown.

0 commit comments

Comments
 (0)