- book: lex & yacc, 2nd
- src: lex yacc, 2nd
- lex & yacc
- lex
git clone https://resources.oreilly.com/examples/9781565920002.git
mv 9781565920002 lexyacc
cd lexyacc
flex ch1-01.l
mv lex.yy.c ch1-01.c
gcc -g -o ch1-01.pgm ch1-01.c -lfl -ll
./ch1-01.pgm
hello
hello
bye
bye
^D
Change -ly -ll
to -lfl -ll
in the Makefile:
# make and run all the example programs for lex & yacc, Second Edition
CC = gcc -g
# LIBS = -ly -ll
LIBS = -lfl -ll
LEX = flex
YACC = yacc
CFLAGS = -DYYDEBUG=1
Build:
make