Y.tab.c y.tab.h: calc.y $(YACC) -v calc.y # This rule will use yacc to generate the files y.tab.c # from our file calc.y Lex.yy.o: lex.yy.c y.tab.h lex.yy.o y.tab.o: calc.h # Make uses the dependencies to figure out what rules must be runwhen # a file has changed. # These dependency rules indicate that (1) lex.yy.o dependson # lex.yy.c and y.tab.h and (2) lex.yy.o and y.tab.o depend oncalc.h. # calc is the final object that we will generate, it is producedby # the C compiler from the y.tab.o and from the lex.yy.oĬalc: y.tab.o lex.yy.o $(CC) -o calc y.tab.o lex.yy.o # We assume that your C-compiler is called cc #LEX = lex #YACC = yacc -d LEX = flex YACC = bison -d -o y.tab.c # Comment out the proper lines below according to the scannerand # parser generators available in your system # A Makefile for simple lex and yacc examples % symtab struct symtab *symlook() void printHelp() void yyerror() All operators will have leftassociativity. Your job is to modify the application to add logical operatorsas in the following table. Youmodify the calculator application to add logial operators. Homework 5 is a programming practice on Flex and Bison.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |