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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2581 - (hide 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 schoenebeck 1216 #!/bin/sh
2     #
3 schoenebeck 2581 # 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 schoenebeck 1216
8     SCRIPTS_DIR=`dirname $0`
9 schoenebeck 2581 PARSER_SRC_DIR="$SCRIPTS_DIR/../src/scriptvm"
10 schoenebeck 1216
11 schoenebeck 2581 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 schoenebeck 1216 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 schoenebeck 2581 echo "Error: You need yacc (or bison) to generate the instrument script parser !"
30 schoenebeck 1216 exit -1
31     fi
32    
33 schoenebeck 2581 echo "OK ($LEX_CMD, $YACC_CMD)"
34    
35     echo -n "Generating instrument script parser ... "
36 schoenebeck 1216 (
37 schoenebeck 2581 cd $PARSER_SRC_DIR
38 schoenebeck 1216
39 schoenebeck 2581 $LEX_CMD scanner.l
40     #mv -f lex.yy.c scanner.cpp
41     mv -f lex.InstrScript_.c scanner.cpp
42 schoenebeck 2534
43 schoenebeck 2581 $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 schoenebeck 2534 echo "Done"

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC