A declarative extension of parsing expression grammars for recognizing most programming languages

Tetsuro Matsumura, Kimio Kuramitsu

    • 1 Citations

    Abstract

    Parsing Expression Grammars are a popular foundation for describing syntax. Unfortunately, several syntax of programming languages are still hard to recognize with pure PEGs. Notorious cases appears: typedef-defined names in C/C++, indentation-based code layout in Python, and HERE document in many scripting languages. To recognize such PEG-hard syntax, we have addressed a declarative extension to PEGs. The “declarative” extension means no programmed semantic actions, which are traditionally used to realize the extended parsing behavior. Nez is our extended PEG language, including symbol tables and conditional parsing. This paper demonstrates that the use of Nez Extensions can realize many practical programming languages, such as C, C#, Ruby, and Python, which involve PEG-hard syntax.

    Original languageEnglish
    Pages (from-to)256-264
    Number of pages9
    JournalJournal of Information Processing
    Volume24
    Issue number2
    DOIs
    StatePublished - 2016 Mar 15

    Fingerprint

    Polyethylene glycols
    Computer programming languages
    Ruby
    Indentation
    Semantics

    Keywords

    • And case studies on programming languages
    • Context-sensitive syntax
    • Parsing expression grammars
    • Semantic actions

    ASJC Scopus subject areas

    • Computer Science(all)

    Cite this

    A declarative extension of parsing expression grammars for recognizing most programming languages. / Matsumura, Tetsuro; Kuramitsu, Kimio.

    In: Journal of Information Processing, Vol. 24, No. 2, 15.03.2016, p. 256-264.

    Research output: Contribution to journalArticle

    Matsumura, Tetsuro; Kuramitsu, Kimio / A declarative extension of parsing expression grammars for recognizing most programming languages.

    In: Journal of Information Processing, Vol. 24, No. 2, 15.03.2016, p. 256-264.

    Research output: Contribution to journalArticle

    @article{7cc3373d87954b51ac40e33b454f3d6f,
    title = "A declarative extension of parsing expression grammars for recognizing most programming languages",
    keywords = "And case studies on programming languages, Context-sensitive syntax, Parsing expression grammars, Semantic actions",
    author = "Tetsuro Matsumura and Kimio Kuramitsu",
    year = "2016",
    month = "3",
    doi = "10.2197/ipsjjip.24.256",
    volume = "24",
    pages = "256--264",
    journal = "Journal of Information Processing",
    issn = "0387-5806",
    number = "2",

    }

    TY - JOUR

    T1 - A declarative extension of parsing expression grammars for recognizing most programming languages

    AU - Matsumura,Tetsuro

    AU - Kuramitsu,Kimio

    PY - 2016/3/15

    Y1 - 2016/3/15

    N2 - Parsing Expression Grammars are a popular foundation for describing syntax. Unfortunately, several syntax of programming languages are still hard to recognize with pure PEGs. Notorious cases appears: typedef-defined names in C/C++, indentation-based code layout in Python, and HERE document in many scripting languages. To recognize such PEG-hard syntax, we have addressed a declarative extension to PEGs. The “declarative” extension means no programmed semantic actions, which are traditionally used to realize the extended parsing behavior. Nez is our extended PEG language, including symbol tables and conditional parsing. This paper demonstrates that the use of Nez Extensions can realize many practical programming languages, such as C, C#, Ruby, and Python, which involve PEG-hard syntax.

    AB - Parsing Expression Grammars are a popular foundation for describing syntax. Unfortunately, several syntax of programming languages are still hard to recognize with pure PEGs. Notorious cases appears: typedef-defined names in C/C++, indentation-based code layout in Python, and HERE document in many scripting languages. To recognize such PEG-hard syntax, we have addressed a declarative extension to PEGs. The “declarative” extension means no programmed semantic actions, which are traditionally used to realize the extended parsing behavior. Nez is our extended PEG language, including symbol tables and conditional parsing. This paper demonstrates that the use of Nez Extensions can realize many practical programming languages, such as C, C#, Ruby, and Python, which involve PEG-hard syntax.

    KW - And case studies on programming languages

    KW - Context-sensitive syntax

    KW - Parsing expression grammars

    KW - Semantic actions

    UR - http://www.scopus.com/inward/record.url?scp=84961192070&partnerID=8YFLogxK

    UR - http://www.scopus.com/inward/citedby.url?scp=84961192070&partnerID=8YFLogxK

    U2 - 10.2197/ipsjjip.24.256

    DO - 10.2197/ipsjjip.24.256

    M3 - Article

    VL - 24

    SP - 256

    EP - 264

    JO - Journal of Information Processing

    T2 - Journal of Information Processing

    JF - Journal of Information Processing

    SN - 0387-5806

    IS - 2

    ER -