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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2534 - (show annotations) (download) (as text)
Sun Mar 9 21:34:03 2014 UTC (10 years, 1 month ago) by schoenebeck
File MIME type: application/x-sh
File size: 987 byte(s)
* LSCP shell (WIP): Added initial support for built-in LSCP reference
  documentation, which will automatically show the relevant LSCP reference
  section on screen as soon as one specific LSCP command was detected while
  typing on the command line.
* Bumped version (1.0.0.svn37).

1 #!/bin/sh
2 #
3 # Generates the LSCP parser's C++ source files (src/network/lscpparser.cpp and
4 # src/network/lscpsymbols.h) according to the LSCP (BNF) grammar definition
5 # given by src/network/lscp.y
6
7 SCRIPTS_DIR=`dirname $0`
8 NETWORK_SRC_DIR="$SCRIPTS_DIR/../src/network"
9
10 echo -n "Searching for a parser generator..."
11 YACC_CMD=NONE
12 if which "bison" > /dev/null; then
13 YACC_CMD="`which bison` -y"
14 elif which "yacc" > /dev/null; then
15 YACC_CMD=`which yacc`
16 else
17 echo "Error: You need yacc (or bison) to generate the LSCP parser !"
18 exit -1
19 fi
20 echo "OK ($YACC_CMD)"
21
22 echo "Generating LSCP parser..."
23 (
24 cd $NETWORK_SRC_DIR
25 $YACC_CMD -d lscp.y
26 $YACC_CMD lscp.y
27 mv -f y.tab.h lscpsymbols.h
28 mv -f y.tab.c lscpparser.cpp
29 )
30 echo "Done"
31
32 echo -n "Updating Documentation/lscp.xml..."
33 (cd $SCRIPTS_DIR && ./update_grammar.pl)
34 echo "Done"
35
36 echo -n "Generating src/network/lscp_shell_reference.cpp..."
37 (cd $SCRIPTS_DIR && ./generate_lscp_shell_reference.pl)
38 echo "Done"

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC