Backus-Naur Form (BNF)
a rule notation for presenting the syntax of languages
⟨nounphrase⟩∶∶= ⟨adjective⟩⟨nounphrase⟩
⟨nounphrase⟩∶∶= ⟨nounphrase⟩⟨noun⟩
⟨nounphrase⟩∶∶= ⟨noun⟩
∣ ⟨adjective⟩⟨nounphrase⟩
∣ ⟨nounphrase⟩⟨noun⟩
semantics
the realm of characterization of the meanings of expressions on the basis of their structureorder of operations
, precedence
, associativity of an operator - left associative
when the operations are applied starting with the left one, right associative
ie. OCaml’s exponentiation operator **
abstract syntax
for expressions qua structured objects
concrete syntax
for their linear-notated manifestations
ie. (3+4)+5
<aside> 💡 Note: concrete syntax structures may produce certain expressions that seem related but that don’t have the same abstract syntax. For example, 5 * (3 + 4) wouldn’t have the same syntax as (3+4)+5
</aside>
~-
, the unary negation operator(* ⟨⟩ *)