Solved

Trash Recycler from Thinking in C++ by Bruce Eckel - Parser

Posted on 2002-04-24
5
261 Views
Last Modified: 2010-04-02
I have written a parser for a script file. The
Parser uses OOPS, recursion, factory/prototyping
as seen in TIC++ and is
working. The script controls the display of
questions for interviewing software.
The first part of the script, Block consists
of 'Field' or Question definitions. The second
part is the 'Rules' or logic that causes one
question to be asked and another to be skipped.
 The parser handles commands such as Field, Procedure
etc. successfully. I am hung up on how to handle
IF THEN ELSE ENDIF. An IF ENDIF clause can contain a FOR
statement for example. My parsing can handle
one type of command nested in another, but with
an IF THEN ELSE ENDIF, a single command is divided into
halves by the ELSE and I can not see my way through
this. I can see how to do an IF ENDIF containing a FOR LOOP but I can not see how to handle, say
IF I=1 THEN
  For ....
ELSE
  I = I + 1
ENDIF
This problem has been handle by others, I
would very much like a pointer to some book, or site
where I could see how others have dealt with this.
I have searched using copernic but do not find the discussion I need. Many Thanks
0
Comment
Question by:mebarron
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:snoegler
ID: 6966705
Hmm this is quite what i've done (a rule-based LL(K) parser engine). I can send the project to you, it is published under the LGPL.
0
 
LVL 6

Accepted Solution

by:
snoegler earned 100 total points
ID: 6966917
I forgot there is already an URL for downloading:

http://devel.codefish.net/download/cxtpkg-3.03-win32vc.zip
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6979388
This question is current, others are not.  All await your response.  ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.11774038.html
http://www.experts-exchange.com/questions/Q.20087767.html
http://www.experts-exchange.com/questions/Q.20262460.html
http://www.experts-exchange.com/questions/Q.20275162.html
http://www.experts-exchange.com/questions/Q.20288168.html
http://www.experts-exchange.com/questions/Q.20293223.html



*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
0
 

Author Comment

by:mebarron
ID: 6980222
many thanks
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6981256
Thank you for returing and finalizing this.
0

Featured Post

Independent Software Vendors: 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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

685 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