Wednesday, March 19, 2008

All About Gotos

Read this article from Knuth, "Structured programming with go to statements"

Friday, March 14, 2008

Homework: Implement a CFG

You can watch the video detailing the assignment here:
http://www.girsology.com/proglang/

And as soon as Revver approves the video, I will embed the video in this post as well.
Update: Here it is:

Wednesday, March 05, 2008

class notes for today

type
colors ( red, blue, green, yellow, orage, white, black);

colorset = set of colors;

var
set1, set2 : colorset;

set1 := [ red, blue, yellow ];
set2 := set1;
set2 := [black, blue ];

if (ch = 'c' or ch = 'r' or ch = 'y')

if (ch in ['c', 'r', 'y'])

if (c in colorset)

as bitset

['a' ... 'p']

foo()
{
int * p, *y;
p = &f;
p = y;

cout *p;

cout p;
p = y;
*p = *y;
p =: y;
p =: f;


int * p = new int [100];

p = new int [100];

*(p + 7);
p[7];
cout 7[p];
*(7 + p);

int &r = t;

r
*r

}


Tombstone
lock and key

int *y;
foo()
{
Int *p;
p = new int;
y = p;
}

eager approach
lazy approach

refernce counting
garbage collection

The Three-Register Garbage Recycler, or Nodes for Free, by David Wise

"The Three-Register Garbage Recycler, or Nodes for Free," by David Wise. Use the links to the image.

Questions to follow, or perhaps I will ask someone to present.

Read this paper on Distributed Cyclic Reference Counting

Read this paper on "Distributed Cyclic Reference Counting" by Frank Dehne, Rafael D. Lins.

Questions on the paper to follow. Or perhaps I will ask someone to summarize the paper.

Monday, March 03, 2008

Some class notes

1 4 6 8 5 32 0 -1
1 4 6 8 5 3 2 0 -1
1 8 2 4 5 0 6 3 -1
int list[10];cout list[k];
address(list[k]) = address(list[1]) + (k-lowerbound)*el_size= address(list[1])- lowerbound*el_size + k*el_size
descriptor for arrays_________arrayelem typeindex type# of dimensionsindex upper boundindex lower boundaddress
// using ] in place of greater than because of html%salaries = ("Cedric" =] 75000, "Perry" =]56000);$salaries{"Perry"} = 70000;$s = "Josh";$salaries{$s} = 8000;if exists $salaries{"Shelly"}delete $salaries{"Perry"};%salaries = ();
01 EMPLOYEE-RECORD 02 EMPLOYEE-NAME 05 FIRST PICTURE IS X(20) 05 MID PICTURE IS X(20) 05 LAST PICTURE IS X(20) 02 HOURLY-RATE PICTURE IS 99V99
01 employer-record 02 employer-name 05 FIRST PICTURE IS X(20) 05 LAST PICTURE IS X(20) 05 SSN PICTURE IS X(20)
FIRST OF EMPLOYEE-NAME OF EMPLOYEE-RECORD
FIRST OF EMPLOYEE-RECORD
STRUCT A{ STRUCT B { INT X; INT Y; } J; CHAR Z; } H;
H.J.X
class a{ int i; char * p; string g; a() { p = new char [60]; ~a() { delete [] p; }};
a b, c;
b = c;
b.g = c.g;
move corresponding employer-record to employee-record
dynamic variables as discussed in the papermain(){ int x, y; int z; set z : int = x -4 in { foo(); bar(); } bar();}
foo(){ int a, b; use z : int in { cout z;
}}
bar(){ int q; set z : int = q -4 in { foo(); }}