Talk:Two-level grammar

From Wikipedia, the free encyclopedia

WikiProject Mathematics
This article is within the scope of WikiProject Mathematics, which collaborates on articles related to mathematics.
Mathematics rating: Stub Class Low Priority  Field: Foundations, logic, and set theory
Please update this rating as the article progresses, or if the rating is inaccurate. Please also add comments to suggest improvements to the article.

[edit] Notes & Queries

JA: The last I remember, a 2-level grammar was a grammar for a 2-level language, which is, naturally enough, a language that is specified at 2 levels, say, words and sentences. And so on for k-level languages and grammars. I haven't seen this term used for "meta-grammars", though I do remember some papers from the 80's, by Douglas Hofstadter and others, on a similar idea, but I think they called them "control grammars" or something like that. So it would help to have a lit ref for this usage. Jon Awbrey 13:44, 28 April 2006 (UTC)

Following your example a grammar such as:
Sentence ::= Word Sentence
Word ::= word1 | word2 | ... | word_N_
would be a two-level grammar. This doesn't seem very rigorous. --MarSch 14:51, 28 April 2006 (UTC)

JA: No, that's not how it's specified. Will find some refs later. Pending literature refs for the other usage, I'll suggest using "2-phase grammar" or "2-level metagrammar" for that. Jon Awbrey 15:22, 28 April 2006 (UTC)

Well, it's all over google, but most links are not really useful to include, since they are not really about two-level gramamrs, but doing incomprehensible stuff with them. At least I found the lecture notes :) . Also many references with respect to Van Wijngaarden grammars mention two-level grammar as a synonnym or as a more general notion. There are not so many hits for Van Wijngaarden grammar though, 3 orders less or so. --MarSch 15:48, 28 April 2006 (UTC)
For definateness: http://www.cis.uab.edu/bryant/papers/lpar92.pdf
What would be good is a copy of “Two-level Grammar as a Functional Programming Language” [1] --MarSch 16:22, 28 April 2006 (UTC)

[edit] Bogus first definition

I have never seen the term two-level grammar used for the superposition of two grammars, such as the C preprocessor and the underlying C++ language. Unless someone can provide a valid reference for this simplistic/degenerate definition of two-level grammars, then the first definition should be removed. Only the second definition is what most people refer to when discussing two-level grammars such as van Wijngaarden grammars and the seminal Algol68 usage of vW TLGs. If the degenerate definition is allowed to stand, then this article will need to invent the term "generative two-level grammar" to describe what the rest of computer science calls "two-level grammar" in the van Wijngaarden sense. —optikos 23:36, 27 August 2006 (UTC)

I just checked this article out, and in addition to be rather lacking, I agree that the first definition should be removed. Also, there should be a reference to an important textbook on the subject, by Cleaveland and Uzgalis. I may get around to this one day. --Lasse Hillerøe Petersen 21:31, 27 February 2007 (UTC)