CPS grammar inconsistency for bitwise-and

15 views
Skip to first unread message

Michael Brown

unread,
Apr 20, 2013, 5:48:18 PM4/20/13
to utah-compiler...@googlegroups.com
The grammar for P4 indicates bitwise-and as a <binop> with the two arguments and the continuation.  Tests 29 and 30 break these constraints and add more than two expressions to bitwise-and and those family of bitwise operations.  I took the strict approach of matching the <unop>, <binop>, and <triop> based on their number of expressions and the operator name.  This was overkill but it was so I could strictly follow the grammar.  I will admit though I should have noticed that bitwise-and could take more than only two arguments in the class's implementation of the compiler so far.

Note: I have already fixed this in my implementation under the allowed diff, but I think it might be nice to correct the grammar for future classes.

Matthew Might

unread,
Apr 20, 2013, 6:17:19 PM4/20/13
to Michael Brown, utah-compiler...@googlegroups.com
Thanks for the heads up.

I'll fix the spec for future courses.

If you can't handle this within the allowed diff, let me know.  I won't take off points for it.

-Matt



On Apr 20, 2013, at 5:48 PM, Michael Brown <game...@gmail.com> wrote:

The grammar for P4 indicates bitwise-and as a <binop> with the two arguments and the continuation.  Tests 29 and 30 break these constraints and add more than two expressions to bitwise-and and those family of bitwise operations.  I took the strict approach of matching the <unop>, <binop>, and <triop> based on their number of expressions and the operator name.  This was overkill but it was so I could strictly follow the grammar.  I will admit though I should have noticed that bitwise-and could take more than only two arguments in the class's implementation of the compiler so far.

Note: I have already fixed this in my implementation under the allowed diff, but I think it might be nice to correct the grammar for future classes.

--
You received this message because you are subscribed to the Google Groups "Utah Compilers, Spring 2013" group.
To unsubscribe from this group and stop receiving emails from it, send an email to utah-compilers-spri...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages