Discussion:
Need A3P2 Clarifications
(too old to reply)
Hien Goi
2004-06-24 02:05:22 UTC
Permalink
Just wanted to clarify if we need to tokenize any of the following for a3p2:

1. while#
2. while<
3. <<
4. a<b
5. while[illegal character] <- (tokenize while and give error message or
simply give error message?)
and other similar cases to 5 eg. ***@.

I think implementing these cases will require many more states.

Thanks,

Hien.
Troy Mark Gonsalves
2004-06-24 14:14:27 UTC
Permalink
Post by Hien Goi
1. while#
<WHILE>
Post by Hien Goi
2. while<
while,relop
Post by Hien Goi
3. <<
relop,relop
Post by Hien Goi
4. a<b
id,relop,id
Post by Hien Goi
5. while[illegal character] <- (tokenize while and give error message or
simply give error message?)
<WHILE>
Error
Post by Hien Goi
I think implementing these cases will require many more states.
That depends on what your DFA looks like right now. If you need more
states then add them.
Troy
Troy Mark Gonsalves
2004-06-24 18:09:44 UTC
Permalink
Post by Hien Goi
5. while[illegal character] <- (tokenize while and give error message or
simply give error message?)
You should return an Error...there's not much point in returning the token
(it's fine if you happen to return one though).

Troy

Loading...