Show simple item record

dc.contributor.advisorShankar, Priti
dc.contributor.authorHaripriyan, H K
dc.date.accessioned2025-09-29T06:33:33Z
dc.date.available2025-09-29T06:33:33Z
dc.date.submitted1985
dc.identifier.urihttps://etd.iisc.ac.in/handle/2005/7097
dc.description.abstractCompiler Generators have become well-established tools in the production of a compiler. In general, a compiler generator uses a specification of a programming language at an abstract level as input and outputs the code for the compiler. While LR, SLR, and LALR grammars are generally used for the specification of the syntax of a programming language, attribute grammars and affix grammars are commonly used to specify the semantics of the language. The compilers generated by many compiler generators require scanning the input (or a parse tree generated from the input) more than once. Such multi-pass compilers based on attribute grammars generally require more space and time compared to their one-pass counterparts. Producing one-pass compilers based on LR parsing of affix grammars was first introduced by Watt. A different approach suggested by Fohlmann has the advantage of both simplicity and the ability to parse a larger class of grammars than those covered by Watt’s technique. In this thesis, Fohlmann’s method has been adapted for implementation. The basic idea is to augment the moves of the LR(K) automaton for the grammar to take into account affix computations. The problems addressed and the algorithms developed are summarized below. a. Testing an input affix grammar for well-formedness. b. Implementing a test (the ALR(k) test) to check whether a given affix grammar is deterministically parsable using our technique. The test, originally given by Fohlmann, has been implemented with adaptations to make it suitable for application on the LR(k) automaton for the grammar. Efficient data structures (optimized for both time and space) have been designed. c. Once the input affix grammar passes the test in (b), it can be used to generate a compiler. A compiler generator has been designed, which includes the standard components—namely the lexer and the parsing table. Additionally, facilities to generate semantic actions have been incorporated. An existing skeleton facility (consisting of an SLR(1) parser generator) has been enhanced for this purpose. The system designed has been successfully used to generate the front-end of a compiler for a Pascal subset, the grammar for which contains about sixty productions. Based on experience with the system, the merits and disadvantages of the scheme are discussed. Space considerations are seen to be critical during the testing phase (i.e., during the ALR(k) test). d. A new algorithm, which is an alternative to Fohlmann’s ALR(k) test, is proposed. This algorithm has a time complexity comparable to that of Fohlmann’s, while its space requirements are much less.
dc.language.isoen_US
dc.relation.ispartofseriesT02313
dc.rightsI grant Indian Institute of Science the right to archive and to make available my thesis or dissertation in whole or in part in all forms of media, now hereafter known. I retain all proprietary rights, such as patent rights. I also retain the right to use in future works (such as articles or books) all or part of this thesis or dissertation
dc.subjectCompiler Generator
dc.subjectAffix Grammar
dc.subjectALR(k) Test
dc.titleA complier writing system based on affix grammars
dc.typeThesis
dc.degree.nameMSc Engg
dc.degree.levelMasters
dc.degree.grantorIndian Institute of Science
dc.degree.disciplineEngineering


Files in this item

Thumbnail

This item appears in the following Collection(s)

Show simple item record