Loading…

Efficient construction of LR(k) states and tables

A new method for building LR(k) states and parsing tables is presented. The method aims at giving a feasible construction of a collection of LR(k) parsing tables, especially when k > 1. for nontrivial grammars. To this purpose, the algorithm first attempts to build a set of normal states for the...

Full description

Saved in:
Bibliographic Details
Published in:ACM transactions on programming languages and systems 1991-01, Vol.13 (1), p.150-178
Main Authors: Anicona, M., Dodero, G., Gianuzzi, V., Morgavi, M.
Format: Article
Language:English
Subjects:
Citations: Items that this one cites
Items that cite this one
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
cited_by cdi_FETCH-LOGICAL-a384t-c42598108acd48ad2f592c457c4ff021ed89162b6965852aac795b8f422730863
cites cdi_FETCH-LOGICAL-a384t-c42598108acd48ad2f592c457c4ff021ed89162b6965852aac795b8f422730863
container_end_page 178
container_issue 1
container_start_page 150
container_title ACM transactions on programming languages and systems
container_volume 13
creator Anicona, M.
Dodero, G.
Gianuzzi, V.
Morgavi, M.
description A new method for building LR(k) states and parsing tables is presented. The method aims at giving a feasible construction of a collection of LR(k) parsing tables, especially when k > 1. for nontrivial grammars. To this purpose, the algorithm first attempts to build a set of normal states for the given grammar, each one associated to a single parsing action in {accept, reduce, shift}. When such an action cannot be uniquely determined, that is, when up to k input symbols have to be examined (inadequacy), further states, belonging to a new type, called look-ahead states, are computed. The action associated with inadequate states is a new parsing action, look. States are built without actual computation of the FIRSTk and EFFk functions; that is, nonterminals are kept in the context string of items composing each state, and their expansion to terminals is deferred until indispensable to solve inadequacy. The aforementioned method is illustrated; then the canonical collection of states and the canonical tables are compared with those obtained from the proposed method. A sufficient condition is stated, by which the size of parsing tables, obtained by applying this new method, is smaller than that of canonical tables. Experimental results show that such a condition is verified by the grammars of several programming languagues and that significant speed is gained by avoiding the computation of the FIRSTk function.
doi_str_mv 10.1145/114005.102809
format article
fullrecord <record><control><sourceid>proquest_cross</sourceid><recordid>TN_cdi_proquest_miscellaneous_28876159</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>25189944</sourcerecordid><originalsourceid>FETCH-LOGICAL-a384t-c42598108acd48ad2f592c457c4ff021ed89162b6965852aac795b8f422730863</originalsourceid><addsrcrecordid>eNqFkD1PwzAQQC0EEqUwMrBlAcGQ4nPs5DyiqnxIlZAQzNbVsaVAmhTbHfj3DaQSbCx3y7sn3WPsHPgMQKrbYXCuZsAFcn3AJqAU5lLp4pBNOJQy51qoY3YS4zvnHFDhhMHC-8Y2rkuZ7buYwtampu-y3mfLl-uPmywmSi5m1NVZolXr4ik78tRGd7bfU_Z2v3idP-bL54en-d0ypwJlyq0USiNwJFtLpFp4pYWVqrLSey7A1aihFKtSlwqVILKVViv0Uoiq4FgWU3Y1ejeh_9y6mMy6ida1LXWu30YjEKsShu_-BRWg1lIOYD6CNvQxBufNJjRrCl8GuPkuaMaCZiw48Jd7MUVLrQ_U2Sb-HukKZFGJgbsYObLrP8ofxw7FwHT6</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype><pqid>25189944</pqid></control><display><type>article</type><title>Efficient construction of LR(k) states and tables</title><source>Association for Computing Machinery:Jisc Collections:ACM OPEN Journals 2023-2025 (reading list)</source><creator>Anicona, M. ; Dodero, G. ; Gianuzzi, V. ; Morgavi, M.</creator><creatorcontrib>Anicona, M. ; Dodero, G. ; Gianuzzi, V. ; Morgavi, M.</creatorcontrib><description>A new method for building LR(k) states and parsing tables is presented. The method aims at giving a feasible construction of a collection of LR(k) parsing tables, especially when k &gt; 1. for nontrivial grammars. To this purpose, the algorithm first attempts to build a set of normal states for the given grammar, each one associated to a single parsing action in {accept, reduce, shift}. When such an action cannot be uniquely determined, that is, when up to k input symbols have to be examined (inadequacy), further states, belonging to a new type, called look-ahead states, are computed. The action associated with inadequate states is a new parsing action, look. States are built without actual computation of the FIRSTk and EFFk functions; that is, nonterminals are kept in the context string of items composing each state, and their expansion to terminals is deferred until indispensable to solve inadequacy. The aforementioned method is illustrated; then the canonical collection of states and the canonical tables are compared with those obtained from the proposed method. A sufficient condition is stated, by which the size of parsing tables, obtained by applying this new method, is smaller than that of canonical tables. Experimental results show that such a condition is verified by the grammars of several programming languagues and that significant speed is gained by avoiding the computation of the FIRSTk function.</description><identifier>ISSN: 0164-0925</identifier><identifier>EISSN: 1558-4593</identifier><identifier>DOI: 10.1145/114005.102809</identifier><identifier>CODEN: ATPSDT</identifier><language>eng</language><publisher>New York, NY, USA: ACM</publisher><subject>Applied sciences ; Computer science; control theory; systems ; Exact sciences and technology ; Formal languages and automata theory ; Grammars and context-free languages ; Language processing and microprogramming ; Parsing ; Program reasoning ; Semantics and reasoning ; Software ; Theory of computation</subject><ispartof>ACM transactions on programming languages and systems, 1991-01, Vol.13 (1), p.150-178</ispartof><rights>ACM</rights><rights>1991 INIST-CNRS</rights><lds50>peer_reviewed</lds50><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed><citedby>FETCH-LOGICAL-a384t-c42598108acd48ad2f592c457c4ff021ed89162b6965852aac795b8f422730863</citedby><cites>FETCH-LOGICAL-a384t-c42598108acd48ad2f592c457c4ff021ed89162b6965852aac795b8f422730863</cites></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>314,776,780,4010,27900,27901,27902</link.rule.ids><backlink>$$Uhttp://pascal-francis.inist.fr/vibad/index.php?action=getRecordDetail&amp;idt=19714372$$DView record in Pascal Francis$$Hfree_for_read</backlink></links><search><creatorcontrib>Anicona, M.</creatorcontrib><creatorcontrib>Dodero, G.</creatorcontrib><creatorcontrib>Gianuzzi, V.</creatorcontrib><creatorcontrib>Morgavi, M.</creatorcontrib><title>Efficient construction of LR(k) states and tables</title><title>ACM transactions on programming languages and systems</title><addtitle>ACM TOPLAS</addtitle><description>A new method for building LR(k) states and parsing tables is presented. The method aims at giving a feasible construction of a collection of LR(k) parsing tables, especially when k &gt; 1. for nontrivial grammars. To this purpose, the algorithm first attempts to build a set of normal states for the given grammar, each one associated to a single parsing action in {accept, reduce, shift}. When such an action cannot be uniquely determined, that is, when up to k input symbols have to be examined (inadequacy), further states, belonging to a new type, called look-ahead states, are computed. The action associated with inadequate states is a new parsing action, look. States are built without actual computation of the FIRSTk and EFFk functions; that is, nonterminals are kept in the context string of items composing each state, and their expansion to terminals is deferred until indispensable to solve inadequacy. The aforementioned method is illustrated; then the canonical collection of states and the canonical tables are compared with those obtained from the proposed method. A sufficient condition is stated, by which the size of parsing tables, obtained by applying this new method, is smaller than that of canonical tables. Experimental results show that such a condition is verified by the grammars of several programming languagues and that significant speed is gained by avoiding the computation of the FIRSTk function.</description><subject>Applied sciences</subject><subject>Computer science; control theory; systems</subject><subject>Exact sciences and technology</subject><subject>Formal languages and automata theory</subject><subject>Grammars and context-free languages</subject><subject>Language processing and microprogramming</subject><subject>Parsing</subject><subject>Program reasoning</subject><subject>Semantics and reasoning</subject><subject>Software</subject><subject>Theory of computation</subject><issn>0164-0925</issn><issn>1558-4593</issn><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>1991</creationdate><recordtype>article</recordtype><recordid>eNqFkD1PwzAQQC0EEqUwMrBlAcGQ4nPs5DyiqnxIlZAQzNbVsaVAmhTbHfj3DaQSbCx3y7sn3WPsHPgMQKrbYXCuZsAFcn3AJqAU5lLp4pBNOJQy51qoY3YS4zvnHFDhhMHC-8Y2rkuZ7buYwtampu-y3mfLl-uPmywmSi5m1NVZolXr4ik78tRGd7bfU_Z2v3idP-bL54en-d0ypwJlyq0USiNwJFtLpFp4pYWVqrLSey7A1aihFKtSlwqVILKVViv0Uoiq4FgWU3Y1ejeh_9y6mMy6ida1LXWu30YjEKsShu_-BRWg1lIOYD6CNvQxBufNJjRrCl8GuPkuaMaCZiw48Jd7MUVLrQ_U2Sb-HukKZFGJgbsYObLrP8ofxw7FwHT6</recordid><startdate>19910101</startdate><enddate>19910101</enddate><creator>Anicona, M.</creator><creator>Dodero, G.</creator><creator>Gianuzzi, V.</creator><creator>Morgavi, M.</creator><general>ACM</general><general>Association for Computing Machinery</general><scope>IQODW</scope><scope>AAYXX</scope><scope>CITATION</scope><scope>7SC</scope><scope>8FD</scope><scope>JQ2</scope><scope>L7M</scope><scope>L~C</scope><scope>L~D</scope></search><sort><creationdate>19910101</creationdate><title>Efficient construction of LR(k) states and tables</title><author>Anicona, M. ; Dodero, G. ; Gianuzzi, V. ; Morgavi, M.</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-a384t-c42598108acd48ad2f592c457c4ff021ed89162b6965852aac795b8f422730863</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>1991</creationdate><topic>Applied sciences</topic><topic>Computer science; control theory; systems</topic><topic>Exact sciences and technology</topic><topic>Formal languages and automata theory</topic><topic>Grammars and context-free languages</topic><topic>Language processing and microprogramming</topic><topic>Parsing</topic><topic>Program reasoning</topic><topic>Semantics and reasoning</topic><topic>Software</topic><topic>Theory of computation</topic><toplevel>peer_reviewed</toplevel><toplevel>online_resources</toplevel><creatorcontrib>Anicona, M.</creatorcontrib><creatorcontrib>Dodero, G.</creatorcontrib><creatorcontrib>Gianuzzi, V.</creatorcontrib><creatorcontrib>Morgavi, M.</creatorcontrib><collection>Pascal-Francis</collection><collection>CrossRef</collection><collection>Computer and Information Systems Abstracts</collection><collection>Technology Research Database</collection><collection>ProQuest Computer Science Collection</collection><collection>Advanced Technologies Database with Aerospace</collection><collection>Computer and Information Systems Abstracts – Academic</collection><collection>Computer and Information Systems Abstracts Professional</collection><jtitle>ACM transactions on programming languages and systems</jtitle></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext</fulltext></delivery><addata><au>Anicona, M.</au><au>Dodero, G.</au><au>Gianuzzi, V.</au><au>Morgavi, M.</au><format>journal</format><genre>article</genre><ristype>JOUR</ristype><atitle>Efficient construction of LR(k) states and tables</atitle><jtitle>ACM transactions on programming languages and systems</jtitle><stitle>ACM TOPLAS</stitle><date>1991-01-01</date><risdate>1991</risdate><volume>13</volume><issue>1</issue><spage>150</spage><epage>178</epage><pages>150-178</pages><issn>0164-0925</issn><eissn>1558-4593</eissn><coden>ATPSDT</coden><abstract>A new method for building LR(k) states and parsing tables is presented. The method aims at giving a feasible construction of a collection of LR(k) parsing tables, especially when k &gt; 1. for nontrivial grammars. To this purpose, the algorithm first attempts to build a set of normal states for the given grammar, each one associated to a single parsing action in {accept, reduce, shift}. When such an action cannot be uniquely determined, that is, when up to k input symbols have to be examined (inadequacy), further states, belonging to a new type, called look-ahead states, are computed. The action associated with inadequate states is a new parsing action, look. States are built without actual computation of the FIRSTk and EFFk functions; that is, nonterminals are kept in the context string of items composing each state, and their expansion to terminals is deferred until indispensable to solve inadequacy. The aforementioned method is illustrated; then the canonical collection of states and the canonical tables are compared with those obtained from the proposed method. A sufficient condition is stated, by which the size of parsing tables, obtained by applying this new method, is smaller than that of canonical tables. Experimental results show that such a condition is verified by the grammars of several programming languagues and that significant speed is gained by avoiding the computation of the FIRSTk function.</abstract><cop>New York, NY, USA</cop><pub>ACM</pub><doi>10.1145/114005.102809</doi><tpages>29</tpages><oa>free_for_read</oa></addata></record>
fulltext fulltext
identifier ISSN: 0164-0925
ispartof ACM transactions on programming languages and systems, 1991-01, Vol.13 (1), p.150-178
issn 0164-0925
1558-4593
language eng
recordid cdi_proquest_miscellaneous_28876159
source Association for Computing Machinery:Jisc Collections:ACM OPEN Journals 2023-2025 (reading list)
subjects Applied sciences
Computer science
control theory
systems
Exact sciences and technology
Formal languages and automata theory
Grammars and context-free languages
Language processing and microprogramming
Parsing
Program reasoning
Semantics and reasoning
Software
Theory of computation
title Efficient construction of LR(k) states and tables
url http://sfxeu10.hosted.exlibrisgroup.com/loughborough?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-01-28T17%3A51%3A46IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-proquest_cross&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=Efficient%20construction%20of%20LR(k)%20states%20and%20tables&rft.jtitle=ACM%20transactions%20on%20programming%20languages%20and%20systems&rft.au=Anicona,%20M.&rft.date=1991-01-01&rft.volume=13&rft.issue=1&rft.spage=150&rft.epage=178&rft.pages=150-178&rft.issn=0164-0925&rft.eissn=1558-4593&rft.coden=ATPSDT&rft_id=info:doi/10.1145/114005.102809&rft_dat=%3Cproquest_cross%3E25189944%3C/proquest_cross%3E%3Cgrp_id%3Ecdi_FETCH-LOGICAL-a384t-c42598108acd48ad2f592c457c4ff021ed89162b6965852aac795b8f422730863%3C/grp_id%3E%3Coa%3E%3C/oa%3E%3Curl%3E%3C/url%3E&rft_id=info:oai/&rft_pqid=25189944&rft_id=info:pmid/&rfr_iscdi=true