Permalink
Browse files

Ported to C.

  • Loading branch information...
0 parents commit 53c9b7bcbd3aa0a56cc395937967da83a74c9bc5 @theory committed Jan 25, 2013
Showing with 5,939 additions and 0 deletions.
  1. +30 −0 Makefile
  2. +4,897 −0 lemon.c
  3. +850 −0 lempar.c
  4. +86 −0 main.c
  5. +43 −0 shellparser.y
  6. +33 −0 shellscanner.l
@@ -0,0 +1,30 @@
+CFLAGS := $(CFLAGS) -std=c99
+
+shell: main.o shellparser.o shellscanner.o
+ $(CC) -o shell main.o shellparser.o shellscanner.o
+
+main.o: main.c shellparser.h shellscanner.h
+
+shellparser.o: shellparser.h
+
+shellparser.h: shellparser.y lemon
+ ./lemon shellparser.y
+
+shellscanner.o: shellscanner.h
+
+shellscanner.h: shellscanner.l
+ flex --outfile=shellscanner.c --header-file=shellscanner.h shellscanner.l
+
+# Prevent yacc from trying to build parsers.
+# http://stackoverflow.com/a/5395195/79202
+%.c: %.y
+
+lemon: lemon.c
+ $(CC) -o lemon lemon.c
+
+.PHONY: clean
+clean:
+ rm -f *.o
+ rm -f shellscanner.c shellscanner.h
+ rm -f shellparser.c shellparser.h shellparser.out
+ rm -f shell lemon
Oops, something went wrong.

0 comments on commit 53c9b7b

Please sign in to comment.