reset password
Author Message
kaancalstatela
Posts: 52
Posted 19:39 May 20, 2016 |

Hey everyone. I have a couple questions about Homework 3 and simpleDB in general. One of them is for Professor Sun but the other one I'd appreciate some general help.

1. Professor Sun, I understand that we can't comment out stuff in the source code but are we allowed to maybe overload some methods or change a class method. For example, what if I wanted to send one more argument with the new Term(lhs,lhs) as if it was new Term(lhs, lhs, arg3)? Would that be acceptable?

2.I guess this kinda is related to the first question as well but maybe I can get some good advice on it. In my travels across the simpleDB source code, I noticed that since

the equality operator is pretty much the only functional comparison operator that there is no apparent way to handle which delimiter is being eaten by the lexer. Meaning any delimiter that's eaten is automatically an equality operator. I wanna see if I can check which operator is being passed to the parser so I'd like to know if there is a

method in simpleDB to handle this operation or do I have to overload the Term method. I'm looking around the source code(Expression was my bet but it was a dead-end) but haven't got lucky so far.

 

Anyways, even if no one can help out, I still hope my way of thinking can help out folks that are still struggling with understanding the relationship between parser,term, lexer, etc.

 

Good luck people.

cysun
Posts: 2935
Posted 09:54 May 21, 2016 |

1. Sure. You can also comment out / replace stuff as long as it does not remove functionality.

2. You can use "match" to check a delimiter before "eat" it.