Syntax analysis is a process used in compilers to determine the validity of a program source code according to the chosen programming language grammar. New and improved approaches and algorithms enable faster analysis and allow the use of more sophisticated grammars and programming languages. In this thesis, we implemented the LLLR method, which combines the features of the LL and LR methods. Thus, the syntax analysis can be performed in linear time, while conflicts in the parse table are resolved with the embedded parser using the LR method. We first compared the implemented method to the LL(k) method. Although the methods are equally fast when applied to grammars without conflicts in the parse table, practical examples have shown us that the LLLR method can perform the analysis regardless of the number of conflicts and recursiveness of productions. We then compared the method to LL(*), which resolves conflicts with deterministic finite automata. The LL(*) method is generally faster due to the use of automata but does not support left recursion. For such grammars, the use of the LLLR method is more appropriate.
|