A tale of three LR(1) syntax analyzers
暂无分享,去创建一个
The chronicle and evolution of authors' experience in building LR(1) syntax analyzers is described in the paper. The theory background includes classic and modified interpretation of LR(1) parsing algorithms, Three versions of implemented parsers are to be discussed: parser with fixed control table, flexible table driven LR(1) parser and parser with built-in control table generator. The first version is classified as the most primitive. The second version is more flexible but it requires configuration file and manual construction of the control table. The third version is categorized the most flexible, powerful and user friendly parser implementation. It is much easier job to specify the grammar rules in a suitable format than to construct manually the control table and specify it within the source text of the parser or as contents of a configuration file.
[1] Alfred V. Aho,et al. The Theory of Parsing, Translation, and Compiling , 1972 .
[2] Stoyan Bonev. A flexible table driven LR(1) parser , 2004, CompSysTech '04.
[3] Alfred V. Aho,et al. Compilers: Principles, Techniques, and Tools (2nd Edition) , 2006 .