Skip to content

Instantly share code, notes, and snippets.

@jmoyers
Created June 7, 2016 22:23
Show Gist options
  • Save jmoyers/63c1c804a9db16ffe0e52bc66eda9aa7 to your computer and use it in GitHub Desktop.
Save jmoyers/63c1c804a9db16ffe0e52bc66eda9aa7 to your computer and use it in GitHub Desktop.
An updated version of Stanford Compilers myparser script
#!/bin/bash
# -d = loads your parser into gdb with correct input
# -r = uses the ref lexer and parser to generate the same style output
# default, the way the script worked originally
if [ $1 = "-d" ]; then
shift
./lexer $* > lexer.out
gdb -ex "set args $* < lexer.out" ./parser
elif [ $1 = "-r" ]; then
shift
/usr/class/cs143/bin/reflexer $* | /usr/class/cs143/bin/refparser $*
else
./lexer $* | ./parser $*
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment