kuntilanak
asked on
reduce this yacc code and handle errors
I have attached my code in a file and also the grammar which I should follow, I am not really sure that I handle the errors correctly can someone help me to point out where I should work it out again? I am just not sure about the error recovery... handling the syntax error only...
Several things that I am asking you to do/suggest me to do in order to modify the code as minim as possible so that it can:
1. Print an error if a dcl is missing a semicolon and then continue parsing in the normal state
2. Print an error if an unknown type is detected, ie: float, boolean, which is not supported by the rule and then continue
to parse back in the normal state
3. Other errors, such as return statement without semicolon, errors in for loops, expression
grammar.txt
yacc-code.txt
Several things that I am asking you to do/suggest me to do in order to modify the code as minim as possible so that it can:
1. Print an error if a dcl is missing a semicolon and then continue parsing in the normal state
2. Print an error if an unknown type is detected, ie: float, boolean, which is not supported by the rule and then continue
to parse back in the normal state
3. Other errors, such as return statement without semicolon, errors in for loops, expression
grammar.txt
yacc-code.txt
ASKER
Hi Infinity08
This question here basically is more than I need from what is on the other thread.. Can you at least answer some of the issues here
This question here basically is more than I need from what is on the other thread.. Can you at least answer some of the issues here
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Infinity you are a big great help to me, my deadline is approaching soon and I really hope you could help me out on the other thread. I'll just refer to this thread in case you need to see the full case of what's really happening and in case something is not clear on the other topic.
https://www.experts-exchange.com/questions/23768900/parsing-errors-in-yacc.html
? If so, why not continue the discussion there, and make this a pointer ?
I know I can't respond to your questions immediately, as I'm quite busy with my job. But I do my best to get back to you as soon as possible.