/[svn]/linuxsampler/trunk/scripts/generate_instrument_script_parser.sh
ViewVC logotype

Contents of /linuxsampler/trunk/scripts/generate_instrument_script_parser.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2581 - (show annotations) (download) (as text)
Fri May 30 12:48:05 2014 UTC (6 years ago) by schoenebeck
File MIME type: application/x-sh
File size: 1249 byte(s)
* (WIP) Implemented parser and VM for upcoming new real-time instrument
  script support. It needs yet to be integrated into the sampler's
  sampler engines. You can toy around for now with the command line tool
  "ls_instr_script" and i.e. examples showing the core language features
  under src/scriptvm/examples/.
* Bumped version (1.0.0.svn41).

1 #!/bin/sh
2 #
3 # Generates the instrument script parser's C++ source files
4 # (parser.h, parser.cpp and scanner.cpp in and src/scriptvm/) according to the
5 # instrument script (BNF) grammar definition given by src/scriptvm/parser.y and
6 # the terminal symbol scanner/lexer defintion given by src/scriptvm/scanner.l
7
8 SCRIPTS_DIR=`dirname $0`
9 PARSER_SRC_DIR="$SCRIPTS_DIR/../src/scriptvm"
10
11 echo -n "Searching for lexer and parser generator..."
12
13 LEX_CMD=NONE
14 if which "flex" > /dev/null; then
15 LEX_CMD=`which flex`
16 elif which "lex" > /dev/null; then
17 LEX_CMD=`which lex`
18 else
19 echo "Error: You need lex (or flex) to generate the instrument script parser !"
20 exit -1
21 fi
22
23 YACC_CMD=NONE
24 if which "bison" > /dev/null; then
25 YACC_CMD="`which bison` -y"
26 elif which "yacc" > /dev/null; then
27 YACC_CMD=`which yacc`
28 else
29 echo "Error: You need yacc (or bison) to generate the instrument script parser !"
30 exit -1
31 fi
32
33 echo "OK ($LEX_CMD, $YACC_CMD)"
34
35 echo -n "Generating instrument script parser ... "
36 (
37 cd $PARSER_SRC_DIR
38
39 $LEX_CMD scanner.l
40 #mv -f lex.yy.c scanner.cpp
41 mv -f lex.InstrScript_.c scanner.cpp
42
43 $YACC_CMD -d parser.y
44 $YACC_CMD parser.y
45 mv -f y.tab.h parser.h
46 mv -f y.tab.c parser.cpp
47 )
48 echo "Done"

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC