1,836 research outputs found
Simple chain grammars and languages
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
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
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
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
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
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
ΠΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠ° ΡΠ°ΡΡΠΈΡΠ΅Π½Π½ΡΡ ΠΊΠΎΠ½ΡΠ΅ΠΊΡΡΠ½ΠΎ-ΡΠ²ΠΎΠ±ΠΎΠ΄Π½ΡΡ Π³ΡΠ°ΠΌΠΌΠ°ΡΠΈΠΊ Π² Π°Π»Π³ΠΎΡΠΈΡΠΌΠ΅ ΡΠΈΠ½ΡΠ°ΠΊΡΠΈΡΠ΅ΡΠΊΠΎΠ³ΠΎ Π°Π½Π°Π»ΠΈΠ·Π° Generalised LL
ΠΠΎΡΠΎΡ
ΠΎΠ² ΠΡΡΠ΅ΠΌ ΠΠ»Π°Π΄ΠΈΠΌΠΈΡΠΎΠ²ΠΈΡ ΠΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠ° ΡΠ°ΡΡΠΈΡΠ΅Π½Π½ΡΡ
ΠΊΠΎΠ½ΡΠ΅ΠΊΡΡΠ½ΠΎ-ΡΠ²ΠΎΠ±ΠΎΠ΄Π½ΡΡ
Π³ΡΠ°ΠΌΠΌΠ°ΡΠΈΠΊ Π² Π°Π»Π³ΠΎΡΠΈΡΠΌΠ΅ ΡΠΈΠ½ΡΠ°ΠΊΡΠΈΡΠ΅ΡΠΊΠΎΠ³ΠΎ Π°Π½Π°Π»ΠΈΠ·Π° 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
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
- β¦