Neil Zanella <nzanella@cs.mun.ca> wrote:
# Hello,
#
# I have seen the words "static checking" in the context of compilers
# several times as something typically done in between the parsing and
# intermediate code generation phases of the compiler. Could anyone

Are you referring to 'static semantics'?

For some reason people have the idea that syntax can refer to
context-free (CF) syntax. Perhaps because all but language have their
formal syntax define a CF grammar instead of a context sensitive (CS)
grammar. Part of the confusion is that to build an efficient grammar
you need to extract a formal CF grammar to feed into the parser
constructor; rest of the CS grammar is left as a collection of
assertions about the parse trees.

The semantics define an interpretation of parse trees.

Most language are defined as a formal CF grammar + natural language CS
constraints + natural language semantics. Rather than grouping on a
syntax/semantics split (CF grammar + CS constraints) + (semantics),
it's more usual to make the split based on the notation (formal CF
grammar) + (natural language CS + natural language semantics). Then
all the natural language verbiage gets labelled 'semantics'; the CS
constraints get labelled as the 'static semantics'.