Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Implementation of Programming Languages / Homework 02 / lexer.sh
diff options
context:
space:
mode:
1 files changed, 0 insertions, 40 deletions
-rwxr-xr-xYear 2/Implementation of Programming Languages/Homework 02/lexer.sh40
diff --git a/Year 2/Implementation of Programming Languages/Homework 02/lexer.sh b/Year 2/Implementation of Programming Languages/Homework 02/lexer.sh
deleted file mode 100755
index 5a07c15..0000000
--- a/Year 2/Implementation of Programming Languages/Homework 02/lexer.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/bash
-
-if [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "--help" ]; then
- cat << EOF
-lexer.sh [-h|-?|--help|-b|-r|-p] <OPTION>
-
--h
--?
---help Brings up this help message
-
--b <FILES> Puts <FILES> through flex and compiles with gcc
- Outputed executable is "a.out"
--r <FILES> Runs <FILES> through compiled lexer and prints results
- Expects "a.out" as the compiled lexer (in the current folder)
--p <FILES> Runs <FILES> through compiled lexer and creates webpage with highlighting
- Expects "a.out" as the compiled lexer (in the current folder)
- Webpage is always named "highlighted.html". It is created by putting lexer
- output between "page_top.html" and "page_bottom.html"
-EOF
- exit
-fi
-
-if [ "$1" = "-b" ]; then
- shift
- flex $@
- gcc lex.yy.c -lfl
-fi
-
-if [ "$1" = "-r" ]; then
- shift
- ./a.out < $@
-fi
-
-if [ "$1" = "-p" ]; then
- filename="highlighted.html"
- cat ./page_top.html > $filename
- shift
- ./a.out < $@ >> $filename
- cat ./page_bottom.html >> $filename
-fi