Index: translator/Parser/cfa.y
===================================================================
--- translator/Parser/cfa.y	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/Parser/cfa.y	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -10,6 +10,6 @@
  * Created On       : Sat Sep  1 20:22:55 2001
  * Last Modified By : Peter A. Buhr
- * Last Modified On : Mon Nov  3 11:21:43 2003
- * Update Count     : 856
+ * Last Modified On : Mon Nov  3 16:24:24 2014
+ * Update Count     : 880
  */
 
@@ -2743,4 +2743,4 @@
 /* Local Variables: */
 /* fill-column: 110 */
-/* compile-command: "gmake" */
+/* compile-command: "make install" */
 /* End: */
Index: translator/SymTab/Validate.cc
===================================================================
--- translator/SymTab/Validate.cc	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/SymTab/Validate.cc	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -553,4 +553,7 @@
 makeScalarAssignment( ObjectDecl *srcParam, ObjectDecl *dstParam, DeclarationWithType *member, OutputIterator out )
 {
+  ObjectDecl *obj = dynamic_cast<ObjectDecl *>( member ); // PAB: unnamed bit fields are not copied
+  if ( obj != NULL && obj->get_name() == "" && obj->get_bitfieldWidth() != NULL ) return;
+
   UntypedExpr *assignExpr = new UntypedExpr( new NameExpr( "?=?" ) );
   
Index: translator/examples/Makefile
===================================================================
--- translator/examples/Makefile	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/Makefile	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -1,24 +1,32 @@
-CC=cfa
-CFLAGS=-g
+CC=../../bin/cfa
+CFLAGS = -g -Wunused-function -MD
+MAKEFILE_NAME = ${firstword ${MAKEFILE_LIST}}	# makefile name
 
-%.i: %.c
-	-$(CC) $(CFLAGS) -CFA $< > $@
+OBJECTS1 = iostream.o fstream.o fstream_test.o
+EXEC1 = fstream_test
 
-%.o: %.i
-	$(CC) $(CFLAGS) -c -o $@ $<
+OBJECTS2 = vector_int.o fstream.o iostream.o array.o iterator.o vector_test.o
+EXEC2 = vector_test
 
-all: vector_test
+OBJECTS = ${OBJECTS1} ${OBJECTS2}		# all object files
+DEPENDS = ${OBJECTS:.o=.d}			# substitute ".o" with ".d"
+EXECS = ${EXEC1} ${EXEC2}			# all executables
 
-vector_test: vector_test.o vector_int.o fstream.o iostream.o array.o iterator.o
-fstream_test: fstream_test.o fstream.o iostream.o
+########## Targets ##########
 
-array.o: array.i array.h iterator.h
-iterator.o: iterator.i iterator.h iostream.h
-vector_test.o: vector_test.i vector_int.h iostream.h fstream.h
-vector_int.o: vector_int.i vector_int.h
-fstream_test.o: fstream_test.i iostream.h fstream.h
-fstream.o: fstream.i iostream.h fstream.h
-iostream.o: iostream.i iostream.h
+.PHONY : all clean				# not file names
 
-clean:
-	rm -f fstream_test vector_test *.i *.o
+all : ${EXECS}					# build all executables
+
+${EXEC1} : ${OBJECTS1}				# link step 1st executable
+	${CC} ${CCFLAGS} $^ -o $@		# additional object files before $^
+
+${EXEC2} : ${OBJECTS2}				# link step 2nd executable
+	${CC} ${CCFLAGS} $^ -o $@		# additional object files before $^
+
+${OBJECTS} : ${MAKEFILE_NAME}			# OPTIONAL : changes to this file => recompile
+
+-include ${DEPENDS}				# include *.d files containing program dependences
+
+clean :						# remove files that can be regenerated
+	rm -f ${DEPENDS} ${OBJECTS} ${EXECS} *.class
Index: translator/examples/array.c
===================================================================
--- translator/examples/array.c	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/array.c	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -10,19 +10,16 @@
 /// {
 ///   begin = 0;
-///   end = array_last( array );
+///   end = last( array );
 /// }
 
+// The first element is always at index 0.
 forall( type array_type, type elt_type | bounded_array( array_type, elt_type ) )
-elt_type *
-get_begin( array_type array )
-{
-  return &array[ 0 ];
+elt_type * begin( array_type array ) {
+    return &array[ 0 ];
 }
 
+// The end iterator should point one past the last element.
 forall( type array_type, type elt_type | bounded_array( array_type, elt_type ) )
-elt_type *
-get_end( array_type array )
-{
-  return &array[ array_last( array ) ] + 1;
+elt_type * end( array_type array ) {
+    return &array[ last( array ) ] + 1;
 }
-
Index: translator/examples/array.h
===================================================================
--- translator/examples/array.h	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/array.h	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -2,14 +2,15 @@
 #define ARRAY_H
 
-#include "iterator.h"
+//#include "iterator.h"
 
-context array( type array_type, type elt_type )
-{
-  lvalue elt_type ?[?]( array_type, int );
+// An array has contiguous elements accessible in any order using integer indicies. The first
+// element has index 0.
+context array( type array_type, type elt_type ) {
+    lvalue elt_type ?[?]( array_type, int );
 };
 
-context bounded_array( type array_type, type elt_type | array( array_type, elt_type ) )
-{
-  int array_last( array_type );
+// A bounded array is an array that carries its maximum index with it.
+context bounded_array( type array_type, type elt_type | array( array_type, elt_type ) ) {
+    int last( array_type );
 };
 
@@ -17,10 +18,16 @@
 
 typedef int array_iterator;
+
 /// forall( type array_type, elt_type | bounded_array( array_type, elt_type ) )
 /// [ array_iterator begin, array_iterator end ] get_iterators( array_type );
+
+
+// A bounded array can be iterated over by using a pointer to the element type. These functions
+// return iterators corresponding to the first element and the one-past-the-end element, STL-style.
 forall( type array_type, type elt_type | bounded_array( array_type, elt_type ) )
-elt_type *get_begin( array_type );
+elt_type *begin( array_type );
+
 forall( type array_type, type elt_type | bounded_array( array_type, elt_type ) )
-elt_type *get_end( array_type );
+elt_type *end( array_type );
 
-#endif /* #ifndef ARRAY_H */
+#endif // ARRAY_H
Index: translator/examples/fstream.c
===================================================================
--- translator/examples/fstream.c	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/fstream.c	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -1,7 +1,7 @@
 // "cfa -E fstream.c > fstream_out.c"
 // "cfa -c -o fstream.o fstream.c"
+
 #include "fstream.h"
 
-#undef __cplusplus
 extern "C" {
 #include <stdio.h>
@@ -9,129 +9,102 @@
 }
 
-struct ofstream
-{
-  FILE *file;
-  int fail;
+struct ofstream {
+    FILE *file;
+    int fail;
 };
 
-ofstream *
-write( ofstream *os, const char *data, streamsize_type size )
-{
-  if( !os->fail ) {
-    fwrite( data, size, 1, os->file );
-    os->fail = ferror( os->file );
-  }
-  return os;
+ofstream * write( ofstream *os, const char *data, streamsize_type size ) {
+    if( !os->fail ) {
+	fwrite( data, size, 1, os->file );
+	os->fail = ferror( os->file );
+    }
+    return os;
 }
 
-int
-fail( ofstream *os )
-{
-  return os->fail;
+int fail( ofstream *os ) {
+    return os->fail;
 }
 
-static ofstream*
-make_ofstream()
-{
-  ofstream *new_stream = malloc( sizeof( ofstream ) );
-  new_stream->fail = 0;
-  return new_stream;
+static ofstream * make_ofstream() {
+    ofstream *new_stream = malloc( sizeof( ofstream ) );
+    new_stream->fail = 0;
+    return new_stream;
 }
 
-ofstream *
-ofstream_stdout()
-{
-  ofstream *stdout_stream = make_ofstream();
-  stdout_stream->file = stdout;
-  return stdout_stream;
+ofstream * ofstream_stdout() {
+    ofstream *stdout_stream = make_ofstream();
+    stdout_stream->file = stdout;
+    return stdout_stream;
 }
 
-ofstream *
-ofstream_stderr()
-{
-  ofstream *stderr_stream = make_ofstream();
-  stderr_stream->file = stderr;
-  return stderr_stream;
+ofstream * ofstream_stderr() {
+    ofstream *stderr_stream = make_ofstream();
+    stderr_stream->file = stderr;
+    return stderr_stream;
 }
 
-ofstream *
-ofstream_fromfile( const char *name )
-{
-  ofstream *file_stream = make_ofstream();
-  file_stream->file = fopen( name, "w" );
-  file_stream->fail = file_stream->file == 0;
-  return file_stream;
+ofstream * ofstream_fromfile( const char *name ) {
+    ofstream *file_stream = make_ofstream();
+    file_stream->file = fopen( name, "w" );
+    file_stream->fail = file_stream->file == 0;
+    return file_stream;
 }
 
-void
-ofstream_close( ofstream *os )
-{
-  if( os->file != stdout && os->file != stderr ) {
-    os->fail = fclose( os->file );
-  }
-  free( os );
+void ofstream_close( ofstream *os ) {
+    if( os->file != stdout && os->file != stderr ) {
+	os->fail = fclose( os->file );
+    }
+    free( os );
 }
 
-struct ifstream
-{
-  FILE *file;
-  int fail;
-  int eof;
+struct ifstream {
+    FILE *file;
+    int fail;
+    int eof;
 };
 
-ifstream *
-read( ifstream *is, char *data, streamsize_type size )
-{
-  if( !is->fail && !is->eof ) {
-    fread( data, size, 1, is->file );
-    is->fail = ferror( is->file );
-    is->eof = feof( is->file );
-  }
-  return is;
+ifstream * read( ifstream *is, char *data, streamsize_type size ) {
+    if( !is->fail && !is->eof ) {
+	fread( data, size, 1, is->file );
+	is->fail = ferror( is->file );
+	is->eof = feof( is->file );
+    }
+    return is;
 }
   
-ifstream *unread( ifstream *is, char c )
-{
-  if( !is->fail ) {
-    if( EOF == ungetc( c, is->file ) ) {
-      is->fail = 1;
+ifstream *unread( ifstream *is, char c ) {
+    if( !is->fail ) {
+	if( EOF == ungetc( c, is->file ) ) {
+	    is->fail = 1;
+	}
     }
-  }
-  return is;
+    return is;
 }
 
-int fail( ifstream *is )
-{
-  return is->fail;
+int fail( ifstream *is ) {
+    return is->fail;
 }
 
-int eof( ifstream *is )
-{
-  return is->eof;
+int eof( ifstream *is ) {
+    return is->eof;
 }
 
-static ifstream*
-make_ifstream()
-{
-  ifstream *new_stream = malloc( sizeof( ifstream ) );
-  new_stream->fail = 0;
-  new_stream->eof = 0;
-  return new_stream;
+static ifstream * make_ifstream() {
+    ifstream *new_stream = malloc( sizeof( ifstream ) );
+    new_stream->fail = 0;
+    new_stream->eof = 0;
+    return new_stream;
 }
 
-ifstream *ifstream_stdin()
-{
-  ifstream *stdin_stream = make_ifstream();
-  stdin_stream->file = stdin;
-  return stdin_stream;
+ifstream * ifstream_stdin() {
+    ifstream *stdin_stream = make_ifstream();
+    stdin_stream->file = stdin;
+    return stdin_stream;
 }
 
-ifstream *
-ifstream_fromfile( const char *name )
-{
-  ifstream *file_stream = make_ifstream();
-  file_stream->file = fopen( name, "r" );
-  file_stream->fail = file_stream->file == 0;
-  return file_stream;
+ifstream * ifstream_fromfile( const char *name ) {
+    ifstream *file_stream = make_ifstream();
+    file_stream->file = fopen( name, "r" );
+    file_stream->fail = file_stream->file == 0;
+    return file_stream;
 }
-
Index: translator/examples/fstream.h
===================================================================
--- translator/examples/fstream.h	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/fstream.h	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -6,5 +6,5 @@
 typedef struct ofstream ofstream;
 
-/* implement context ostream */
+// implement context ostream
 ofstream *write( ofstream *, const char *, streamsize_type );
 int fail( ofstream * );
@@ -17,5 +17,5 @@
 typedef struct ifstream ifstream;
 
-/* implement context istream */
+// implement context istream
 ifstream *read( ifstream *, char *, streamsize_type );
 ifstream *unread( ifstream *, char );
@@ -26,3 +26,3 @@
 ifstream *ifstream_fromfile( const char *name );
 
-#endif /* #ifndef FSTREAM_H */
+#endif // FSTREAM_H
Index: translator/examples/fstream_test.c
===================================================================
--- translator/examples/fstream_test.c	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/fstream_test.c	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -5,13 +5,10 @@
 #include "fstream.h"
 
-int
-main()
-{
-  ofstream *sout = ofstream_stdout();
-  ifstream *sin = ifstream_stdin();
-  int nombre;
-  sout << "Appuyez un nombre, s'il vous plâit:\n";
-  sin >> &nombre;
-  sout << "Vous avez appuyé: " << nombre << "\n";
-  return 0;
+int main() {
+    ofstream *sout = ofstream_stdout();
+    ifstream *sin = ifstream_stdin();
+    int nombre;
+    sout << "Appuyez un nombre, s'il vous plâit:\n";
+    sin >> &nombre;
+    sout << "Vous avez appuyé: " << nombre << "\n";
 }
Index: translator/examples/fwrite.c
===================================================================
--- translator/examples/fwrite.c	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/fwrite.c	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -2,10 +2,9 @@
 // "cfa fwrite.i"
 
+extern "C" {
 #include <stdio.h>
+}
 
-int
-main()
-{
-  fwrite( "test\n", 5, 1, stdout );
-  return 0;
+int main() {
+    fwrite( "test\n", 5, 1, stdout );
 }
Index: translator/examples/hello.c
===================================================================
--- translator/examples/hello.c	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/hello.c	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -3,14 +3,13 @@
 // "cfa hello.i fstream.i iostream.o"
 
-extern "C" {
-int printf( const char*, ... );
-}
-
 #include "fstream.h"
 
 int main() {
-  ofstream *sout = ofstream_stdout();
-  write( sout, "test\n", 5 );
-  sout << "Bonjour au monde!\n";
-  return 0;
+    ofstream *sout = ofstream_stdout();
+    ifstream *sin = ifstream_stdin();
+    sout << "Bonjour au monde!\n";
+    sout << 3 << " " << 3.5 << " " << 'a' << " " << "abc" << "\n";
+    int i, j, k;
+    sin >> &i >> &j >> &k;
+    sout << "i:" << i << " j:" << j << " k:" << k << "\n";
 }
Index: translator/examples/index.h
===================================================================
--- translator/examples/index.h	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/index.h	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -1,6 +1,5 @@
-context index( type T )
-{
-  T ?+?( T, T );
-  T ?-?( T, T );
-  const T 0, 1;
+context index( type T ) {
+    T ?+?( T, T );
+    T ?-?( T, T );
+    const T 0, 1;
 };
Index: translator/examples/iostream.c
===================================================================
--- translator/examples/iostream.c	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/iostream.c	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -6,62 +6,60 @@
 
 #include "iostream.h"
-#undef __cplusplus
 extern "C" {
-#include <string.h>
-#include <ctype.h>
 #include <stdio.h>
+//#include <string.h>
+//#include <ctype.h>
+typedef long unsigned int size_t;
+size_t strlen(const char *s);
 }
 
 forall( dtype ostype | ostream( ostype ) )
-ostype *
-?<<?( ostype *os, char c )
-{
-  return write( os, &c, 1 );
+ostype * ?<<?( ostype *os, char c ) {
+    return write( os, &c, 1 );
 }
 
 forall( dtype ostype | ostream( ostype ) )
-ostype *
-?<<?( ostype *os, int i )
-{
-  char buffer[20];      // larger than the largest integer
-  sprintf( buffer, "%d", i );
-  return write( os, buffer, strlen( buffer ) );
+ostype * ?<<?( ostype *os, int i ) {
+    char buffer[20];      // larger than the largest integer
+    sprintf( buffer, "%d", i );
+    return write( os, buffer, strlen( buffer ) );
 }
 
 forall( dtype ostype | ostream( ostype ) )
-ostype *
-?<<?( ostype *os, const char *cp )
-{
-  return write( os, cp, strlen( cp ) );
+ostype * ?<<?( ostype *os, double d ) {
+    char buffer[32];      // larger than the largest double
+    sprintf( buffer, "%g", d );
+    return write( os, buffer, strlen( buffer ) );
+}
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?<<?( ostype *os, const char *cp ) {
+    return write( os, cp, strlen( cp ) );
 }
 
 forall( dtype istype | istream( istype ) )
-istype *
-?>>?( istype *is, char *cp )
-{
-  return read( is, cp, 1 );
+istype * ?>>?( istype *is, char *cp ) {
+    return read( is, cp, 1 );
 }
 
 forall( dtype istype | istream( istype ) )
-istype *
-?>>?( istype *is, int *ip )
-{
-  char cur;
+istype * ?>>?( istype *is, int *ip ) {
+    char cur;
   
-  // skip some whitespace
-  do {
-    is >> &cur;
-    if( fail( is ) || eof( is ) ) return is;
-  } while( !( cur >= '0' && cur <= '9' ) );
+    // skip some whitespace
+    do {
+	is >> &cur;
+	if( fail( is ) || eof( is ) ) return is;
+    } while( !( cur >= '0' && cur <= '9' ) );
   
-  // accumulate digits
-  *ip = 0;
-  while( cur >= '0' && cur <= '9' ) {
-    *ip = *ip * 10 + ( cur - '0' );
-    is >> &cur;
-    if( fail( is ) || eof( is ) ) return is;
-  }
+    // accumulate digits
+    *ip = 0;
+    while( cur >= '0' && cur <= '9' ) {
+	*ip = *ip * 10 + ( cur - '0' );
+	is >> &cur;
+	if( fail( is ) || eof( is ) ) return is;
+    }
   
-  unread( is, cur );
-  return is;
+    unread( is, cur );
+    return is;
 }
Index: translator/examples/iostream.h
===================================================================
--- translator/examples/iostream.h	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/iostream.h	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -4,13 +4,11 @@
 typedef unsigned long streamsize_type;
 
-context ostream( dtype ostype )
-{
-  ostype *write( ostype *, const char *, streamsize_type );
-  int fail( ostype * );
+context ostream( dtype ostype ) {
+    ostype *write( ostype *, const char *, streamsize_type );
+    int fail( ostype * );
 };
 
-context writeable( type T )
-{
-  forall( dtype ostype | ostream( ostype ) ) ostype * ?<<?( ostype *, T );
+context writeable( type T ) {
+    forall( dtype ostype | ostream( ostype ) ) ostype * ?<<?( ostype *, T );
 };
 
@@ -18,28 +16,25 @@
 
 forall( dtype ostype | ostream( ostype ) ) ostype * ?<<?( ostype *, char );
-
 forall( dtype ostype | ostream( ostype ) ) ostype * ?<<?( ostype *, int );
-
+forall( dtype ostype | ostream( ostype ) ) ostype * ?<<?( ostype *, double );
 forall( dtype ostype | ostream( ostype ) ) ostype * ?<<?( ostype *, const char * );
 
 
-context istream( dtype istype )
-{
-  istype *read( istype *, char *, streamsize_type );
-  istype *unread( istype *, char );
-  int fail( istype * );
-  int eof( istype * );
+context istream( dtype istype ) {
+    istype *read( istype *, char *, streamsize_type );
+    istype *unread( istype *, char );
+    int fail( istype * );
+    int eof( istype * );
 };
 
-context readable( type T )
-{
-  forall( dtype istype | istream( istype ) ) istype * ?<<?( istype *, T );
+context readable( type T ) {
+    forall( dtype istype | istream( istype ) ) istype * ?<<?( istype *, T );
 };
 
 forall( dtype istype | istream( istype ) )
-istype * ?>>?( istype *, char* );
+istype * ?>>?( istype *, char * );
 
 forall( dtype istype | istream( istype ) )
-istype * ?>>?( istype *, int* );
+istype * ?>>?( istype *, int * );
 
-#endif /* #ifndef IOSTREAM_H */
+#endif // IOSTREAM_H
Index: translator/examples/iterator.c
===================================================================
--- translator/examples/iterator.c	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/iterator.c	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -18,11 +18,20 @@
         type iterator_type | iterator( iterator_type, elt_type ),
         dtype os_type | ostream( os_type ) )
-void
-write_all( iterator_type begin, iterator_type end, os_type *os )
-{
-  iterator_type i;
-  for( i = begin; i != end; ++i ) {
-    os << *i << ' ';
-  }
+void write_all( iterator_type begin, iterator_type end, os_type *os ) {
+    iterator_type i;
+    for ( i = begin; i != end; ++i ) {
+	os << *i << ' ';
+    }
 }
 
+forall( type elt_type | writeable( elt_type ),
+	type iterator_type | iterator( iterator_type, elt_type ),
+	dtype os_type | ostream( os_type ) )
+void write_reverse( iterator_type begin, iterator_type end, os_type *os ) {
+    iterator_type i; /* = end; do not work */
+    i = end;
+    do {
+	--i;
+	os << *i << ' ';
+    } while ( i != begin );
+}
Index: translator/examples/iterator.h
===================================================================
--- translator/examples/iterator.h	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/iterator.h	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -4,18 +4,23 @@
 #include "iostream.h"
 
-context iterator( type iterator_type, type elt_type )
-{
-  iterator_type ?++( iterator_type* );
-  iterator_type ++?( iterator_type* );
-  int ?==?( iterator_type, iterator_type );
-  int ?!=?( iterator_type, iterator_type );
-  lvalue elt_type *?( iterator_type );
+// An iterator can be used to traverse a data structure.
+context iterator( type iterator_type, type elt_type ) {
+    // point to the next element
+//    iterator_type ?++( iterator_type * );
+    iterator_type ++?( iterator_type * );
+    iterator_type --?( iterator_type * );
+
+    // can be tested for equality with other iterators
+    int ?==?( iterator_type, iterator_type );
+    int ?!=?( iterator_type, iterator_type );
+
+    // dereference to get the pointed-at element
+    lvalue elt_type *?( iterator_type );
 };
 
-context iterator_for( type iterator_type, type collection_type, type elt_type | iterator( iterator_type, elt_type ) )
-{
-///   [ iterator_type begin, iterator_type end ] get_iterators( collection_type );
-  iterator_type get_begin( collection_type );
-  iterator_type get_end( collection_type );
+context iterator_for( type iterator_type, type collection_type, type elt_type | iterator( iterator_type, elt_type ) ) {
+//    [ iterator_type begin, iterator_type end ] get_iterators( collection_type );
+    iterator_type begin( collection_type );
+    iterator_type end( collection_type );
 };
 
@@ -23,4 +28,5 @@
 void for_each( iterator_type begin, iterator_type end, void (*func)( elt_type ) );
 
+// writes the range [begin, end) to the given stream
 forall( type elt_type | writeable( elt_type ),
         type iterator_type | iterator( iterator_type, elt_type ),
@@ -28,3 +34,8 @@
 void write_all( iterator_type begin, iterator_type end, os_type *os );
 
-#endif /* #ifndef ITERATOR_H */
+forall( type elt_type | writeable( elt_type ),
+	type iterator_type | iterator( iterator_type, elt_type ),
+	dtype os_type | ostream( os_type ) )
+void write_reverse( iterator_type begin, iterator_type end, os_type *os );
+
+#endif // ITERATOR_H
Index: translator/examples/vector_int.c
===================================================================
--- translator/examples/vector_int.c	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/vector_int.c	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -2,6 +2,4 @@
 
 #include "vector_int.h"
-
-#undef __cplusplus
 extern "C" {
 #include <stdlib.h>
@@ -11,57 +9,44 @@
 #define DEFAULT_CAPACITY 20
 
-vector_int
-vector_int_allocate()
-{
-  return vector_int_allocate( DEFAULT_CAPACITY );
+vector_int vector_int_allocate() {
+    return vector_int_allocate( DEFAULT_CAPACITY );
 }
 
-vector_int
-vector_int_allocate( int reserve )
-{
-  vector_int new_vector;
-  new_vector.last = -1;
-  new_vector.capacity = reserve;
-  new_vector.data = malloc( sizeof( int ) * reserve );
-  return new_vector;
+vector_int vector_int_allocate( int reserve ) {
+    vector_int new_vector;
+    new_vector.last = -1;
+    new_vector.capacity = reserve;
+    new_vector.data = malloc( sizeof( int ) * reserve );
+    return new_vector;
 }
 
-void
-vector_int_deallocate( vector_int vec )
-{
-  free( vec.data );
+void vector_int_deallocate( vector_int vec ) {
+    free( vec.data );
 }
 
-void
-reserve( vector_int *vec, int reserve )
-{
-  if( reserve > vec->capacity ) {
-    vec->data = realloc( vec->data, sizeof( int ) * reserve );
-    vec->capacity = reserve;
-  }
+void reserve( vector_int *vec, int reserve ) {
+    if ( reserve > vec->capacity ) {
+	vec->data = realloc( vec->data, sizeof( int ) * reserve );
+	vec->capacity = reserve;
+    }
 }
 
-void append( vector_int *vec, int element )
-{
-  vec->last++;
-  if( vec->last == vec->capacity ) {
-    vec->capacity *= 2;
-    vec->data = realloc( vec->data, sizeof( int ) * vec->capacity );
-  }
-  vec->data[ vec->last ] = element;
+void append( vector_int *vec, int element ) {
+    vec->last++;
+    if ( vec->last == vec->capacity ) {
+	vec->capacity *= 2;
+	vec->data = realloc( vec->data, sizeof( int ) * vec->capacity );
+    }
+    vec->data[ vec->last ] = element;
 }
 
 // implement bounded_array
 
-lvalue int
-?[?]( vector_int vec, int index )
-{
-  return vec.data[ index ];
+lvalue int ?[?]( vector_int vec, int index ) {
+    return vec.data[ index ];
 }
 
-int
-array_last( vector_int vec )
-{
-  return vec.last;
+int last( vector_int vec ) {
+    return vec.last;
 }
 
Index: translator/examples/vector_int.h
===================================================================
--- translator/examples/vector_int.h	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/vector_int.h	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -2,23 +2,23 @@
 #define VECTOR_INT_H
 
-typedef struct vector_int
-{
-  int last;
-  int capacity;
-  int *data;
+// A flexible array, similar to a C++ vector, that holds integers and can be resized dynamically
+
+typedef struct vector_int {
+    int last;						// last used index
+    int capacity;					// last possible index before reallocation
+    int *data;						// array
 } vector_int;
 
+vector_int vector_int_allocate();			// allocate vector with default capacity
+vector_int vector_int_allocate( int reserve );		// allocate vector with specified capacity
+void vector_int_deallocate( vector_int );		// deallocate vector's storage
 
-vector_int vector_int_allocate();
-vector_int vector_int_allocate( int reserve );
-void vector_int_deallocate( vector_int );
-
-void reserve( vector_int *vec, int reserve );
-void append( vector_int *vec, int element );
+void reserve( vector_int *vec, int reserve );		// reserve more capacity
+void append( vector_int *vec, int element );		// add element to end of vector, resizing as necessary
 
 // implement bounded_array
 
-lvalue int ?[?]( vector_int vec, int index );
-int array_last( vector_int vec );
+lvalue int ?[?]( vector_int vec, int index );		// access to arbitrary element (does not resize)
+int last( vector_int vec );				// return last element
 
-#endif /* #ifndef VECTOR_INT_H */
+#endif // VECTOR_INT_H
Index: translator/examples/vector_test.c
===================================================================
--- translator/examples/vector_test.c	(revision 9388566396fdfc2d7d20385848e97baebf95e0b1)
+++ translator/examples/vector_test.c	(revision 134b86a0507148247f6d9b3cb3c99e475d9ae954)
@@ -7,28 +7,33 @@
 #include "vector_int.h"
 #include "array.h"
+#include "iterator.h"
 
-extern "C" {
-int printf( const char *, ... );
+int main() {
+    ofstream *sout = ofstream_stdout();
+    ifstream *sin = ifstream_stdin();
+    vector_int vec = vector_int_allocate();
+
+    // read in numbers until EOF or error
+    int num;
+
+    for ( ;; ) {
+	sin >> &num;
+      if ( fail( sin ) || eof( sin ) ) break;
+	append( &vec, num );
+    }
+
+    // write out the numbers
+
+    sout << "Array elements:\n";
+//    write_all( begin( vec ), end( vec ), sout );
+    sout << "\n";
+    write_reverse( begin( vec ), end( vec ), sout );
+    sout << "\n";
+
+    for ( int index = 0; index <= last( vec ); index += 1 ) {
+	sout << vec[ index ] << " ";
+    }
+    sout << "\n";
 }
 
-int
-main()
-{
-  ofstream *sout = ofstream_stdout();
-  ifstream *sin = ifstream_stdin();
-  vector_int vec = vector_int_allocate();
-  int nombre;
-  for(;;) {
-    sin >> &nombre;
-    if( fail( sin ) || eof( sin ) ) break;
-    append( &vec, nombre );
-  }
-  sout << "Array elements: ";
-  write_all( get_begin( vec ), get_end( vec ), sout );
-///   int index;
-///   for( index = 0; index <= array_last( vec ); ++index ) {
-///     sout << vec[ index ] << " ";
-///   }
-  sout << "\n";
-  return 0;
-}
+// ../bin/cfa vector_test.c fstream.o iostream.o vector_int.o iterator.o array.o
