Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/512950.512966acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free access

Generalized left corner parsing

Published: 01 January 1977 Publication History

Abstract

Brosgol [Br] formalizes the notion that parsing methods can be classified by the positions at which production rules are recognized. In an LL parser, each rule is recognized at the left end, before the rule's yield has been read; in an LR parser, a rule is recognized at its right end, after its yield has been read; and in an LC parser a rule is recognized after the yield of its "left corner" has been read. We generalize on these techniques by allowing the user to specify arbitrarily for each production rule the position at which that rule is to be recognized. The resulting GLC or generalized left corner technique includes the LR, LL, LC, and ELC methods as special cases. It also allows for less conventional parsing strategies, such as grammar splitting [K] with certain component grammars parsed top-down and the others parsed bottom-up, as suggested in [AU].This paper is organized as follows. In Section 2 we give some necessary background and notation. Section 3 defines GLC parsing. A canonical GLC(k) parsing technique can be defined analogous to the LR(k) technique. However, the resulting parsers tend to be unacceptably large. We therefore restrict our attention to the SGLC(k), or simple generalized left corner parsing technique, which is analogous to the SLR(k) technique of DeRemer [D]. We give an algorithm for the construction of SGLC(k) parsing tables and prove that the resulting parser is correct.In Section 4 we develop some potentially useful properties of SGLC(1) parsers. We show that there is a well-defined leftmost position at which each production rule can be recognized, and that a minimal left corner parser can be constructed which recognizes each rule as early as possible. We derive a simple expression relating the size (number of states) of an SGLC(1) parser to the size of the corresponding SLR(1) parser. If G is not left-recursive, then the minimal left-corner parser is the smallest parser for G in this class, while the SLR(1) parser is the largest.In Section 5 we extend the techniques 5 of [HSU] to give an O(n2) algorithm to test whether a grammar with no left recursion is SGLC(1), and if so to compute its minimal left corners.

References

[1]
{A} T. Anderson, "Syntactic Analysis of LR(k) Languages", Ph.D. Thesis, Computing Laboratory, University of Newcastle Upon Tyne.
[2]
{AU} A. V. Aho and J. D. Ullman, The Theory of Parsing, Translation and Compiling, Prentice-Hall, Englewood Cliffs, N.J., 1973.
[3]
{B} B. M. Brosgol, "Deterministic Translation Grammars", Ph.D. Thesis, Center for Research in Computing Technology, Harvard University, 1974.
[4]
{C} Y. E. Cho, "Simple Left Corner Grammars", Proc. Seventh Princeton Conference on Information Science and Systems, 1973.
[5]
{D} F. L. DeRemer, "Simple LR(k) Grammars", CACM, 14:7, 1971.
[6]
{HSU} H. B. Hunt III, T. G. Szymanski and J. D. Ullman, "Operations on Sparse Relations and Efficient Algorithms for Grammar Problems", Proc. 15 SWAT, 1974.
[7]
{K} A. J. Korenjak, "A Practical Method for Constructing LR(k) Processors," CACM 12:11, 196-.
[8]
{RL} D. J. Rosenkrantz and P. M. Lewis II, "Deterministic Left Corner Parsing", Proc. 11 SWAT, 1970.

Cited By

View all
  • (2023)On Parsing Programming Languages with Turing-Complete ParserMathematics10.3390/math1107159411:7(1594)Online publication date: 25-Mar-2023
  • (2023)Modeling Structure‐Building in the Brain With CCG Parsing and Large Language ModelsCognitive Science10.1111/cogs.1331247:7Online publication date: 7-Jul-2023
  • (2017)On different LL and LR parsers used in LLLR parsingComputer Languages, Systems and Structures10.1016/j.cl.2017.06.00250:C(108-126)Online publication date: 1-Dec-2017
  • Show More Cited By
  1. Generalized left corner parsing

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    POPL '77: Proceedings of the 4th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
    January 1977
    280 pages
    ISBN:9781450373500
    DOI:10.1145/512950
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 01 January 1977

    Permissions

    Request permissions for this article.

    Check for updates

    Qualifiers

    • Article

    Acceptance Rates

    POPL '77 Paper Acceptance Rate 25 of 105 submissions, 24%;
    Overall Acceptance Rate 824 of 4,130 submissions, 20%

    Upcoming Conference

    POPL '25

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)70
    • Downloads (Last 6 weeks)9
    Reflects downloads up to 19 Nov 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2023)On Parsing Programming Languages with Turing-Complete ParserMathematics10.3390/math1107159411:7(1594)Online publication date: 25-Mar-2023
    • (2023)Modeling Structure‐Building in the Brain With CCG Parsing and Large Language ModelsCognitive Science10.1111/cogs.1331247:7Online publication date: 7-Jul-2023
    • (2017)On different LL and LR parsers used in LLLR parsingComputer Languages, Systems and Structures10.1016/j.cl.2017.06.00250:C(108-126)Online publication date: 1-Dec-2017
    • (2016) MEG Evidence for Incremental Sentence Composition in the Anterior Temporal Lobe Cognitive Science10.1111/cogs.1244541:S6(1515-1531)Online publication date: 4-Nov-2016
    • (2013)On LR parsing with selective delaysProceedings of the 22nd international conference on Compiler Construction10.1007/978-3-642-37051-9_13(244-263)Online publication date: 16-Mar-2013
    • (2010)Top-down nearly-context-sensitive parsingProceedings of the 2010 Conference on Empirical Methods in Natural Language Processing10.5555/1870658.1870724(674-683)Online publication date: 9-Oct-2010
    • (2009)Heuristic search in a cognitive model of human parsingProceedings of the 11th International Conference on Parsing Technologies10.5555/1697236.1697283(230-233)Online publication date: 7-Oct-2009
    • (2007)Dynamic TAG and Lexical DependenciesResearch on Language and Computation10.1007/s11168-007-9032-45:3(309-332)Online publication date: 17-Oct-2007
    • (2005)Recursive ascent-descent parsersCompiler Compilers10.1007/3-540-53669-8_70(1-10)Online publication date: 4-Jun-2005
    • (2005)Parsing strategies: A concise surveyMathematical Foundations of Computer Science 198110.1007/3-540-10856-4_77(103-120)Online publication date: 3-Jun-2005
    • Show More Cited By

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media