scispace - formally typeset
Search or ask a question
Topic

Tree-adjoining grammar

About: Tree-adjoining grammar is a research topic. Over the lifetime, 2491 publications have been published within this topic receiving 57813 citations.


Papers
More filters
Proceedings ArticleDOI
22 Sep 2011
TL;DR: This work presents a novel method of embedding context-free grammars in Haskell, and to automatically generate parsers and pretty-printers from them, and supports adding anti-quotation to the generated quasi-quoters, which allows users of the defined language to mix concrete and abstract syntax almost seamlessly.
Abstract: We present a novel method of embedding context-free grammars in Haskell, and to automatically generate parsers and pretty-printers from them. We have implemented this method in a library called BNFC-meta (from the BNF Converter, which it is built on). The library builds compiler front ends using metaprogramming instead of conventional code generation. Parsers are built from labelled BNF grammars that are defined directly in Haskell modules. Our solution combines features of parser generators (static grammar checks, a highly specialised grammar DSL) and adds several features that are otherwise exclusive to combinatory libraries such as the ability to reuse, parameterise and generate grammars inside Haskell.To allow writing grammars in concrete syntax, BNFC-meta provides a quasi-quoter that can parse grammars (embedded in Haskell files) at compile time and use metaprogramming to replace them with their abstract syntax. We also generate quasi-quoters so that the languages we define with BNFC-meta can be embedded in the same way. With a minimal change to the grammar, we support adding anti-quotation to the generated quasi-quoters, which allows users of the defined language to mix concrete and abstract syntax almost seamlessly. Unlike previous methods of achieving anti-quotation, the method used by BNFC-meta is simple, efficient and avoids polluting the abstract syntax types.

16 citations

01 Jan 2007
TL;DR: It is proved that every recursively enumerable language is gen erated, and the new results concerning descriptional complexity of partially parallel Grammars and grammars regulated by context conditions are presented.
Abstract: The subject of this monograph is divided into two parts-regulated and reduced formal models. The first part introduces and studies self-regulating finite and pushdown automata. In essence, these automata regulate the use of their rules by a sequence of rules applied during the previous moves. A special attention is paid to turns defined as moves during which a self-regulating automaton starts a new self-regulating sequence of moves. Based on the number of turns, two infinite hierarchies of language families resulting from two variants of these automata are established (see Sections 4.1.1 and 4.1.2). Section 4.1.1 demonstrates that in case of self-regulating finite automata these hierarchies coincide with the hierarchies resulting from parallel right linear and right linear simple matrix grammars, so the self-regulating finite automata can be viewed as the automaton counterparts to these grammars. Finally, both infinite hierarchies are compared. In addition, Section 4.1.2 discusses some results and open problems concerning self-regulating pushdown automata. The second part studies descriptional complexity of partially parallel grammars (Section 5.1) and grammars regulated by context conditions (Section 5.2) with respect to the number of nonterminals and a special type of productions. Specifically, Chapter 5 proves that every recursively enumerable language is gen erated (i) by a scattered context grammar with no more than four non-context-free productions and four nonterminals, (ii) by a multisequential grammar with no more than two selectors and two nonterminals, (iii) by a multicontinuous grammar with no more than two selectors and three nonterminals, (iv) by a context-conditional grammar of degree (2, 1) with no more than six conditional productions and seven nonterminals, (v) by a simple context-conditional grammar of degree (2, 1) with no more than seven conditional productions and eight nonterminals, (vi) by a generalized forbidding grammar of degree two and index six with no more than ten conditional productions and nine nonterminals, (vii) by a generalized forbidding grammar of degree two and index four with no more than eleven conditional productions and ten nonterminals, (viii) by a generalized forbidding grammar of degree two and index nine with no more than eight conditional productions and ten nonterminals, (ix) by a generalized forbidding grammar of degree two and unlimited index with no more than nine conditional productions and eight nonterminals, (x) by a semi-conditional grammar of degree (2, 1) with no more than seven conditional productions and eight nonterminals, and (xi) by a simple semi-conditional grammar of degree (2, 1) with no more than nine conditional productions and ten nonterminals. Chapter 2 contains basic definitions and the notation used during this monograph. Chapter 3 then summarizes the previous known results related to the studied formal models; regulated automata and descriptional complexity of partially parallel grammars and grammars regulated by context conditions. Chapter 4 studies self-regulating automata, and Chapter 5 presents the new results concerning descriptional complexity of partially parallel grammars and grammars regulated by context conditions.

16 citations

Book ChapterDOI
25 Aug 1993
TL;DR: An algorithm is presented for automatically producing, from associations between their non-terminals and terminals, an attribute grammar which specifies the translation from one grammar to the other.
Abstract: This paper introduces the notion of a coupling of two grammars, defined by associations between their non-terminals and terminals. We present an algorithm for automatically producing, from these associations, an attribute grammar which specifies the translation from one grammar to the other.

15 citations

Journal Article
TL;DR: One more criterion of complexity of CFG's, namely Symb (G) = = the number of all occurrences of all symbols in the rules of G, is defined and some results concerning the criteria Prod and Symb are derived.
Abstract: In papers [2] and [3] four criteria of complexity of context-free grammars (CFG's), denoted by Var, Lev, Lev„, and Depth, have been studied. These criteria reflect the intrinsic complexity of CFG's and they induce the criteria of complexity of contextfree languages (CFL's) which reflect the intrinsic complexity of the description of CFL's by CFG's. The criterion Prod (G) = the number of rules of a CFG G, studied in [3] represents the size of CFG's. In the present paper one more criterion of complexity of CFG's, namely Symb (G) = = the number of all occurrences of all symbols in the rules of G, is defined and some results concerning the criteria Prod and Symb are derived.

15 citations

Journal ArticleDOI
TL;DR: It is demonstrated that without erasing rules, one-sided random context grammars characterize the family of context-sensitive languages, and with erasingrules, these grammARS characterize theFamily of recursively enumerable languages.
Abstract: The notion of a one-sided random context grammar is defined as a context-free-based regulated grammar, in which a set of permitting symbols and a set of forbidding symbols are attached to every rule, and its set of rules is divided into the set of left random context rules and the set of right random context rules. A left random context rule can rewrite a nonterminal if each of its permitting symbols occurs to the left of the rewritten symbol in the current sentential form while each of its forbidding symbols does not occur there. A right random context rule is applied analogically except that the symbols are examined to the right of the rewritten symbol. The paper demonstrates that without erasing rules, one-sided random context grammars characterize the family of context-sensitive languages, and with erasing rules, these grammars characterize the family of recursively enumerable languages. In fact, these characterization results hold even if the set of left random context rules coincides with the set of right random context rules. Several special cases of these grammars are considered, and their generative power is established. In its conclusion, some important open problems are suggested to study in the future.

15 citations


Network Information
Related Topics (5)
Graph (abstract data type)
69.9K papers, 1.2M citations
85% related
Parsing
21.5K papers, 545.4K citations
85% related
Time complexity
36K papers, 879.5K citations
84% related
Semantics
24.9K papers, 653K citations
82% related
Tree (data structure)
44.9K papers, 749.6K citations
81% related
Performance
Metrics
No. of papers in the topic in previous years
YearPapers
202315
202225
20217
20205
20196
201811