bison -d macrojava.y
flex macrojava.l
gcc macrojava.tab.c lex.yy.c -lfl -o macrojava
./macrojava < X.java > Y.java
should generate the correct minijava code in Y.java. Note, your program must take input from standard input and write to standard output (so that we can use the redirection).
The format for the minijava programs is given by the minijava grammar.
If the input macrojava code does not parse then output "// Failed to parse macrojava code."
Else output "// Macrojava code parsed and minijava code generated successfully.".
Grading policy
Your homework will be graded for a total of 100 marks.
[ under development ]