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
I = I + 1
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