Precedence Table Construction Algorithm for CFGs Regardless of Being OPGs

Author:

Lizcano Leonardo1,Angulo Eduardo1ORCID,Márquez José1ORCID

Affiliation:

1. Department of Computer Science and Engineering, Universidad del Norte, Barranquilla 081007, Colombia

Abstract

Operator precedence grammars (OPG) are context-free grammars (CFG) that are characterized by the absence of two adjacent non-terminal symbols in the body of each production (right-hand side). Operator precedence languages (OPL) are deterministic and context-free. Three possible precedence relations between pairs of terminal symbols are established for these languages. Many CFGs are not OPGs because the operator precedence cannot be applied to them as they do not comply with the basic rule. To solve this problem, we have conducted a thorough redefinition of the Left and Right sets of terminals that are the basis for calculating the precedence relations, and we have defined a new Leftmost set. The algorithms for calculating them are also described in detail. Our work’s most significant contribution is that we establish precedence relationships between terminals by overcoming the basic rule of not having two consecutive non-terminals using an algorithm that allows building the operator precedence table for a CFG regardless of whether it is an OPG. The paper shows the complexities of the proposed algorithms and possible exceptions to the proposed rules. We present examples by using an OPG and two non-OPGs to illustrate the operation of the proposed algorithms. With these, the operator precedence table is built, and bottom-up parsing is carried out correctly.

Funder

Universidad del Norte

Publisher

MDPI AG

Reference17 articles.

1. Syntactic analysis and operator precedence;Floyd;J. ACM (JACM),1963

2. Alfred, V., Monica, S., Ravi, S., and Jeffrey, D.U. (2007). Compilers Principles, Techniques, Pearson Education.

3. Grune, D., and Jacobs, C.J.H. (2006). Parsing Techniques (Monographs in Computer Science), Springer.

4. Gilchrist, B. (1972). An effective model for grammar inference. Information Processing 71, Elsevier.

5. Crespi-Reghizzi, S. (1971, January 1–3). Reduction of Enumeration in Grammar Acquisition. Proceedings of the 2nd International Joint Conference on Artificial Intelligence, San Francisco, CA, USA.

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3