Index: translator/examples/forall.c
===================================================================
--- translator/examples/forall.c	(revision d11f789d2e3cf56664deffef54dd03bfa1011c41)
+++ 	(revision )
@@ -1,46 +1,0 @@
-// "./cfa forall.c"
-
-typedef forall ( type T ) int (*f)( int );
-
-forall( type T )
-    void swap( T left, T right ) {
-	T temp = left;
-	left = right;
-	right = temp;
-    }
-
-context sumable( type T ) {
-    const T 0;
-    T ?+?(T, T);
-    T ?++(T*);
-    [T] ?+=?(T*,T);
-};
-
-forall( type T | sumable( T ) )
-    T sum( int n, T a[] ) {
-	T total = 0;
-	int i;
-	for ( i = 0; i < n; i += 1 )
-	    total = total + a[i];
-	return total;
-    }
-
-forall( type T | { T ?+?(T, T); T ?++(T*); [T] ?+=?(T*,T); } )
-    T twice( T t ) {
-	return t + t;
-    }
-
-forall( type T | { const T 0; int ?!=?(T, T); int ?<?(T, T); } )
-    T min( T t1, T t2 ) {
-	return t1 < t2 ? t1 : t2;
-    }
-
-int main() {
-    int x = 1, y = 2, a[10];
-    float f;
-
-    swap( x, y );
-    twice( x );
-    f = min( 4.0, 3.0 );
-    sum( 10, a );
-}
Index: translator/examples/forward.c
===================================================================
--- translator/examples/forward.c	(revision d11f789d2e3cf56664deffef54dd03bfa1011c41)
+++ translator/examples/forward.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -1,4 +1,2 @@
-// "./cfa-cpp -nc forward.c"
-
 forall(type T) lvalue T *?( T* );
 int ?=?( int*, int );
@@ -10,2 +8,6 @@
     *x;
 }
+
+// Local Variables: //
+// compile-command: "../../bin/cfa forward.c" //
+// End: //
Index: translator/examples/fstream.c
===================================================================
--- translator/examples/fstream.c	(revision d11f789d2e3cf56664deffef54dd03bfa1011c41)
+++ translator/examples/fstream.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -1,5 +1,2 @@
-// "cfa -E fstream.c > fstream_out.c"
-// "cfa -c -o fstream.o fstream.c"
-
 #include "fstream.h"
 
@@ -14,6 +11,6 @@
 };
 
-ofstream * write( ofstream *os, const char *data, streamsize_type size ) {
-    if( !os->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 );
@@ -26,5 +23,5 @@
 }
 
