1 |
schoenebeck |
2885 |
#!/bin/sh |
2 |
|
|
# |
3 |
|
|
# Generates the NKSP syntax higlighting scanner's C++ source file |
4 |
|
|
# (nksp.cpp in src/scriptvm/editor) according to the NKSP instrument script |
5 |
|
|
# regular expressions given by src/scriptvm/editor/nksp.l. This is not used |
6 |
|
|
# for the sampler's own instrument parser, but rather to provide syntax |
7 |
|
|
# highlighting for NKSP documents for external text editor applications. |
8 |
|
|
|
9 |
|
|
SCRIPTS_DIR=`dirname $0` |
10 |
|
|
PARSER_SRC_DIR="$SCRIPTS_DIR/../src/scriptvm/editor" |
11 |
|
|
|
12 |
|
|
echo -n "Searching for lexer..." |
13 |
|
|
|
14 |
|
|
LEX_CMD=NONE |
15 |
|
|
if which "flex" > /dev/null; then |
16 |
|
|
LEX_CMD=`which flex` |
17 |
|
|
elif which "lex" > /dev/null; then |
18 |
|
|
LEX_CMD=`which lex` |
19 |
|
|
else |
20 |
|
|
echo "Error: You need lex (or flex) to generate the NKSP syntax highlighting scanner !" |
21 |
|
|
exit -1 |
22 |
|
|
fi |
23 |
|
|
|
24 |
|
|
echo "OK ($LEX_CMD)" |
25 |
|
|
|
26 |
|
|
echo -n "Generating NKSP editor syntax highlighting scanner ... " |
27 |
|
|
( |
28 |
|
|
cd $PARSER_SRC_DIR |
29 |
|
|
|
30 |
|
|
$LEX_CMD nksp.l |
31 |
schoenebeck |
2888 |
mv -f lex.Nksp_.c nksp.cpp 2>/dev/null |
32 |
schoenebeck |
2885 |
) |
33 |
|
|
echo "Done" |