What are the meanings of metalanguage and metasyntax and EBNF?
In general, informally, a metalanguage is a language used to talk
about a language, possibly to specify it or to study its properties.

For example, linguists use English to describe the English
language. As a consequence English is used as its own metalanguage.
To avoid confusion, various quoting system are used to distinguish the
two level. For example, when talking about a small animal that barks,
we use the word "dog". Here, "dog" represent a word of a language
being talked about, not any of the possible meanings of that word in
the language it belongs to. It cannot bite.

When a language A is used as metalanguage to talk about a language B,
B is called the object language. But, though sometimes used in a
formal way, this is very similar to saying that wheather is the object
of many conversations.

In computer science, a well known example is the programming language
ML. The name ML actually stand for metalanguage. ML was initially
conceived by Robin Milner as a metalanguage to develop proofs about a small language
called pplambda in the LCF theorem prover. Hence, both syntactic and
semantic properties of pplambda can be expressed in ML.

Another well known example is Lisp, a language that is its own meta
language, and has been the first programming language to have that property. Lisp programs can be syntactically represented as a Lisp
data structure. The semantics of Lisp is also expressed in Lisp, since
the first Lisp interpreter was written in Lisp.

This works so well that the feat has since be often repeated for many other
programming languages, and it is very customary to write the first
compiler of a language in the
language itself, as part of a language bootstrapping process. Hence
the language is self compiling. This requires defining both the syntax
and the semantics of the language in itself.

So, in effect, most programming languages are, or can be, a
metalanguage for themselves, and for other programming languages.
That is actually the least one can expect from languages that often
claim to have Turing power.

The concept of metalanguage often concerns a conplete object language,
whether natural language or programming language, with syntax and semantics. But it can also
concern languages in the formal language sense, which are only syntax.  A mathematical
formalism used to describe (a family of) formal languages (regular
sets, context-free, recursively enumerable, ...) is a metalanguage for
this formal language.

This is more interesting when the syntax of the metalanguage belongs to the same language
family as the formal languages it describes.  The best known example is the
BNF language (Backus-Naur Form), and its later EBNF variant. It is a
language used to write context-free (CF) grammars, thus to define
purely syntactic languages. Its own syntax is context-free, hence
describable in BNF.  Hence BNF can be syntactically its own metalanguage,
but not semantically.  But then, BNF describes only CF languages and
has no claim for Turing power.

It is to be noted that BNF has a CF syntax, but it also has
semantics. The semantics of a BNF program is precisely a CF grammar and the formal language it defines,
to which the BNF program associates no semantics. A context-free
grammar just defines a formal language, and no semantics is
associated. Hence it is wrong to consider that BNF is a CF
grammar.  BNF has a CF grammar which defines its syntax.

Answering your questions

Regarding the two preliminary quotes. They are expressed in the
context of formal systems, and "formal" means mathematically defined,
which may include both syntax and semantics for the language. It does
not contradict the above discussion, but rather confirms it.


A formal grammar of a formal language is not a metalanguage of
the formal language. The mathematical formalism used to write the
grammar is in this case the metalanguage.

The quote goes into an issue that I did not address here, that of the
structure that a syntax definition can attach to the strings of a
formal language. It is, as far as I see, quite unrelated to the
concept of metalanguage, when we talk of formal languages in the
formal language theory sense. Two different syntactic definitions can
produce the same language, when considering only the string it
defines for the language. But these definitions implicitly associate
diffrerent structures with the string (such as parse-trees in the context-free
case) and that can be important.

When the formal language is actually the syntax of a complete
language that also has semantics, the structure is important as it is
usually organizing the definition of the semantics, which is the
purpose of many metalanguages.
As written above, a context-free grammar cannot be a metalanguage
since it has no semantics. The formalism used to write the CF grammar
is a metalanguage for the purely syntactic formal language defined by
this CF grammar. EBNF is a language with both syntax and semantics.
A program  (or whatever you want to call it: text, description,
grammar, ...) written in EBNF is a text using the syntax of
EBNF. This text has a meaning, defined by the semantics of EBNF,
which is the CF grammar it describes. EBNF is not a metasyntax, but a
meta language for syntax.

This calls for more precision. I consider that the word metasyntax is
just shorthand for the expression "syntax of [a/the] metalanguage". I
do not ses what other meaning it could have.

The first quote is just nonsense to me. The second quote is poorly
phrased and should rather be (if I understand the intent):  


  Extended Backus-Naur Form (EBNF) is a family of metalanguages for
  defining syntax, any of which can be used to express a context-free
  grammar.

The quote (out of its context) is in agreement with what I said so
far. The expression "formal metalanguage" is not to be understood as
formal language in the formal language theory sense, but as a
language with a formally, i.e., mathematically, defined syntax and
semantics.

This quote alone just say that EBNF is a widely used metalanguage for
computer languages, but without being more precise about it.
Actually, according to me, EBNF is a metalanguage for (more than one)
formal languages in the formal language theory sense, since it can
only talk about the syntax, and pure syntax without semantics may be
seen as such a formal language. But these formal languages are those
described by the grammars expressed in EBNF. A grammar itself is not
a language, but it may be part of a language seen as a global object of study, since it can describe its syntax.


I hope this clarifies things.