Preliminaries

The Translation Process - Getting from Source code to Execution

Compilation Interpretation

The above are the two extremes with all sorts of variations in between

Other Possible Phases of Translation

Preprocessing

Linking

Program Structure as Related to Translation and Execution

Lexical Structure of a Program

The rules regarding the words and symbols of a program (think of it like spelling). The words and symbols are known as tokens.

Example of lexical compilation errors:

Syntactic Structure of a Program

The rules regarding the 'sentences' and 'paragraphs' of the program (think of it like grammar).

Example of syntactic compilation errors:

Semantics of a Program

The rules regarding valid 'meaning' a program (whether the program 'makes sense').

Example of semantic compilation errors:

Logic of a Program

What's correct/incorrect is up to the programmer.

/* This program reads in a number and prints the number and its square */

main() {
	int x;
	scanf("%d", &n);
	printf("The square of %d is %d\n"
	

Binding and Binding Times

We would like to be able to speak of the point at which a program element is bound (i.e., associated with) to a particular characteristic or property.

Binding time is the point at which this association (or choice) is made. Various Binding Times and Examples

Translating Java