LL(1) Parsing

A sample LL(1) parse.
In the middle of a sample LL(1) parsing.

Before LL(1) parsing can take place, first an LL(1) parse table must be defined according to the operations defined here.

First, one enters a string to attempt to parse in the text field labeled "Input." When one has entered the string, one either presses "Start" or types return to begin the process of parsing.

After a string is entered, one repeatedly presses "Step" to show the next phase of the parse. The "Input Remaining" shows what input the parser has yet to process, including a terminating $ character. The "Stack" shows the current contents of the stack. A message at the bottom of the window will show what is currently happening; in the image above, it shows that we are in the process of replacing S with aSb. JFLAP will highlight the node of the tree that was last processed on the stack. Whenever an entry in the parse table is used, that entry is highlighted in the table. One presses this step button until the string is either accepted or rejected by the parse table.

The default view is a non-inverted tree. In the tree, yellow nodes are the leaf nodes, i.e., terminals. Green nodes are internal nodes, i.e., non-terminals. There are other view options available. The current display shows a non-inverted parse tree. Also available is an "Inverted Tree" which is the same thing drawn upside down, which is more useful for LR(1) parsing. Also available is the string derivation view: for LL(1), this will show the attempts of the parser to derive the input string from the start variable, and the productions used in this derivation.