ePrints.FRI - University of Ljubljana, Faculty of Computer and Information Science

Dejan Črnila (2004) . Prešeren awards for students.

Full text not available from this repository.


We describe an implementation of a new context-free parsing method, called LLR (Left LR). LLR permits construction of the left parse for an input string even though the grammar is not of the type usually used for constructing left parses. The main contribution of the method is that output generation is (almost) concurrent with the reading of the input. LLR was discovered and its theory described by Boštjan Slivnik in his doctoral dissertation, while the purpose of the present work is the practical implementation of the method in the form of a modification / improvement of the well established open source parser generation tool, Bison. Curently, the best-known context-free syntax parsing methods are LL and LR. The LL method constructs the left parse of the input string on the basis of a given context-free grammar. Its principal advantage is that it permits simple use of attribute grammars, which are a powerful tool for construction of programming language compilers. The drawback of the method is that it is applicable only to a limited subclass of contrext-free grammars. These grammars are termed LL grammars. The LR method constructs the right parse of the input string, and its principal advantage is that it is applicable to a much larger class of context-free grammars, called LR grammars. It turns out that any context-free language that can be parsed deterministically may be described with an LR grammar. The LR method, however, has the drawback that inheritted attributes in attribute grammars often cause difficulties. The LLR method combines the advantages of LL as well as LR methods. The input is parsed on the basis of a LR grammar; however, the output is the left parse, which is identical to the output of the LL method. The basic idea is that in the LR characteristic automaton it is possible to determine the prefix of the left parse unambiguously for certain pairs of state and input symbol. LLR is an improvement of the Schmeiser-Barnard parsing method, which also constructs the left parse on the basis of a LR grammar; however, this is done only at the end of the parsing process, which is an obvious drawback. As stated above this work describes the implementation of LLR in the form of a modification / improvement of Bison, which is an application in C, and belongs to the GNU family. The main part of the work describes how LLR can be implemented and integrated into Bison, following which we describe experiments with the modified tool. Modified Bison, which uses LLR, was used to generate parsers both for simple and complex grammars (e.g., for an LR grammar for Pascal). The results of this work will be presented at forthcoming conference »lnformation Society 2004 - Section Theoretical Computer Science, Ljubljana, Slovenija 2004« (12)

Item Type: Thesis (Prešeren awards for students)
Number of Pages: 61
Language of Content: Slovenian
Mentor / Comentors:
Name and SurnameIDFunction
prof. dr. Boštjan Vilfan239Mentor
Link to COBISS: http://www.cobiss.si/scripts/cobiss?command=search&base=51012&select=(ID=4476500)
Institution: University of Ljubljana
Department: Faculty of Computer and Information Science
Item ID: 3721
Date Deposited: 05 Jan 2017 16:31
Last Modified: 13 Feb 2017 09:11
URI: http://eprints.fri.uni-lj.si/id/eprint/3721

Actions (login required)

View Item