2 points for p3 executable or script – including making it executable
2 points for makefile
2 points for typescript
3 points for documentation
16 points for execution?
25 total points on project
This is a small assignment designed to give you experience
using LEX (flex) and YACC (bison).
For this exercise you are to generate a LEX (.l) file to
recognize tokens that are to be input to the parser (.y). Use
YACC to recognize (or report) errors for the strings of the
following grammar that generates sql queries.
The following is a grammar for SQL syntax.
::= one-relation-expression | two-relation-expression
::= renaming | restriction | projection
::= term RENAME attribute AS attribute
::= relation | ( expression )
::= term WHERE comparison
::= term | term [ attribute-commalist ]
::= attribute | attribute , attribute-commalist
::= projection binary-operation expression
::= UNION | INTERSECT | MINUS | TIMES | JOIN | DIVIDEBY
::= attribute compare number
::= < | > | <= | >= | = | <>
::= val | val number
::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
::= CNO | CITY | CNAME | SNO | PNO | TQTY |
SNAME | QUOTA | PNAME | COST | AVQTY |
S# | STATUS | P# | COLOR | WEIGHT | QTY
::= S | P | SP | PRDCT | CUST | ORDERS
Shar the .l file (for lex), the .y (for yacc) file, typescript,
documentation and makefile only (no y.tab.c or lex.yy.c files).
I should type “make” to cause the program to compile
all appropriate portions (lex/flex fn.l and yacc/bison fn.y and cc
fn.c …) to an executable called p3.
Program output should be one of two messages “ACCEPT”
Use turnin fn ree4620_3
Your project will be invoked with p3 test_file