-static ofstream * make_ofstream() {
+static ofstream *make_ofstream() {
     ofstream *new_stream = malloc( sizeof( ofstream ) );
     new_stream->fail = 0;
@@ -32,5 +29,5 @@
 }
 
-ofstream * ofstream_stdout() {
+ofstream *ofstream_stdout() {
     ofstream *stdout_stream = make_ofstream();
     stdout_stream->file = stdout;
@@ -38,5 +35,5 @@
 }
 
-ofstream * ofstream_stderr() {
+ofstream *ofstream_stderr() {
     ofstream *stderr_stream = make_ofstream();
     stderr_stream->file = stderr;
@@ -44,5 +41,5 @@
 }
 
-ofstream * ofstream_fromfile( const char *name ) {
+ofstream *ofstream_fromfile( const char *name ) {
     ofstream *file_stream = make_ofstream();
     file_stream->file = fopen( name, "w" );
@@ -52,5 +49,5 @@
 
 void ofstream_close( ofstream *os ) {
-    if( os->file != stdout && os->file != stderr ) {
+    if ( os->file != stdout && os->file != stderr ) {
 	os->fail = fclose( os->file );
     }
@@ -64,6 +61,6 @@
 };
 
-ifstream * read( ifstream *is, char *data, streamsize_type size ) {
-    if( !is->fail && !is->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 );
@@ -74,6 +71,6 @@
   
 ifstream *unread( ifstream *is, char c ) {
-    if( !is->fail ) {
-	if( EOF == ungetc( c, is->file ) ) {
+    if ( ! is->fail ) {
+	if ( ! EOF == ungetc( c, is->file ) ) {
 	    is->fail = 1;
 	}
@@ -90,5 +87,5 @@
 }
 
-static ifstream * make_ifstream() {
+static ifstream *make_ifstream() {
     ifstream *new_stream = malloc( sizeof( ifstream ) );
     new_stream->fail = 0;
@@ -97,5 +94,5 @@
 }
 
-ifstream * ifstream_stdin() {
+ifstream *ifstream_stdin() {
     ifstream *stdin_stream = make_ifstream();
     stdin_stream->file = stdin;
@@ -103,5 +100,5 @@
 }
 
-ifstream * ifstream_fromfile( const char *name ) {
+ifstream *ifstream_fromfile( const char *name ) {
     ifstream *file_stream = make_ifstream();
     file_stream->file = fopen( name, "r" );
Index: translator/examples/fstream.h
===================================================================
--- translator/examples/fstream.h	(revision d11f789d2e3cf56664deffef54dd03bfa1011c41)
+++ translator/examples/fstream.h	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -1,4 +1,4 @@
-#ifndef FSTREAM_H
-#define FSTREAM_H
+#ifndef __FSTREAM_H__
+#define __FSTREAM_H__
 
 #include "iostream.h"
@@ -26,3 +26,3 @@
 ifstream *ifstream_fromfile( const char *name );
 
-#endif // FSTREAM_H
+#endif // __FSTREAM_H__
Index: translator/examples/fstream_test.c
===================================================================
--- translator/examples/fstream_test.c	(revision d11f789d2e3cf56664deffef54dd03bfa1011c41)
+++ translator/examples/fstream_test.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -1,6 +1,2 @@
-// "cfa -c -o fstream_test.o fstream_test.c"
-// "cfa -CFA fstream_test.c > fstream_test_out.c"
-// "gcc31 -c fstream_test_out.c"
-
 #include "fstream.h"
 
Index: translator/examples/fwrite.c
===================================================================
--- translator/examples/fwrite.c	(revision d11f789d2e3cf56664deffef54dd03bfa1011c41)
+++ translator/examples/fwrite.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -1,7 +1,4 @@
-// "cfa -CFA fwrite.c > fwrite.i"
-// "cfa fwrite.i"
-
 extern "C" {
-#include <stdio.h>
+    #include <stdio.h>
 }
 
Index: translator/examples/identity.c
===================================================================
--- translator/examples/identity.c	(revision d11f789d2e3cf56664deffef54dd03bfa1011c41)
+++ translator/examples/identity.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -1,5 +1,3 @@
-extern "C" {
-    int printf( const char *fmt, ... );
-}
+#include "fstream.h"
 
 forall( type T )
@@ -9,5 +7,14 @@
 
 int main() {
-    printf( "result of identity of 5 is %d\n", identity( 5 ) );
-    return 0;
+    ofstream *sout = ofstream_stdout();
+    char c = 'a';
+    sout << c << ' ' << identity( c ) << '\n';
+    int i = 5;
+    sout << i << ' ' << identity( i ) << '\n';
+    double d = 3.2;
+    sout << d << ' ' << identity( d ) << '\n';
 }
+
+// Local Variables: //
+// compile-command: "../../bin/cfa identity.c fstream.o iostream.o" //
+// End: //
Index: translator/examples/includes.c
===================================================================
--- translator/examples/includes.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
+++ translator/examples/includes.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -0,0 +1,33 @@
+#if 1
+#include <alloca.h>
+#include <assert.h>
+#include <complex.h>
+//#include <ctype.h>        // FAILS -- includes locale.h
+#include <errno.h>
+#include <fenv.h>
+#include <float.h>
+#include <inttypes.h>
+#include <iso646.h>
+#include <limits.h>
+//#include <locale.h>       // FAILS -- "no reasonable alternatives for applying ... Name: ?+? ..."
+#include <math.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdio.h>
+//#include <string.h>       // FAILS -- includes locale.h
+#include <tgmath.h>
+//#include <time.h>         // FAILS -- includes locale.h
+#include <unistd.h>
+//#include <wchar.h>        // FAILS -- includes locale.h
+//#include <wctype.h>       // FAILS -- includes locale.h
+#else
+#include <curses.h>
+#endif
+
+// Local Variables: //
+// compile-command: "../../bin/cfa includes.c" //
+// End: //
Index: translator/examples/loopbreak.c
===================================================================
--- translator/examples/loopbreak.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
+++ translator/examples/loopbreak.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -0,0 +1,39 @@
+int main() {
+  L1: {
+	double d = 12.123_333_E27;
+      L2: switch ( 3_333_333 ) {	// underscores in constant
+	  case 1,2,3:			// 4~8, 4...8 not working
+	  L3: for ( ;; ) {
+	      L4: for ( ;; ) {
+		    break L1;		// labelled break
+		    break L2;
+		    break L3;
+		    break L4;
+#if 1
+		    continue L1;	// labelled continue
+		    continue L2;
+		    continue L3;
+		    continue L4;
+#endif
+		} // for
+	    } // for
+	    break;
+	  default:
+	    break L1;
+	} // switch
+	3;
+	int i, j;
+	choose ( 7 ) {
+	  case 1,2,3:
+	    i = 3;
+	    fallthru;
+	  case 4,5,6:
+	    j = 3;
+	  default: ;
+	} // choose
+    } // block
+} // main
+
+// Local Variables: //
+// compile-command: "../../bin/cfa loopbreak.c" //
+// End: //
Index: translator/examples/min.c
===================================================================
--- translator/examples/min.c	(revision d11f789d2e3cf56664deffef54dd03bfa1011c41)
+++ translator/examples/min.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -1,11 +1,7 @@
-// "./cfa min.c"
-// "./cfa -CFA min.c > min_out.c"
-// "gcc32 -g min_out.c LibCfa/libcfa.a"
-
 extern "C" {
     int printf( const char *, ... );
 }
 
-forall( type T | { const T 0; int ?!=?(T, T); int ?<?(T, T); } )
+forall( type T | { int ?<?( T, T ); } )
 T min( T t1, T t2 ) {
     return t1 < t2 ? t1 : t2;
@@ -13,6 +9,19 @@
 
 int main() {
+//    char c;
+//    c = min( 'a', 'z' );
+//    printf( "minimum %d\n", c );
+    int i;
+    i = min( 4, 3 );
+    printf( "minimum %d\n", min( 4, 3 ) );
     float f;
-    f = min( 4.0, 3.0 );
-    printf( "result is %f\n", f );
+    f = min( 4.0, 3.1 );
+    printf( "minimum %g\n", f );
+    double d;
+    d = min( 4.0, 3.2 );
+    printf( "minimum %g\n", d );
 }
+
+// Local Variables: //
+// compile-command: "../../bin/cfa min.c" //
+// End: //
Index: translator/examples/quad.c
===================================================================
--- translator/examples/quad.c	(revision d11f789d2e3cf56664deffef54dd03bfa1011c41)
+++ translator/examples/quad.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -1,4 +1,4 @@
 extern "C" {
-#include <stdio.h>
+    #include <stdio.h>
 }
 
@@ -17,2 +17,6 @@
     printf( "result of quad of %d is %d\n", N, quad( N ) );
 }
+
+// Local Variables: //
+// compile-command: "../../bin/cfa quad.c" //
+// End: //
Index: translator/examples/sum.c
===================================================================
--- translator/examples/sum.c	(revision d11f789d2e3cf56664deffef54dd03bfa1011c41)
+++ translator/examples/sum.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -1,6 +1,2 @@
-// "./cfa -g sum.c"
-// "./cfa -CFA sum.c > sum_out.c"
-// "gcc32 -g sum_out.c LibCfa/libcfa.a"
-
 extern "C" {
     int printf( const char *, ... );
@@ -9,23 +5,38 @@
 context sumable( type T ) {
     const T 0;
-    T ?+?(T, T);
-    T ?++(T*);
-    [T] ?+=?(T*,T);
+    T ?+?( T, T );
+    T ?++( T * );
+    [T] ?+=?( T *, T );
 };
 
 forall( type T | sumable( T ) )
 T sum( int n, T a[] ) {
-    T total = 0;
-    int i;
-    for ( i = 0; i < n; i += 1 )
-	total = total + a[i];
+    T total = 0;			// instantiate T, select 0
+    for ( int i = 0; i < n; i += 1 )
+	total = total + a[i];		// select +
     return total;
 }
 
 int main() {
-    int a[10];
-    for ( int i = 0; i < 10; ++i ) {
-	a[i] = i;
+    const int size = 10, low = 0, High = 10;
+    int si, ai[10]; // size
+    int i;
+    for ( i = low; i < High; i += 1 ) {
+	si += i;
+	ai[i] = i;
     }
-    printf( "the sum is %d\n", sum( 10, a ) );
+    printf( "sum from %d to %d is %d, check %d\n",
+	    low, High, sum( size, ai ), si );
+    double sd, ad[10]; // size
+    for ( i = low; i < High; i += 1 ) {
+	double d = i / (double)size;
+	sd += d;
+	ad[i] = d;
+    }
+    printf( "sum from %g to %g is %g, check %g\n",
+	    low / (double)size, High / (double)size, sum( size, ad ), sd );
 }
+
+// Local Variables: //
+// compile-command: "../../bin/cfa sum.c" //
+// End: //
Index: translator/examples/swap.c
===================================================================
--- translator/examples/swap.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
+++ translator/examples/swap.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -0,0 +1,21 @@
+extern "C" {
+    int printf( const char *, ... );
+}
+
+forall( type T )
+void swap( T left, T right ) {
+    T temp = left;
+    left = right;
+    right = temp;
+}
+
+int main() {
+    int x = 1, y = 2;
+    printf( "%d %d", x, y );
+    swap( x, y );
+    printf( "%d %d", x, y );
+}
+
+// Local Variables: //
+// compile-command: "../../bin/cfa swap.c" //
+// End: //
Index: translator/examples/twice.c
===================================================================
--- translator/examples/twice.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
+++ translator/examples/twice.c	(revision 42dcae7185b7830fd591cd47f895c0a362a6e77d)
@@ -0,0 +1,15 @@
+#include "fstream.h"
+
+forall( type T | { T ?+?( T, T ); T ?++( T * ); [T] ?+=?( T *, T ); } )
+T twice( const T t ) {
+    return t + t;
+}
+
+int main() {
+    ofstream *sout = ofstream_stdout();
+    sout << twice( 1 ) << ' ' << twice( 3.2 ) << '\n';
+}
+
+// Local Variables: //
+// compile-command: "../../bin/cfa twice.c fstream.o iostream.o" //
+// End: //
