Solved

reduce this yacc code and handle errors

Posted on 2008-09-29
5
206 Views
Last Modified: 2013-11-18
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
0
Comment
Question by:kuntilanak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 53

Expert Comment

by:Infinity08
ID: 22614134
Is this the same issue as this :

        http://www.experts-exchange.com/Programming/Languages/C/Q_23768900.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.
0
 

Author Comment

by:kuntilanak
ID: 22614439
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
0
 
LVL 53

Accepted Solution

by:
Infinity08 earned 500 total points
ID: 22614547
I'm glad to answer specific questions, but unfortunately, I don't have the time to go over your entire grammar, and add error handling code/fix problems/etc. That is not a trivial task, and would take several hours at least, if not several days. Writing a good grammar takes time - but everything should start with understanding how parsers work (yacc specifically).
0
 

Author Comment

by:kuntilanak
ID: 22614574
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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 148
SCO 5.0.7 on HP Proliant DL380 G5 will not shutdown properly. 6 87
umask commands 5 15
Problem to macro 5 20
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question