Lecture 10 – September 29th
Java programs were returned and discussed.
FORTRAN homework was returned and discussed.
Pascal programs were collected.
Some FORTRAN homework on precedence of .AND. over .OR. was returned. remainder will be available tomorrow.
Some Pascal homework on sum and average of 3 integers was returned. remainder will be available tomorrow.
Dr. Grove will lecture on: recursive descent parsing and bottom up parsing on Tuesday. I will not be on campus.
You already have a set of Pascal questions to be turned in to Dr. Grove on Tuesday.
I will be back on Thursday.
I will be posting another Pascal program which will be due on Thursday.
Here are links to a number of the individual Pascal programs we went over in class illustrating the user of
pointers, records, and files. They have had some documentation added to explain what each is trying to do.
The file example has significant documentation illustrating the use of files
More information about pointer variables in Pascal
The predefined Pascal procedure new is used to
acquire memory locations and assign their addresses to pointer variables during
program execution. The format of the
call is new (next); where next
is a pointer variable.
The predefined constant nil can be assigned to a pointer variable to indicate that it does not point anywhere.
One pointer variable can be told to point where another pointer variable is pointing. Suppose current is a pointer variable, then
you can say next := current; as long as next is also a pointer variable of the same type.
If P is a pointer variable, then P is an address being pointed to.
P^ is where the data is.
Here’s an analogy.
Suppose you are pointing at an object.
Your finger is P, while
the object you are pointing to is P^
The predefined Pascal procedure dispose is used to
release memory locations.