CS450 Compiler Design
Contextual Constraints
Syntax rules
alone are not enough to specify the format of well-formed
programs.
Example 1:
let const
m~2
in
putint(m + x)
Example 2:
let const
m~2 ;
var
n:Boolean
in
begin
n := m<4;
n := n+1
end
Undefined!
Scope Rules
Type error!
Type Rules