Debugging Applet for %s Parser
Running the Applet
To start the applet in a separate window, please click this
button. Please be patient; depending on the speed of your network
connection, it may take a few minutes to load.
As the applet is talking to a compiled C parser with unobstrusive
debugging hooks, it is not possible to have the applet restart the parser once it has completed its
parse. Instead you will have to repeat the procedure you followed to get to
this page.
The applet has four main windows. Clockwise from the top-left they are
the following:
- Parse Forest Window
- Shows the current parse-forest. The
nodes on top are the nodes currently on the stack. Terminal nodes are in
red, non-terminal nodes are in green and error nodes are in pink. The last
active node is highlighted in yellow. Each node contains text of the form
S
/
Sym, where S is the state at
which that node was created and Sym is the grammar symbol or
token semantics corresponding to the node. The nodes in the top row
correspond to nodes currently on the parse stack.
Each non-leaf node in the forest is clickable. Clicking on such a node
hides all its subtrees; clicking again on that node displays the subtrees
again. This can be useful as the parse tree typically gets pretty large for
practical parsers.
- Trace Window
- Shows the parse stack in gray (each entry is
in the same format as a parse tree node), the current lookahead in red
and the following action in blue.
- Breakpoint Window
- This allows you to set/clear breakpoints
on all or selected nonterminals and terminals. Clicking a line in the
window sets a breakpoint on the symbol displayed on that line; clicking
it again clears the breakpoint. The currently selected breakpoints
are highlighted.
- Source Window
- Shows the parser source file. During a
reduction, the line corresponding to the reduction is highlighted.
The debugger is controlled by the following controls:
- Shadows Checkbox
- This checkbox controls whether or not the
parser shows crude shadows while displaying the parse forest. It is
useful to avoid having shadows cluttering up the display of large forests.
- Update Checkbox
- Selecting this checkbox results in the parser
displaying the current state in the LR(0) machine in a browser frame. For
this to work, the parser should have been generated using the -H option, and
the environmental variable
ZYDEBUG_HTMLBASE
should have been
specified when the parser was started.
- Step Button
- Steps the parser by a single step.
- Next Button
- Steps the parser to the next shift action.
- Continue Button
- Steps the parser till the next breakpoint.
If no breakpoints are set, then the parser runs to completion.
It is not possible to restart the parser.
Feedback: Please email any feedback to zdu@acm.org.