Solved

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

Posted on 2002-04-24
5
257 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
many thanks
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
Thank you for returing and finalizing this.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now