Obtaining practical variants of LL (k) and LR (k) for k greater than 1 by splitting the atomic k-tuple

Terence John Parr, Purdue University

Abstract

LL(k) and LR(k) parsers for $k>1$ are well understood in theory, but little work has been done in practice to implement them. This fact arises primarily because traditional lookahead information for LL(k) and LR(k) parsers and their variants is exponentially large in k. Fortunately, this worst case behavior can usually be averted and practical deterministic parsers for $k>1$ may be constructed. This thesis presents new methods for computing and employing lookahead information. Previously, the lookahead depth, k, was generally fixed and the lookahead information was represented as sets of k-tuples. We demonstrate that by modulating the lookahead depth and by splitting the atomic k-tuple into its constituent components, individual terminals, the lookahead information size can be dramatically reduced in practice. We define a linear approximation to conventional lookahead for LL(k) and LR(k) and their variants that reduces space requirements from an exponential function of k to a linear function. Moreover, this approximation results in deterministic parsing decisions for the majority of cases. By compressing lookahead information to near linear space complexity, we show that deterministic parsing for $k>1$ is practical.

Degree

Ph.D.

Advisors

Dietz, Purdue University.

Subject Area

Computer science

Off-Campus Purdue Users:
To access this dissertation, please log in to our
proxy server
.

Share

COinS