Comparison of Classical and Lazy Approach in SCG Compiler

Ota Jirák, Dušan Kolář, Theodore E. Simos, George Psihoyios, Ch. Tsitouras, Zacharias A. Anastassi · AIP conference proceedings · 2011

The existing parsing methods of scattered context grammar usually expand nonterminals deeply in the pushdown. This expansion is implemented by using either a linked list, or some kind of an auxiliary pushdown. This paper describes the parsing algorithm of an LL(1) scattered context grammar. The given algorithm merges two principles together. The first approach is a table‐driven parsing method commonly used for parsing of the context‐free grammars. The second is a delayed execution used in functional programming. The main part of this paper is a proof of equivalence between the common principle (the whole rule is applied at once) and our approach (execution of the rules is delayed). Therefore, this approach works with the pushdown top only. In the most cases, the second approach is faster than the first one. Finally, the future work is discussed.

Read the paper · More papers on PaperTik