Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
52 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#define TRIAGENS_VERSION "0.0.8 [1101:1102M]" | ||
#define TRIAGENS_VERSION "0.0.8 [exported]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,46 @@ | ||
#!/bin/sh | ||
|
||
BISON="$1" | ||
SRC="$2" | ||
DST="$2" | ||
FILE="$3" | ||
OUTPUT="$2" | ||
INPUT="$3" | ||
|
||
if test "x$BISON" = x -o "x$SRC" = x -o "x$DST" = x -o "x$FILE" = x; then | ||
echo "usage: $0 <bison> <directory> <file-prefix>" | ||
exit 1 | ||
fi | ||
|
||
if test ! -d "$SRC"; then | ||
echo "$0: expecting '$SRC' to be a directory" | ||
exit 1 | ||
fi | ||
|
||
if test ! -d "$DST"; then | ||
echo "$0: expecting '$DST' to be a directory" | ||
if test "x$BISON" = x -o "x$OUTPUT" = x -o "x$INPUT" = x; then | ||
echo "usage: $0 <bison> <output> <input>" | ||
exit 1 | ||
fi | ||
|
||
############################################################################# | ||
## bison | ||
############################################################################# | ||
|
||
${BISON} -l -d -ra -S lalr1.cc -o "${DST}/${FILE}.cpp" "${SRC}/${FILE}.yy" | ||
${BISON} -l -d -ra -S lalr1.cc -o ${OUTPUT} ${INPUT} | ||
|
||
############################################################################# | ||
## sanity checks | ||
############################################################################# | ||
|
||
test -f ${SRC}/${FILE}.hpp || exit 1 | ||
test -f ${SRC}/${FILE}.cpp || exit 1 | ||
test -f ${SRC}/position.hh || exit 1 | ||
PREFIX=`echo ${OUTPUT} | sed -e 's:\.cpp$::'` | ||
|
||
test -f ${PREFIX}.hpp || exit 1 | ||
test -f ${PREFIX}.cpp || exit 1 | ||
|
||
############################################################################# | ||
## rename file | ||
############################################################################# | ||
|
||
mv ${SRC}/${FILE}.hpp ${SRC}/${FILE}.h || exit 1 | ||
mv ${PREFIX}.hpp ${PREFIX}.h || exit 1 | ||
|
||
############################################################################# | ||
## fix header file name in source, fix defines | ||
############################################################################# | ||
|
||
sed -e 's:\.hpp:.h:' < ${SRC}/${FILE}.cpp \ | ||
sed -e 's:\.hpp:.h:' < ${OUTPUT} \ | ||
| sed -e 's:# if YYENABLE_NLS:# if defined(YYENABLE_NLS) \&\& YYENABLE_NLS:' \ | ||
> ${SRC}/${FILE}.cpp.tmp | ||
> ${OUTPUT}.tmp | ||
|
||
# give some information | ||
diff -u ${SRC}/${FILE}.cpp ${SRC}/${FILE}.cpp.tmp | ||
diff -u ${OUTPUT} ${OUTPUT}.tmp | ||
|
||
# and move the files to the final destination | ||
mv ${SRC}/${FILE}.cpp.tmp ${SRC}/${FILE}.cpp || exit 1 | ||
mv ${OUTPUT}.tmp ${OUTPUT} || exit 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,36 @@ | ||
#!/bin/sh | ||
|
||
FLEX="$1" | ||
DIR="$2" | ||
FILE="$3" | ||
OUTPUT="$2" | ||
INPUT="$3" | ||
|
||
if test "x$FLEX" = "x" -o "x$DIR" = "x" -o "x$FILE" = "x" -o ! -d "$DIR"; then | ||
echo "usage: $0 <flex> <directory> <file-prefix>" | ||
exit 1 | ||
fi | ||
|
||
if test ! -d "$DIR"; then | ||
echo "$0: expecting '$DIR' to be a directory" | ||
if test "x$FLEX" = "x" -o "x$OUTPUT" = "x" -o "x$INPUT" = "x"; then | ||
echo "usage: $0 <flex> <output> <input>" | ||
exit 1 | ||
fi | ||
|
||
############################################################################# | ||
## flex | ||
############################################################################# | ||
|
||
${FLEX} -L -o${DIR}/${FILE}.cpp ${DIR}/${FILE}.ll | ||
${FLEX} -L -o${OUTPUT} ${INPUT} | ||
|
||
############################################################################# | ||
## sanity checks | ||
############################################################################# | ||
|
||
test -f ${DIR}/${FILE}.cpp || exit 1 | ||
test -f ${OUTPUT} || exit 1 | ||
|
||
############################################################################# | ||
## fix casts | ||
############################################################################# | ||
|
||
cat ${DIR}/${FILE}.cpp \ | ||
cat ${OUTPUT} \ | ||
| sed -e 's:(yy_n_chars), (size_t) num_to_read );:(yy_n_chars), (int) num_to_read );:' \ | ||
> ${DIR}/${FILE}.cpp.tmp | ||
> ${OUTPUT}.tmp | ||
|
||
# give some information | ||
diff -u ${DIR}/${FILE}.cpp ${DIR}/${FILE}.cpp.tmp | ||
diff -u ${OUTPUT} ${OUTPUT}.tmp | ||
|
||
# and move the files to the final destination | ||
mv ${DIR}/${FILE}.cpp.tmp ${DIR}/${FILE}.cpp || exit 1 | ||
mv ${OUTPUT}.tmp ${OUTPUT} || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,37 @@ | ||
#!/bin/sh | ||
|
||
FLEX="$1" | ||
DIR="$2" | ||
FILE="$3" | ||
OUTPUT="$2" | ||
INPUT="$3" | ||
|
||
if test "x$FLEX" = "x" -o "x$DIR" = "x" -o "x$FILE" = "x" -o ! -d "$DIR"; then | ||
echo "usage: $0 <flex> <directory> <file-prefix>" | ||
exit 1 | ||
fi | ||
|
||
if test ! -d "$DIR"; then | ||
echo "$0: expecting '$DIR' to be a directory" | ||
if test "x$FLEX" = "x" -o "x$OUTPUT" = "x" -o "x$INPUT" = "x"; then | ||
echo "usage: $0 <flex> <output> <input>" | ||
exit 1 | ||
fi | ||
|
||
############################################################################# | ||
## flex | ||
############################################################################# | ||
|
||
${FLEX} -L -o${DIR}/${FILE}.c ${DIR}/${FILE}.l | ||
${FLEX} -L -o${OUTPUT} ${INPUT} | ||
|
||
############################################################################# | ||
## sanity checks | ||
############################################################################# | ||
|
||
test -f ${DIR}/${FILE}.c || exit 1 | ||
test -f ${OUTPUT} || exit 1 | ||
|
||
############################################################################# | ||
## fix casts | ||
############################################################################# | ||
|
||
cat ${DIR}/${FILE}.c \ | ||
cat ${OUTPUT} \ | ||
| sed -e 's:yy_n_chars, (size_t) num_to_read );:yy_n_chars, (int) num_to_read );:' \ | ||
| sed -e 's:extern int isatty (int );:#ifndef _WIN32\ | ||
\0\ | ||
#endif:' \ | ||
> ${DIR}/${FILE}.c.tmp | ||
| awk '$0 == "extern int isatty (int );" {print "#ifndef _WIN32"; print $0; print "#endif"; next;} {print $0}' \ | ||
> ${OUTPUT}.tmp | ||
|
||
# give some information | ||
diff -u ${DIR}/${FILE}.c ${DIR}/${FILE}.c.tmp | ||
diff -u ${OUTPUT} ${OUTPUT}.tmp | ||
|
||
# and move the files to the final destination | ||
mv ${DIR}/${FILE}.c.tmp ${DIR}/${FILE}.c || exit 1 | ||
mv ${OUTPUT}.tmp ${OUTPUT} || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters