-
Open the XML workspace created in GUI Tutor
1. To do this, you can either start Visual Parse++ and use the File/Open
Workspace... menu selection, or you can navigate to our Samples\XML
directory with the Windows Explorer and double click on XML.ypw. This
will automatically start Visual Parse++ and open the workspace. The XML.ycc
rule file is opened in an edit window.
-
Scroll down in the XML.ycc rule file to the <!DOCTYPE
expression, line 115.

-
Select Debug/Toggle Breakpoint (or press F4, or click the
Toggle Breakpoint toolbar button, that looks like a hand
). A red circle is
drawn in the margin on this line to indicate the breakpoint is set.

-
Select Debug/Open Test File/Character (or click the Start toolbar
button
). An open file dialog is displayed. Open the file 001.xml in
our Samples/XML directory.
-
Select Debug/Run (or press F5, or click the Run
toolbar
button).
-
The run will stop when the <!DOCTYPE token is recognized,
because that's where we put the breakpoint.
-
We'll sidestep a little here to show you how to use a frequently used
feature. If you want to restart the testing of the same file, you can easily
do it with by selecting Debug/Restart, or pressing Ctrl-F5, or
by clicking the Restart toolbar button
. Try it now.
-
Press F5 (
Run) again to get us back where we were.

-
Scroll down to line 343. It's the DoctypeDecl production.
Set a breakpoint there by putting the cursor on that line and using either Debug/Toggle
Breakpoint, F4, or by clicking the Toggle Breakpoint toolbar
button
.

-
Press F5 (Run
) again.
-
This time the run will stop when the DoctypeDecl production is
about to get reduced.
-
Press F10 or click the Step button
on the
toolbar to finish the reduce.
-
Select Debug/Show Lookaheads. This is a useful feature to use when
debugging. When the lexer is operating, it will show you the matches (as
usual), and, the current lookahead tokens are also highlighted for you. This
shows you the set of tokens that are valid in the current state. Sometimes
it can be quite useful to have Show Lookaheads on when you are debugging.
-
Step (Press F10 or click the Step button
on the
toolbar) until the state changes to Lexing (4
more times).
-
As usual, the matches are all highlighted, but this time the lookahead
tokens are also highlighted. Yellow indicates that it is a lookahead token,
and green indicates that it is a lookahead token and a current match.

-
Step (F10) again until the < token is recognized. The
lookahead tokens are also highlighted in yellow.

-
We'll just animate the rest of this test run by selecting Debug/Animate
.
This will use a timer to step through the rest of the test data. You can set
the timer increment by going to the Project/Settings... and selecting
the Misc tab. It has an edit box to specify the delay.

-
The debugger will stop when the state is Accept.

-
Clear the breakpoints by selecting Debug/Remove All Breakpoints, or
clicking the Remove All Breakpoints toolbar button
.
-
We'll now show how to test multiple test files at once. Select Debug/Run
Directory. An open file dialog will get displayed. It should be in our
Samples/XML directory. If it isn't, navigate to this directory.
-
Type in *.xml in the File name edit box and click Open.
-
You'll probably hear 3 quick beeps as each of the three .xml files
in this directory are tested. The files tested are also listed in the
Message window toward the bottom of the screen.

-
This is how you run through
multiple test files for backtesting. There is also a menu selection called Debug/Run
Last Directory (Shift +F11) that you can use to run the last directory selected. You
can try that now. Select Debug/Run Last Directory and you'll hear the
3 beeps again as each file is tested. One other option related to this is
the Debug/Recurse Directories selection. If you enable this, all the
child directories of the directory that you selected are also searched for
matching files.