1,836 research outputs found

    Simple chain grammars and languages

    Get PDF
    A subclass of the LR(0)-grammars, the class of simple chain grammars is introduced. Although there exist simple chain grammars which are not LL(k) for any k>0, this new class of grammars is very closely related to the LL(1) and simple LL(1) grammars. In fact it can be shown that every simple chain grammar has an equivalent simple LL(1) grammar. Cover properties for simple chain grammars are investigated and a deterministic pushdown transducer which acts as a right parser for simple chain grammars is presented

    Ch(k) grammars:A characterization of LL(k) languages

    Get PDF
    In this paper we introduce the class of so called Ch(k) grammars [pronounced "chain k grammars"]. This class of grammars is properly contained in the class of LR(k) grammars and it properly contains the LL(k) grammars. However, the family of Ch[k) languages coincides with the family of LL(k) languages. Nevertheless, the parsing properties of Ch(k) grammars are quite different from the parsing properties of LL(k) grammars. The class of Ch(k) grammars can be considered as a generalization of the class of simple chain grammars in the same sense as the class of LL(k) grammars is a generalization of the class of simple LL(1) grammars

    Simple chain grammars

    Get PDF
    A subclass of the LR(0)-grammars, the class of simple chain grammars is introduced. Although there exist simple chain grammars which are not LL(k) for any k, this new class of grammars is very close related to the class of LL(1) and simple LL(1) grammars. In fact it can be proved (not in this paper) that each simple chain grammar has an equivalent simple LL(1) grammar. A very simple (bottom-up) parsing method is provided. This method follows directly from the definition of a simple chain grammar and can easily be given in terms of the well-known LR(0) parsing method

    On the relationship between the LL(k) and LR(k) grammars

    Get PDF
    In the literature various proofs of the inclusion of the class of LL(k) grammars into the class of LR(k) grammars can be found. Some of these proofs are not correct, others are informal, semi-formal or contain flaws. Some of them are correct but the proof is less straightforward than demonstrated here

    The equivalence problem for LL- and LR-regular grammars

    Get PDF
    It will be shown that the equivalence problem for LL-regular grammars is decidable. Apart from extending the known result for LL(k) grammar equivalence to LLregular grammar equivalence, we obtain an alternative proof of the decidability of LL(k) equivalence. The equivalence prob]em for LL-regular grammars has been studied before, but not solved. Our proof that this equivalence problem is decidable is simple. However, this is mainly because we can reduce the problem to the equivalence problem for real-time strict deterministic grammlars, which is decidable

    Unifying LL and LR parsing

    Get PDF
    In parsing theory, LL parsing and LR parsing are regarded to be two distinct methods. In this paper the relation between these methods is clarified.As shown in literature on parsing theory, for every context-free grammar, a so-called non-deterministic LR(0) automaton can be constructed. Here, we show, that traversing this automaton in a special way is equivalent to LL(1) parsing. This automaton can be transformed into a deterministic LR-automaton. The description of a method to traverse this automaton results into a new formulation of the LR parsing algorithm. Having obtained in this way a relationship between LL and LR parsing, the LL(1) class is characterised, using several LR-classes

    Ch(k) grammars: A characterization of LL(k) languages

    Full text link

    ΠŸΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½Π½Ρ‹Ρ… контСкстно-свободных Π³Ρ€Π°ΠΌΠΌΠ°Ρ‚ΠΈΠΊ Π² Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΠ΅ синтаксичСского Π°Π½Π°Π»ΠΈΠ·Π° Generalised LL

    Get PDF
    Π“ΠΎΡ€ΠΎΡ…ΠΎΠ² АртСм Π’Π»Π°Π΄ΠΈΠΌΠΈΡ€ΠΎΠ²ΠΈΡ‡ ΠŸΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½Π½Ρ‹Ρ… контСкстно-свободных Π³Ρ€Π°ΠΌΠΌΠ°Ρ‚ΠΈΠΊ Π² Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΠ΅ синтаксичСского Π°Π½Π°Π»ΠΈΠ·Π° Generalised LL ΠΊΠ°Π½Π΄ΠΈΠ΄Π°Ρ‚ Ρ„ΠΈΠ·ΠΈΠΊΠΎ-матСматичСских Π½Π°ΡƒΠΊ Π‘Π΅ΠΌΠ΅Π½ ВячСславович Π“Ρ€ΠΈΠ³ΠΎΡ€ΡŒΠ΅Π² НаправлСниС ΠΌΠ°Ρ‚Π΅ΠΌΠ°Ρ‚ΠΈΠΊΠ° ΠΈ ΠΌΠ΅Ρ…Π°Π½ΠΈΠΊΠ°, ΠΊΠ°Ρ„Π΅Π΄Ρ€Π° систСмного программирования БинтаксичСский Π°Π½Π°Π»ΠΈΠ· ΠΈΠ³Ρ€Π°Π΅Ρ‚ Π²Π°ΠΆΠ½ΡƒΡŽ Ρ€ΠΎΠ»ΡŒ Π² статичСском Π°Π½Π°Π»ΠΈΠ·Π΅ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌ: Π½Π° этом этапС Π°Π½Π°Π»ΠΈΠ·Π° создаётся структурноС прСдставлСниС ΠΊΠΎΠ΄Π°, Π½Π°Π΄ ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΌ производится дальнСйший Π°Π½Π°Π»ΠΈΠ·. Π˜Π½ΡΡ‚Ρ€ΡƒΠΌΠ΅Π½Ρ‚Ρ‹ для Π³Π΅Π½Π΅Ρ€Π°Ρ†ΠΈΠΈ синтаксичСских Π°Π½Π°Π»ΠΈΠ·Π°Ρ‚ΠΎΡ€ΠΎΠ² ΠΏΠΎ спСцификации языка Π°Π²Ρ‚ΠΎΠΌΠ°Ρ‚Π·ΠΈΡ€ΡƒΡŽΡ‚ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΡƒ Π°Π½Π°Π»ΠΈΠ·Π°Ρ‚ΠΎΡ€ΠΎΠ². ΠžΠ±Ρ‹Ρ‡Π½ΠΎ спСцификациСй слуТит нСоднозначная Π³Ρ€Π°ΠΌΠΌΠ°Ρ‚ΠΈΠΊΠ° Π² Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½Π½ΠΎΠΉ Ρ„ΠΎΡ€ΠΌΠ΅ Бэкуса-Наура (EBNF), Π½ΠΎ Π±ΠΎΠ»ΡŒΡˆΠΈΠ½ΡΡ‚Π²ΠΎ инструмСнтов Π½Π΅ ΠΌΠΎΠ³ΡƒΡ‚ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ Π΄Π°Π½Π½ΡƒΡŽ Ρ„ΠΎΡ€ΠΌΡƒ Π±Π΅Π· прСобразования. АвтоматичСскоС ΠΏΡ€Π΅ΠΎΠ±Ρ€Π°Π·ΠΎΠ²Π°Π½ΠΈΠ΅ Π³Ρ€Π°ΠΌΠΌΠ°Ρ‚ΠΈΠΊ ΠΎΠ±Ρ‹Ρ‡Π½ΠΎ ΠΏΡ€ΠΈΠ²ΠΎΠ΄ΠΈΡ‚ ΠΊ сниТСнию ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ Π°Π½Π°Π»ΠΈΠ·Π°. Π‘ΡƒΡ‰Π΅ΡΡ‚Π²ΡƒΡŽΡ‚ ΠΏΠΎΠ΄Ρ…ΠΎΠ΄Ρ‹ ΠΊ синтаксичСскому Π°Π½Π°Π»ΠΈΠ·Ρƒ EBNF-Π³Ρ€Π°ΠΌΠΌΠ°Ρ‚ΠΈΠΊ, Π½ΠΎ ΠΎΠ½ΠΈ Π½Π΅ Π΄ΠΎΠΏΡƒΡΠΊΠ°ΡŽΡ‚ нСоднозначностСй Π² Π³Ρ€Π°ΠΌΠ°Ρ‚ΠΈΠΊΠ°Ρ…. Π‘ Π΄Ρ€ΡƒΠ³ΠΎΠΉ стороны, Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌ Generalised LL позволяСт ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ Π½Π΅ΠΎΠ΄Π½ΠΎΠ·Π½Π°Ρ‡Π½Ρ‹Π΅ BNF-Π³Ρ€Π°ΠΌΠΌΠ°Ρ‚ΠΈΠΊΠΈ ΠΈ ΠΏΠΎΠΊΠ°Π·Ρ‹Π²Π°Π΅Ρ‚ Ρ…ΠΎΡ€ΠΎΡˆΡƒΡŽ ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ, Π½ΠΎ Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ‚ Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ с EBNF-Π³Ρ€Π°ΠΌΠΌΠ°Ρ‚ΠΈΠΊΠ°ΠΌΠΈ. Π’ этой Ρ€Π°Π±ΠΎΡ‚Π΅ прСдлагаСтся модификация Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΠ° GLL, ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡŽΡ‰Π°Ρ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ Ρ„ΠΎΡ€ΠΌΠ°Ρ‚ Π³Ρ€Π°ΠΌΠ°Ρ‚ΠΈΠΊ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ тСсно связан с EBNF: Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½Π½Ρ‹Π΅ контСкстно-свободныС Π³Ρ€Π°ΠΌΠΌΠ°Ρ‚ΠΊΠΈ. ΠšΡ€ΠΎΠΌΠ΅ Ρ‚ΠΎΠ³ΠΎ, Π±Ρ‹Π»ΠΎ ΠΏΠΎΠΊΠ°Π·Π°Π½ΠΎ, Ρ‡Ρ‚ΠΎ модификация ΡƒΠ²Π΅Π»ΠΈΡ‡ΠΈΠ²Π°Π΅Ρ‚ ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΠ° ΠΏΠΎ ΡΡ€Π°Π²Π½Π΅Π½ΠΈΡŽ с основанным Π½Π° ΠΏΡ€Π΅ΠΎΠ±Ρ€Π°Π·ΠΎΠ²Π°Π½ΠΈΠΈ EBNF. Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Π½Π½Ρ‹Ρ… источников: 32 Π“ΠΎΡ€ΠΎΡ…ΠΎΠ², А. Π’. ΠŸΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½Π½Ρ‹Ρ… контСкстно-свободных Π³Ρ€Π°ΠΌΠΌΠ°Ρ‚ΠΈΠΊ Π² Π°Π»Π³ΠΎΡ€ΠΈΡ‚ΠΌΠ΅ синтаксичСского Π°Π½Π°Π»ΠΈΠ·Π° Generalised LL: выпускная квалификационная Ρ€Π°Π±ΠΎΡ‚Π°: Π·Π°Ρ‰ΠΈΡ‰Π΅Π½Π° 09.06.2017 / Π“ΠΎΡ€ΠΎΡ…ΠΎΠ² АртСм Π’Π»Π°Π΄ΠΈΠΌΠΈΡ€ΠΎΠ²ΠΈΡ‡. – БПб., 2017. – 37 с. – Библиография: с. 31–34.Gorokhov Artem Vladimirovich Support of extended context-free grammars in Generalised LL parsing algorithm Associate professor Semyon Grigorev. Mathematics & mechanics, software engineering department Parsing plays an important role in static program analysis: during this step a structural representation of code is created upon which further analysis is performed. Parser generator tools, being provided with syntax specification, automate parser development. Language documentation often acts as such specification. Documentation usually takes form of ambiguous grammar in Extended Backus-Naur Form which most parser generators fail to process. Automatic grammar transformation generally leads to parsing performance decrease. Some approaches support EBNF grammars natively, but they all fail to handle ambiguous grammars. On the other hand, Generalised LL parsing algorithm admits arbitrary context-free grammars and achieves good performance, but cannot handle EBNF grammars. The main contribution of this paper is a modification of GLL algorithm which can process grammars in a form which is closely related to EBNF (Extended Context-Free Grammar). We also show that the modification improves parsing performance as compared to grammar transformation-based approach. Sources cited: 32 Gorokhov, A. V. Support of extended context-free grammars in Generalised LL parsing algorithm: Graduation thesis: Defended 09.06.2017 / Gorokhov Artem Vladimirovich. – St. Petersburg., 2017. – 37 pp. – Bibliography: pp. 21-34

    Structure preserving transformations on non-left-recursive grammars

    Get PDF
    We will be concerned with grammar covers, The first part of this paper presents a general framework for covers. The second part introduces a transformation from nonleft-recursive grammars to grammars in Greibach normal form. An investigation of the structure preserving properties of this transformation, which serves also as an illustration of our framework for covers, is presented
    • …
    corecore