IDEAS home Printed from https://ideas.repec.org/a/gam/jmathe/v11y2023i7p1594-d1107110.html
   My bibliography  Save this article

On Parsing Programming Languages with Turing-Complete Parser

Author

Listed:
  • Boštjan Slivnik

    (Faculty of Computer and Information Science, University of Ljubljana, Večna Pot 113, 1000 Ljubljana, Slovenia
    These authors contributed equally to this work.)

  • Marjan Mernik

    (Faculty of Electrical Engineering and Computer Science, University of Maribor, Koroška Cesta 46, 2000 Maribor, Slovenia
    These authors contributed equally to this work.)

Abstract

A new parsing method based on the semi-Thue system is described. Similar to, but with more efficient implementation than Markov normal algorithms, it can be used for parsing any recursively enumerable language. Despite its computational power, it is meant to be used primarily for parsing programming and domain-specific languages. It enables a straightforward simulation of a number of existing parsing algorithms based on context-free grammars. The list includes both top-down shift-produce methods (such as SLL and LL) and bottom-up shift-reduce methods (such as LALR and LR), as well as mixed top-down-and-bottom-up methods such as LLLR. To justify the use of the new parsing method, the paper provides numerous examples of how a parser can actually be made in practice. It is advised that the main part of the parser is based on some simple well-established approach, e.g., SLL(1), while syntactically more complicated phrases can be parsed by exploiting the full power of the new parser. These phrases may either be extensions to the original language or some embedded domain-specific language. In all such and similar cases, no part of the language is restricted to be context-free. In fact, context-sensitive languages can be handled quite efficiently.

Suggested Citation

  • Boštjan Slivnik & Marjan Mernik, 2023. "On Parsing Programming Languages with Turing-Complete Parser," Mathematics, MDPI, vol. 11(7), pages 1-27, March.
  • Handle: RePEc:gam:jmathe:v:11:y:2023:i:7:p:1594-:d:1107110
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2227-7390/11/7/1594/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2227-7390/11/7/1594/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Žiga Leber & Matej Črepinšek & Marjan Mernik & Tomaž Kosar, 2022. "RNGSGLR: Generalization of the Context-Aware Scanning Architecture for All Character-Level Context-Free Languages," Mathematics, MDPI, vol. 10(14), pages 1-48, July.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.

      Corrections

      All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jmathe:v:11:y:2023:i:7:p:1594-:d:1107110. See general information about how to correct material in RePEc.

      If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

      If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

      If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

      For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

      Please note that corrections may take a couple of weeks to filter through the various RePEc services.

      IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.