Skip to main content

LL parsing

LL parsing The most powerful top-down parsing technique that proceeds without backtracking, LL standing for Left-to-right Leftmost derivation sequence. In general an LL parser uses a k-symbol lookahead, where k is an integer ≥1, to effect parsing decisions. For most practical purposes, however, k is taken to be 1.

An LL parser may be implemented as a pushdown automaton or by the method of recursive descent (see top-down parsing). In the former method a stack is used to store that portion of a leftmost derivation sequence that has not been matched against the input string. Initially the start symbol of the grammar is pushed onto an empty stack. Subsequently, if the top element of the stack is a terminal symbol it is matched against the next symbol in the input string. If they are the same then the stack symbol is popped and the input marker advanced, otherwise there is an error in the input string. If the top stack symbol is a nonterminal A, say, it is removed from the stack and replaced by the right-hand side symbols of a production with left-hand side A. The right-hand side symbols are pushed onto the stack in right-to-left order. Thus if the production is AXYZ

the first symbol to be stacked is Z, then Y, and finally X. The choice of a production is made by consulting a parsing table that contains an entry for each combination of nonterminal symbol and k-symbol lookahead. Parsing is successfully completed when the input is exhausted and the stack is empty.

A grammar that can be parsed using this technique is said to be an LL(k) grammar. Not all grammars are LL(k); in particular any grammar that uses left recursion is not LL(k) for any value of k.

Cite this article
Pick a style below, and copy the text for your bibliography.

  • MLA
  • Chicago
  • APA

"LL parsing." A Dictionary of Computing. . 20 Mar. 2019 <>.

"LL parsing." A Dictionary of Computing. . (March 20, 2019).

"LL parsing." A Dictionary of Computing. . Retrieved March 20, 2019 from

Learn more about citation styles

Citation styles gives you the ability to cite reference entries and articles according to common styles from the Modern Language Association (MLA), The Chicago Manual of Style, and the American Psychological Association (APA).

Within the “Cite this article” tool, pick a style to see how all available information looks when formatted according to that style. Then, copy and paste the text into your bibliography or works cited list.

Because each style has its own formatting nuances that evolve over time and not all information is available for every reference entry or article, cannot guarantee each citation it generates. Therefore, it’s best to use citations as a starting point before checking the style against your school or publication’s requirements and the most-recent information available at these sites:

Modern Language Association

The Chicago Manual of Style

American Psychological Association

  • Most online reference entries and articles do not have page numbers. Therefore, that information is unavailable for most content. However, the date of retrieval is often important. Refer to each style’s convention regarding the best way to format page numbers and retrieval dates.
  • In addition to the MLA, Chicago, and APA styles, your school, university, publication, or institution may have its own requirements for citations. Therefore, be sure to refer to those guidelines when editing your bibliography or works cited list.