Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Implementation of Programming Languages / Homework 02 / lexer.sh
diff options
context:
space:
mode:
Commit84d20dfee4af531c7e5c77335cc48778cf3f24e3 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-11-17 00:00:52 +0200
Committer
 Syndamia <kamen@syndamia.com>
2022-11-17 00:00:52 +0200
Filesc10205aea9e2b57eaaf6a6e32cf9f0fd1a2a57bd /Year 2/Implementation of Programming Languages/Homework 02/lexer.sh
uni-projects-84d20dfee4af531c7e5c77335cc48778cf3f24e3.tar
uni-projects-84d20dfee4af531c7e5c77335cc48778cf3f24e3.tar.gz
uni-projects-84d20dfee4af531c7e5c77335cc48778cf3f24e3.zip
Parent7f7d0d4676813a52bf69b807d8b8189d16f64ac0 (diff)
[IPL/HW02] Replaced lexer.sh script with a Makefile
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