Cybernetics and Information Technologies (Jan 2015)

Equivalent Transformations and Regularization in Context-Free Grammars

  • Fedorchenko Ludmila,
  • Baranov Sergey

DOI
https://doi.org/10.1515/cait-2014-0003
Journal volume & issue
Vol. 14, no. 4
pp. 29 – 44

Abstract

Read online

Regularization of translational context-free grammar via equivalent transformations is a mandatory step in developing a reliable processor of a formal language defined by this grammar. In the 1970-ies, the multi-component oriented graphs with basic equivalent transformations were proposed to represent a formal grammar of ALGOL-68 in a compiler for IBM/360 compatibles. This paper describes a method of grammar regularization with the help of an algorithm of eliminating the left/right-hand side recursion of nonterminals which ultimately converts a context-free grammar into a regular one. The algorithm is based on special equivalent transformations of the grammar syntactic graph: elimination of recursions and insertion of iterations. When implemented in the system SynGT, it has demonstrated over 25% reduction of the memory size required to store the respective intermediate control tables, compared to the algorithm used in Flex/Bison parsers.

Keywords