View on GitHub

Principles of Static Program Analysis

Educational and Research Materials

While Language Specification

Syntactic Categories

P Programs
V Variable declarations
S Statements
x, y Variables
n Numerals
a Arithmetic expressions
b Boolean expressions
opa Arithmetic operators: +, -, /, *, %
opb Boolean operators: and, or, xor
opr Relational operators: ==, !=, <, >, <=, >=
opbt Bitwise operators: <<, >>, &, |, ^

Abstract Syntax

Programs P:

Variable declarations V:

Statements S:

Boolean expressions b:

Arithmetic expressions a:

Example

While program calculating factorial is here:

begin
  var x;
  var y;
  var z;
  read x;
  y := x;
  z := 1;
  while y > 1 do
    z = z * y;
    y = y - 1
  write y
end