Please wait, while we are loading the content...
Please wait, while we are loading the content...
| Content Provider | ACM Digital Library |
|---|---|
| Author | Soisalon-Soininen, Eljas |
| Abstract | One of the most attractive techniques in optimizing LR parsersis to eliminate reductions by semantically insignificantproductions of the form A → X (single productions), where X isa nonterminal or a terminal; such a modification can lead tosubstantial savings in both space and time. Therefore, much efforthas been devoted to the development of methods for eliminatingreductions by single productions from LR parsers (Aho and Ullman[1973a,1973b], Anderson, Eve and Horning[1973], Pager[1973a,1974],Demers[1974,1975], Backhouse [1976], Joliat[1976], Koskimies[1976],LaLonde [1976], Soisalon-Soininen[1976]).Anderson, Eve and Horning[1973] have described a method by whichall reductions by single productions can be eliminated from LRparsers, but their method may produce a considerable increase inthe number of states in the parser. On the other hand, with thetechniques of Aho and Ullman[1973b] and Demers[1975] no increase inthe number of states can occur, but the elimination of reductionsby single productions is guaranteed only if no two singleproductions have the same left hand side. Pager[1973a,1974] hasextended the method of Aho and Ullman[1973b] so that all reductionsby single productions are eliminated. LaLonde[1976] andBackhouse[1976] consider versions of the method of Pager, andJoliat[1976] considers a method which is essentially that given byAnderson, Eve and Horning[1973] as a suggestion for simplifyingtheir general technique.In Anderson, Eve and Horning[1973] the elimination of reductionsby single productions is performed during the construction of theLR parser, whereas in Aho and Ullman[1973b] and in Pager[1973a,1974] reductions by single productions are eliminated afterconstruction of the parser. Demers [1975] considers versions of Ahoand Ullman's method such that elimination can be performed bothduring and after construction of the parser, and LaLonde[1976]describes a version of Pager's method by which reductions by singleproductions can be eliminated during parser construction.Except the method of Anderson, Eve and Horning [1973] all theabove techniques rely heavily on the fact that in LR parsingcertain error entries can never be consulted. However, dependenceupon these "don't care" entries leads to some difficulties in thepractical use of the techniques. First, they may not be applicablefor all types of LR parsers: the method of Pager[1973a,1974]produces a parser which accepts exactly the strings in the languagein the case of canonical (Knuth[1965]) and SLR (DeRemer[1971])parsers but may produce a parser which accepts erroneous strings inthe case of LALR parsers (used e.g. by LaLonde[1971],Johnson[1975], Joliat[1975]) and generalizations of them (Pager[1973b,1975], Soisalon-Soininen[1975]). Furthermore, certain otherparser optimizations may decrease the number of don't care entries,and these optimizations need special treatment if they are to beapplied in conjunction with the elimination of reductions by singleproductions. One well known method for optimizing LR parsers, whichis extremely useful especially in list representation of LR parsersand which may decrease the number of don't care entries is the useof default reductions (if one or more reduce actions are possiblein some state then one of these reduce actions is chosen for thedefault reduction which is performed instead of reporting error;see Pager[1973a], Aho and Johnson[1974], Horning[1974],Aho[1976]).The problem in the use of default reductions in conjunction withthe elimination of reductions by single productions is discussed inPager[1973a] and a method is given there to solve the problem. Thebasis of the solution is to apply first the algorithm foreliminating reductions by single productions and then to checkevery potential default reduction in order to decide whether it canbe used or not. Hence, in the optimized parser all reductions bysingle productions are eliminated, but the use of defaultreductions can be limited. (Pager [1973a] has found that in thecase of some practical grammars almost all of potential defaultreductions can be used.)In the present paper we consider another approach to theproblem. In our method the elimination process itself correspondsto the technique of Pager[1973a,1974], but the elimination iscarried out only if it does not affect the applicability of defaultreductions. The main motivation of this approach is the fact thatit leads to a method for eliminating reductions by singleproductions which is applicable for any type of LR parser,including LALR parsers and generalizations of them.The rest of the present paper is organized as follows. Section 2contains some terminology and a brief review of the theory of LRparsing. In section 3 we consider the method of Pager[1973a,1974]in a form similar to that given by LaLonde[1976] and show by anexample that the method may produce invalid parsers in the case ofthe LALR construction. Finally, our method for eliminatingreductions by single productions in conjunction with the use ofdefault reductions is given in section 4. |
| Starting Page | 183 |
| Ending Page | 193 |
| Page Count | 11 |
| File Format | |
| DOI | 10.1145/512950.512967 |
| Language | English |
| Publisher | Association for Computing Machinery (ACM) |
| Publisher Date | 1977-01-01 |
| Publisher Place | New York |
| Access Restriction | Subscribed |
| Content Type | Text |
| Resource Type | Article |
National Digital Library of India (NDLI) is a virtual repository of learning resources which is not just a repository with search/browse facilities but provides a host of services for the learner community. It is sponsored and mentored by Ministry of Education, Government of India, through its National Mission on Education through Information and Communication Technology (NMEICT). Filtered and federated searching is employed to facilitate focused searching so that learners can find the right resource with least effort and in minimum time. NDLI provides user group-specific services such as Examination Preparatory for School and College students and job aspirants. Services for Researchers and general learners are also provided. NDLI is designed to hold content of any language and provides interface support for 10 most widely used Indian languages. It is built to provide support for all academic levels including researchers and life-long learners, all disciplines, all popular forms of access devices and differently-abled learners. It is designed to enable people to learn and prepare from best practices from all over the world and to facilitate researchers to perform inter-linked exploration from multiple sources. It is developed, operated and maintained from Indian Institute of Technology Kharagpur.
Learn more about this project from here.
NDLI is a conglomeration of freely available or institutionally contributed or donated or publisher managed contents. Almost all these contents are hosted and accessed from respective sources. The responsibility for authenticity, relevance, completeness, accuracy, reliability and suitability of these contents rests with the respective organization and NDLI has no responsibility or liability for these. Every effort is made to keep the NDLI portal up and running smoothly unless there are some unavoidable technical issues.
Ministry of Education, through its National Mission on Education through Information and Communication Technology (NMEICT), has sponsored and funded the National Digital Library of India (NDLI) project.
| Sl. | Authority | Responsibilities | Communication Details |
|---|---|---|---|
| 1 | Ministry of Education (GoI), Department of Higher Education |
Sanctioning Authority | https://www.education.gov.in/ict-initiatives |
| 2 | Indian Institute of Technology Kharagpur | Host Institute of the Project: The host institute of the project is responsible for providing infrastructure support and hosting the project | https://www.iitkgp.ac.in |
| 3 | National Digital Library of India Office, Indian Institute of Technology Kharagpur | The administrative and infrastructural headquarters of the project | Dr. B. Sutradhar bsutra@ndl.gov.in |
| 4 | Project PI / Joint PI | Principal Investigator and Joint Principal Investigators of the project |
Dr. B. Sutradhar bsutra@ndl.gov.in Prof. Saswat Chakrabarti will be added soon |
| 5 | Website/Portal (Helpdesk) | Queries regarding NDLI and its services | support@ndl.gov.in |
| 6 | Contents and Copyright Issues | Queries related to content curation and copyright issues | content@ndl.gov.in |
| 7 | National Digital Library of India Club (NDLI Club) | Queries related to NDLI Club formation, support, user awareness program, seminar/symposium, collaboration, social media, promotion, and outreach | clubsupport@ndl.gov.in |
| 8 | Digital Preservation Centre (DPC) | Assistance with digitizing and archiving copyright-free printed books | dpc@ndl.gov.in |
| 9 | IDR Setup or Support | Queries related to establishment and support of Institutional Digital Repository (IDR) and IDR workshops | idr@ndl.gov.in |
|
Loading...
|