# Public domain # Tested with Bison) 3.2.2 and Flex 2.6.4 # Note that our scanner.ll contains C++ code fragments, but we run Flex in C mode anyway. I. e. we pass C++ code to Flex, but trick it to think it processes C code. Then Flex generates code, which (at its optinion) is C code, but in fact this is C++ code (because it contains unmodified C++ code fragments, written by us), so we write it to file with .cc extension and pass to C++ compiler all: a.out lex.yy.cc lex.yy.hh: scanner.ll flex --header-file=lex.yy.hh -o lex.yy.cc scanner.ll parser.tab.cc parser.tab.hh: parser.yy bison -do parser.tab.cc parser.yy a.out: lex.yy.cc parser.tab.cc c++ lex.yy.cc parser.tab.cc clean: rm -f lex.yy.* parser.tab.* stack.hh a.out