|
A "language" in this context, is a set of strings. (a string is a sequence of symbols, e.g. a program). A grammar defines a language. For example, the regular grammar (a|b)(x|y)
defines the language {"ax", "ay", "bx", "by"}
Unfortunately, the term "language" has other meanings. There's human languages, like English. There's also programming languages, like lisp, python, java. And markup languages like HTML and XML. And other computer-related non-programming languages.While it's true that these other languages have more to them than their syntax, they do define a "language" in the above initial sense: the set of all valid instances of it (i.e. without syntax errors), the set of sequences of symbols. Programming languages generally include ways of extending their language (in the initial sense). Even java: a java program includes a syntax for extending its syntax (its "language"), in the sense that a program using a certain method invocation becomes valid, if that method is defined. Thus, it is itself both definitions of a grammar, and instances within that grammar - like XML and XSD combined in one (or XML and DTD). BTW: this reply (and the two similar ones) will probably annoy you, because you know what a "formal language" is (at least, you use the term). I think your misinterpretation is that the article does not claim anything about "natural languages" - only the shape/structure of a language ("So, what shapes languages? Grammars do."/"Behind every language, there is a grammar that determines its structure."). To be fair though, it then jumps straight into "A grammar defines a language.", without noting a shift in the meaning of the term "language". I think its meaning is clear from context, but it's certainly misleading to shift terminology as you go along! |