Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Implementation of Programming Languages / Homework 01 / lexer.sh
blob: 39bc21d7d9a61c5f8855b83b64e6260dedebafc2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/bash

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