2

Look at the Swift language where the available operators are not defined in the language, but in the standard library. There are rules that let the compiler distinguish between binary and unary operators. An expression is operands, possibly preceded or followed by unary operators, and separated by binary operators. That’s decided by the grammar, without any ...


1

Your question is very broad and has possibly hundreds of answers depending on the interpretation. The fact you tagged it with "formal-languages" and "formal-grammars" suggests you are actually asking "how the syntax of a language describing this kind of stuff should look like". Sometimes, reading your question I feel you are ...


Only top voted, non community-wiki answers of a minimum length are eligible