Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 69b4839a31
Fetching contributors…

Cannot retrieve contributors at this time

executable file 47 lines (35 sloc) 1.09 kB
#!/bin/sh
# Run from your JRuby home directory....More smarts needed here.
###### Change these to tastes ######
JAY=jay
RUBY=ruby
PARSER_BASE=DefaultRubyParser
YYTABLE_PREFIX=
DEBUG=true
###### Do not change below ######
if [ "$1" != "" ]; then
PARSER_BASE=$1
fi
shift
if [ "$1" != "" ]; then
YYTABLE_PREFIX=$1
fi
if [ "$DEBUG" != "" ]; then
DEBUG_FLAG=-t
# Nonesense...my script-fu is weak
DEBUG_STRIP="xdyhbk"
else
DEBUG_FLAG=
DEBUG_STRIP="^//t"
fi
echo "Generating Parser '$PARSER_BASE' w/ YYTable prefix of '$YYTABLE_PREFIX'"
PARSER_DIR=src/org/jruby/parser
pushd $PARSER_DIR
# Generate grammar as intermediate file
$JAY $DEBUG_FLAG $PARSER_BASE.y < skeleton.parser | grep -v $DEBUG_STRIP >$PARSER_BASE.out
# Patch file to get around Java static initialization issues plus extract
# a bunch of stuff to seperate file (yytables).
$RUBY ../../../../bin/patch_parser.rb $PARSER_BASE.out $YYTABLE_PREFIX > $PARSER_BASE.out2
$RUBY ../../../../bin/optimize_parser.rb $PARSER_BASE.out2 $YYTABLE_PREFIX > $PARSER_BASE.java
rm -f $PARSER_BASE.out $PARSER_BASE.out2
popd
Jump to Line
Something went wrong with that request. Please try again.