Abstract

When developing promising programming languages designed to support the work of supercomputers, including quantum ones, there is a need for research related to testing the developed language under conditions when parsers do not yet exist for it. In particular, in the process of developing a programming language for a quantum computer, it becomes necessary to parse a certain program written in a new programming language, which, like all programming languages, belongs to the class of context-free languages (cf-languages). The problem of syntactical analysis of the monomials of cf-languages was posed in the 50-60s of the last century, however, there are some discrepancies in its formulation, and therefore there is a need to clarify the formulation of this problem. In this regard, we will call the expanded problem of parsing the problem of developing a stupid (non-stop, irrevocable) algorithm that allows establishing whether a given monomial can be deduced using a system of products that form a cf-language grammar, and also find all the conclusions of this monomial at once if the latter exists. The description of the monomial inference is understood as follows: it is necessary to determine for which products from the grammar of the cf-language, how many times and in what order they are used to derive this monomial, which is equivalent to constructing all the output trees. The article has developed a deadlockless algorithm for solving the extended problem of parsing, based on the method of hierarchy of marked brackets. The marked brackets order shows what products they are assigned to, and allows you to trace the order of its use. The algorithm uses the method of successive approximations to solve the Chomsky-Schützenberger system of equations associated with the cf-language grammar. The developed algorithm has a simple software implementation; an assessment of the complexity of the algorithm is also given.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.