head     1.8;
branch   ;
access   ;
symbols  ;
locks    ; strict;
comment  @@;


1.8
date     92.07.07.18.54.12;  author reti;  state Exp;
branches ;
next     1.7;

1.7
date     92.07.06.18.47.41;  author reti;  state Exp;
branches ;
next     1.6;

1.6
date     92.07.04.18.12.53;  author reti;  state Exp;
branches ;
next     1.5;

1.5
date     92.07.01.19.25.07;  author reti;  state Exp;
branches ;
next     1.4;

1.4
date     92.06.30.18.27.29;  author reti;  state Exp;
branches ;
next     1.3;

1.3
date     92.06.29.20.43.40;  author reti;  state Exp;
branches ;
next     1.2;

1.2
date     92.06.28.17.43.28;  author reti;  state Exp;
branches ;
next     1.1;

1.1
date     92.06.28.17.25.17;  author reti;  state Exp;
branches ;
next     ;


desc
@interactive test program
pattern: space and a number between 1 and 11
previous pattern:.
comment line:/comment
quit program:q
EACH coordinate should and with a space.
@


1.8
log
@aint..trunc, concat had to be updated
due to the change in Point.cc
@
text
@// Emacs -*- C++ -*-

static char rcsid[] = "$Id: t.cc,v 1.7 92/07/06 18:47:41 reti Exp Locker: reti $";

// Usage: Pattern:q  quit program
//                 # (space;pattern number)
//                ;  (previous pattern)
//                /comment line, will appear in the output

const char REP=  ';'; // in the input, stands for the previous
                      // point,coord or pattern
//'Pattern:',etc. prompts iff (argc==1)

// Coordinates must end with a space.
// Points have the form  <coord1 coord2 ... coordk >
// where k<6 (currently). Notice the space between the last coord and >

// In pattern 7 'p3= p1 op p2', while in pattern 11 'p1= p1 op p2'.
// In pattern 7 'p1 (op)= p2' , while in pattern  5 'p1 (op)= p1'.
// (Pattern 1,op !=25,26) are like pattern 7 but p2's are left unitialized.

// In pattern 10 'c1 (op)= c2', while in pattern  6 'c1 (op)= c1'.
// (Pattern 2,op !=25,26) are like pattern 10 but c2's are left uninitialized.

// Notation:
// + implemented
// w implemented with compiler warning
// - not implemented by group decision
//   not implemented
//
// ops        ------------------ patterns-----------------------
//             1  2  3   4   5  6  7   8   9   10  11  15
//            po co poi coi op oc pop poc cop coc pop  pi
//
//  0 =        +  +          +  +  +   +       +        d
//  1 <        +  +                +   +   +   +        e
//  2 <=       +  +                +   +   +   +        r
//  3 >        +  +                +   +   +   +        a
//  4 >=       +  +                +   +   +   +        n
//  5 ==       +  +                +   +   +   +        g
//  6 !=       +  +                +   +   +   +        e
//  7 +        +  +                +   +   +   +   +    m
//  8 +=       +  +          +  +  +   +       +        e
//  9 -        +  +          +  +  +   +   +   +   +    n
// 10 -=       +  +          +  +  +   +       +        t
// 11 *        +  +                +   +   +   +   +
// 12 *=       +  +          +  +  +   +       +
// 13 /        +  +                +   +   +   +   +
// 14 /=       +  +          +  +  +   +       +
// 15 %        +  w                +   +   +   w   +
// 16 %=       +  +          +  +  +   +       +
// 17 &           w                -   -   -   w
// 18 &=       +  +          +  +  +   +       +
// 19 |           w                -   -   -   w
// 20 |=       +  +          +  +  +   +       +
// 21 ^           w                -   -   -   w
// 22 ^=       +  +          +  +  +   +       +
// 23     
// 24 ~                      +  -      
// 25 ++       +  +          +  +  
// 26 --       +  +          +  + 
// 27 >>             -   -         
// 28 <<             -   -          
// 29 >>=            +   +          
// 30 <<=            +   +   
// 31 concat   +  +                +   +   +   +   +
// 32 toREAL                 +  +  
// 33 toINTE                 +  +
// 34 aint                   +  
// 35 anint                  +  
// 36 ceil                   +  
// 37 floor                  +  
// 38 rint                   +  
// 39 irint                  +  
// 40 nint                   +  
// 41 trunc                  +  
// 42 Pointcmp +                   + 
//
//             1  2  3   4   5  6  7   8   9  10   11   15
//-----------------------------------------------------------
 

#include	<iostream.h>
#include        <Coord.h>
#include        <Point.h>

//just for printing.Usage: p_arg (); actual op; p_res();    

    void   p_arg (char *op, Coord c);
    void   p_arg (char *op, Point p);
    void   p_arg (Coord c, char *op);
    void   p_arg (Point p, char *op);
    void   p_arg (Coord c, char *op, int shift);
    void   p_arg (Point p, char *op, int shift);

    void   p_arg (Coord c1, char *op, Coord c2);
    void   p_arg (Point p1, char *op, Point p2);
    void   p_arg (Point p , char *op, Coord c );
    void   p_arg (Coord c , char *op, Point p );

    void   p_arg (Coord c1, char *op1, Coord c2, char *op2, Coord c3);
    void   p_arg (int n_ix, int *ix, Point p);
    
    void   p_res (Coord res);
    void   p_res (Point res);
    void   p_res (char h);  // print two-way comparison: True or False
    void   p_res2(char h);  // print three-way comparison: < == or >
    
    void   p_err (int i,int l);
    
    void   in1 (Point& p);
    void   in1 (Coord& c);

    void   cut (void);     
inline  void in (Point& p) { in1 (p); cut(); }
inline  void in (Coord& c) { in1 (c); cut(); }
//------------------------------------------------------
int
main (int argc)
{

#define prompt(s)  { if (argc>1)  cerr<< s << ":";} 
    
char *ops[]={"= ","< ","<=","> ",">=","==","!=","+ ","+=","- ",                              "-=","* ","*=","/ ","/=","% ","%=","& ","&=","| ",                              "|=","^ ","^=","- ","~ ","++","--",">>","<<",">>=","<<=","concat ",          "toREAL","toINTEGER","aint","anint","ceil","floor","rint","irint",              "nint","trunc", "Pointcmp" };


Point p,p1,p2,pu; // pu will not be initialized
Coord c,c1,c2,cu; // cu will not be initialized
char h;      // holds the control char
int i_old=7; // holds the previous pattern
int i;       // holds the current  pattern
int i1;      // holds the shift for << or >>
int op;      // holds the chosen operator
int n_ix;    // dim of the projection (derangement) 
int ix[5];   // holds the chosen indices for derangement


IA::exit_on_throw= 0;
    
   for ( ; ; )
    {
    prompt("Pattern");
    cin.get(h);
    
    switch (h)
     {
     case '/':   //comment line
        	while (h!='\n')
 	         {
	           cin.get(h); cout <<h;
	         }
	      continue;
     case '\n': 
	      continue;
     case ' ':  cin>>i; i_old= i; 
	      break;
     case REP:  i= i_old;  // previous pattern
	      break;
     case 'q':            // quit program
	      return 0;
     default :  cut() ;   // throw away garbage
		p_err (0,__LINE__);
	      continue;
     }
    

    
    switch (i)
	{
	case 1 : prompt("point"); in(p1);
		 prompt("op");    cin >> op;
		 p_arg (p1,ops[op]);
		 switch (op)
		     {
		     case 25: p1++; p_res(p1); break;
                     case 26: p1--; p_res(p1); break;
			      
		     case 0:  p1= pu;   p_res (p1); break;
		     case 1:  p_res (p1< pu); break;
		     case 2:  p_res (p1<=pu); break;
		     case 3:  p_res (p1> pu); break;
		     case 4:  p_res (p1>=pu); break;
		     case 5:  p_res (p1==pu); break;
		     case 6:  p_res (p1!=pu); break;
		     case 7:  p= p1+pu; p_res (p);  break;
		     case 8:  p1 += pu; p_res (p1); break;
		     case 9:  p= p1-pu; p_res (p);  break;
		     case 10: p1 -= pu; p_res (p1); break;
		     case 11: p= p1*pu; p_res (p);  break;
		     case 12: p1 *= pu; p_res (p1); break;
		     case 13: p= p1/pu; p_res (p);  break;
		     case 14: p1 /= pu; p_res (p1); break;
		     case 15: p= p1%pu; p_res (p);  break;
		     case 16: p1 %= pu; p_res (p1); break;
//		     case 17: p= p1&pu; p_res (p);  break; //type 
		     case 18: p1 &= pu; p_res (p1); break;  
//		     case 19: p= p1|pu; p_res (p);  break; //conversion
		     case 20: p1 |= pu; p_res (p1); break;
//		     case 21: p= p1^pu; p_res (p);  break; //required
		     case 22: p1 ^= pu; p_res (p1); break;
		     case 31: p= (p1,pu); p_res (p ); break;
		     case 42: p_res2(Pointcmp(p1,pu)); break;
			      
		     default: p_err(1,__LINE__); break;
		     };
		 break;

        case 2:	 prompt("coord"); in( c1);
		 prompt("op");    cin >> op;
		 p_arg (c1,ops[op]);
		 switch (op)
		     {
		     case 25: c1++; p_res(c1); break;
                     case 26: c1--; p_res(c1); break;		       

		     case 0:  c1= cu;   p_res (c1); break;
       		     case 1:  p_res (c1< cu); break;
		     case 2:  p_res (c1<=cu); break;
		     case 3:  p_res (c1> cu); break;
		     case 4:  p_res (c1>=cu); break;
		     case 5:  p_res (c1==cu); break;
		     case 6:  p_res (c1!=cu); break;
		     case 7:  c= c1+cu; p_res (c);  break;
		     case 8:  c1 += cu; p_res (c1); break;
		     case 9:  c= c1-cu; p_res (c);  break;
		     case 10: c1 -= cu; p_res (c1); break;
		     case 11: c= c1*cu; p_res (c);  break;
		     case 12: c1 *= cu; p_res (c1); break;
		     case 13: c= c1/cu; p_res (c);  break;
		     case 14: c1 /= cu; p_res (c1); break;
		     case 15: c= c1%cu; p_res (c);  break;//warning:
		     case 16: c1 %= cu; p_res (c1); break;
		     case 17: c= c1&cu; p_res (c);  break;//ambiguous
		     case 18: c1 &= cu; p_res (c1); break;
		     case 19: c= c1|cu; p_res (c);  break;//type conversion
		     case 20: c1 |= cu; p_res (c1); break;
		     case 21: c= c1^cu; p_res (c);  break;//defaulting in int
		     case 22: c1 ^= cu; p_res (c1); break;
		     case 31: p= (c1,cu); p_res (p ); break;

		     default: p_err(2,__LINE__);break;

		     };
		 break;

        case 3 : prompt("point"); in(p1);
		 prompt("op");    cin >> op;
		 prompt("shift");   cin >> i1;
		 p_arg (p1,ops[op],i1);
		 switch (op)
		     {
//		     case 27: p= p1>>i1; p_res(p); break;//undefined 
//                   case 28: p= p1<<i1; p_res(p); break;//Point ops
		     case 29: p1>>= i1;  p_res(p1); break;
		     case 30: p1<<= i1;  p_res(p1); break;
		     default: p_err(3,__LINE__);   break;
		     };
		 break;

        case 4:	 prompt("coord"); in( c1);
		 prompt("op");    cin >> op;
		 prompt("shift");   cin>> i1;
		 p_arg (c1,ops[op],i1);
		 switch (op)
		     {
//  		     case 27: c= c1>>i1; p_res(c); break;
//		     case 28: c= c1<<i1; p_res(c); break;
		     case 29: c1>>= i1;  p_res(c1); break;
		     case 30: c1<<= i1;  p_res(c1); break;
	 	     default: p_err(4,__LINE__);   break;
		     };
		 break;

        case 5:  prompt("op"); cin >> op;
		 prompt("point"); in(p1);
		 p_arg (ops[op],p1);
               	 switch (op)
		     {
		     case  0: p1 = p1; p_res(p1); break;	 
                     case  8: p1+= p1; p_res(p1); break;
		     case 10: p1-= p1; p_res(p1); break;
                     case 12: p1*= p1; p_res(p1); break;
		     case 14: p1/= p1; p_res(p1); break;
                     case 16: p1%= p1; p_res(p1); break;
		     case 18: p1&= p1; p_res(p1); break;
                     case 20: p1|= p1; p_res(p1); break;
		     case 22: p1^= p1; p_res(p1); break;

		     case  9: p_res(-p1); break;
		     case 24: p_res(~p1); break;
		     case 25: ++p1; p_res(p1); break;
                     case 26: --p1; p_res(p1); break;

		     case 32: p= p1.toREAL ();  p_res(p); break;
		     case 33: p= p1.toINTEGER();p_res(p); break;
		     case 34: p= aint (p1); p_res(p); break;
		     case 35: p= anint(p1); p_res(p); break;
		     case 36: p= ceil (p1); p_res(p); break;
		     case 37: p= floor(p1); p_res(p); break;
		     case 38: p= rint (p1); p_res(p); break;
		     case 39: p= irint(p1); p_res(p); break;
		     case 40: p= nint (p1); p_res(p); break;
		     case 41: p= trunc(p1); p_res(p); break;
		     default: p_err(5,__LINE__); break;
		     };
		 break;

        case 6:  prompt("op");    cin >> op;
		 prompt("coord"); in( c1);
		 p_arg (ops[op],c1);
               	 switch (op)
		     {
		     case  0: c1 = c1; p_res(c1); break;	 
                     case  8: c1+= c1; p_res(c1); break;
		     case 10: c1-= c1; p_res(c1); break;
                     case 12: c1*= c1; p_res(c1); break;
		     case 14: c1/= c1; p_res(c1); break;
                     case 16: c1%= c1; p_res(c1); break;
		     case 18: c1&= c1; p_res(c1); break;
                     case 20: c1|= c1; p_res(c1); break;
		     case 22: c1^= c1; p_res(c1); break;

		     case  9: p_res(-c1); break;
//		     case 24: p_res(~c1); break;       //wrong type
		     case 25: ++c1; p_res(c1); break;
                     case 26: --c1; p_res(c1); break;
		     case 32: c= float(c1); p_res(c); break;
		     case 33: c= int(c1) ;  p_res(c); break;
		     default: p_err(6,__LINE__); break;
		     };
		 break;

        case 7:  prompt("point"); in(p1);
		 prompt("op");    cin >> op;
		 prompt("point"); in(p2);
		 p_arg (p1,ops[op],p2);
		 
		 switch (op)
		     {
		     case 0:  p1= p2;   p_res (p1); break;
		     case 1:  p_res (p1< p2); break;
		     case 2:  p_res (p1<=p2); break;
		     case 3:  p_res (p1> p2); break;
		     case 4:  p_res (p1>=p2); break;
		     case 5:  p_res (p1==p2); break;
		     case 6:  p_res (p1!=p2); break;
		     case 7:  p= p1+p2; p_res (p);  break;
		     case 8:  p1 += p2; p_res (p1); break;
		     case 9:  p= p1-p2; p_res (p);  break;
		     case 10: p1 -= p2; p_res (p1); break;
		     case 11: p= p1*p2; p_res (p);  break;
		     case 12: p1 *= p2; p_res (p1); break;
		     case 13: p= p1/p2; p_res (p);  break;
		     case 14: p1 /= p2; p_res (p1); break;
		     case 15: p= p1%p2; p_res (p);  break;
		     case 16: p1 %= p2; p_res (p1); break;
//		     case 17: p= p1&p2; p_res (p);  break; //type 
		     case 18: p1 &= p2; p_res (p1); break;  
//		     case 19: p= p1|p2; p_res (p);  break; //conversion
		     case 20: p1 |= p2; p_res (p1); break;
//		     case 21: p= p1^p2; p_res (p);  break; //required
		     case 22: p1 ^= p2; p_res (p1); break;
		     case 31: p= concat(p1,p2); p_res (p ); break;
		     case 42: p_res2(Pointcmp(p1,p2)); break;	      
		     default: p_err (7,__LINE__); break;
		     };
		 break;
		 
	    case 8:
		 prompt("point"); in(p1);
		 prompt("op");    cin >> op;
		 prompt("coord"); in(c2);
       		 p_arg (p1,ops[op],c2);
		 switch (op)
		     {
		     case 0:  p1= c2;   p_res (p1); break;
		     case 1:  p_res (p1< c2); break;
		     case 2:  p_res (p1<=c2); break;
		     case 3:  p_res (p1> c2); break;
		     case 4:  p_res (p1>=c2); break;
		     case 5:  p_res (p1==c2); break;
		     case 6:  p_res (p1!=c2); break;
		     case 7:  p= p1+c2; p_res (p);  break;
		     case 8:  p1 += c2; p_res (p1); break;
		     case 9:  p= p1-c2; p_res (p);  break;
		     case 10: p1 -= c2; p_res (p1); break;
		     case 11: p= p1*c2; p_res (p);  break;
		     case 12: p1 *= c2; p_res (p1); break;
		     case 13: p= p1/c2; p_res (p);  break;
		     case 14: p1 /= c2; p_res (p1); break;
		     case 15: p= p1%c2; p_res (p);  break;
		     case 16: p1 %= c2; p_res (p1); break;
//		     case 17: p= p1&c2; p_res (p);  break; //type 
		     case 18: p1 &= c2; p_res (p1); break;
//		     case 19: p= p1|c2; p_res (p);  break; //conversion
		     case 20: p1 |= c2; p_res (p1); break;
//		     case 21: p= p1^c2; p_res (p);  break; //required
		     case 22: p1 ^= c2; p_res (p1); break;
		     case 31: p= concat(p1,c2); p_res (p ); break;
		     default: p_err(8,__LINE__); break;
		     };
                 break;
		 
        case 9:  prompt("coord"); in(c1);
		 prompt("op");    cin >> op;
		 prompt("point"); in(p2);
		 p_arg (c1,ops[op],p2);
		 switch (op)
		     {
//		     case 0:  c1= p2;   p_res (c1); break; //conversion required
       		     case 1:  p_res (c1< p2); break;
		     case 2:  p_res (c1<=p2); break;
		     case 3:  p_res (c1> p2); break;
		     case 4:  p_res (c1>=p2); break;
		     case 5:  p_res (c1==p2); break;
		     case 6:  p_res (c1!=p2); break;
		     case 7:  p= c1+p2; p_res (p);  break;
//		     case 8:  c1 += p2; p_res (c1); break; //bad argument 0
		     case 9:  p= c1-p2; p_res (p);  break;
		     case 11: p= c1*p2; p_res (p);  break;
		     case 13: p= c1/p2; p_res (p);  break;
		     case 15: p= c1%p2; p_res (p);  break;
//		     case 17: p= c1&p2; p_res (p);  break; //type 
//		     case 19: p= c1|p2; p_res (p);  break; //conversion
//		     case 21: p= c1^p2; p_res (p);  break; //required
		     case 31: p= concat(c1,p2); p_res (p ); break;
		     default: p_err(9,__LINE__); break;
		     };
		 break;
		 
	case 10: prompt("coord");in(c1);
		 prompt("op");   cin >> op;
		 prompt("coord");in(c2);
		 p_arg (c1,ops[op],c2);
		 switch (op)
		     {
		     case 0:  c1= c2;   p_res (c1); break;
       		     case 1:  p_res (c1< c2); break;
		     case 2:  p_res (c1<=c2); break;
		     case 3:  p_res (c1> c2); break;
		     case 4:  p_res (c1>=c2); break;
		     case 5:  p_res (c1==c2); break;
		     case 6:  p_res (c1!=c2); break;
		     case 7:  c= c1+c2; p_res (c);  break;
		     case 8:  c1 += c2; p_res (c1); break;
		     case 9:  c= c1-c2; p_res (c);  break;
		     case 10: c1 -= c2; p_res (c1); break;
		     case 11: c= c1*c2; p_res (c);  break;
		     case 12: c1 *= c2; p_res (c1); break;
		     case 13: c= c1/c2; p_res (c);  break;
		     case 14: c1 /= c2; p_res (c1); break;
		     case 15: c= c1%c2; p_res (c);  break;//warning:
		     case 16: c1 %= c2; p_res (c1); break;
		     case 17: c= c1&c2; p_res (c);  break;//ambiguous
		     case 18: c1 &= c2; p_res (c1); break;
		     case 19: c= c1|c2; p_res (c);  break;//type conversion
		     case 20: c1 |= c2; p_res (c1); break;
		     case 21: c= c1^c2; p_res (c);  break;//defaulting in int
		     case 22: c1 ^= c2; p_res (c1); break;
		     case 31: p= concat(c1,c2); p_res (p ); break;
		     default: p_err (10,__LINE__); break;
		     };
		 break;
	     

            case 11:
		    prompt("point");in(p1);
		    prompt("op");    cin>> op;
		    prompt("point");in(p2);
	            p_arg (p1,ops[op],p2);
		    switch (op)
			{
			case 7:   p1= p1+p2; p_res (p1); break;
			case 9:   p1= p1-p2; p_res (p1); break;
			case 11:  p1= p1*p2; p_res (p1); break;
			case 13:  p1= p1/p2; p_res (p1); break;
			case 15:  p1= p1%p2; p_res (p1); break;
//			case 17:  p1= p1&p2; p_res (p1); break;//type 
//			case 19:  p1= p1|p2; p_res (p1); break;//conversion
//			case 21:  p1= p1^p2; p_res (p1); break;//required
			case 31:  p1= (p1,p2); p_res (p1); break;
			default:  p_err (11,__LINE__);   break;	 
			};
		    break;
		 
	     case 15:
		     prompt("point");      in(p1);
		     prompt("number of indices"); cin>>n_ix;
		     if (n_ix>4) { p_err(15,__LINE__); break; }
		     for (int j=0; j<n_ix; j++)
		      {
			prompt("index"); cin>>ix[j];
		      }
		     p_arg (n_ix,ix, p1);
                     switch (n_ix)
			 {
			 case 1: p= p1(ix[0]);
				break;   
			 case 2: p= p1(ix[0],ix[1]);
				break;
			 case 3: p= p1(ix[0],ix[1],ix[2]);
				break;
			 case 4: p= p1(ix[0],ix[1],ix[2],ix[3]);
				break;
			 default: //compiler: too many arguments
				break;
			 };
		      p_res(p);
		    break;
		 
	     default: p_err(19,__LINE__); cut();
		    break;
             };	//end of case 
  };//end of for
//-------------------------------------------
// cout << "\nEnd of tests\n"; 
} //end of main


//-----------------------------------------
void  // print type and value
prt (Coord c)
{
    cout << "\t {type: " << c.type() << " } ";
//  c.type () != NONE ? cout << c  : cout << "???";
    cout << c;
}
//------------------------------------------       
void
p_arg (char *op, Coord c)
{
    cout << "\n\tOp " << op;
     prt  ( c) ;  
    cout << "\n";
}

void
p_arg (char *op, Point p)
{
    cout << "\n\tOp " << op << "\t"
	 << p
	 << "\n";
}

void
p_arg (Coord c, char *op)
{
    cout << "\n";
     prt  ( c);
    cout << "\tOp " << op
	 << "\n";
}

void
p_arg (Point p, char *op)
{
    cout << "\n\t"
	 << p
	 << "\tOp " << op
	 << "\n";
}


void
p_arg (Coord c, char *op, int shift)
{
    cout << "\n";
     prt  ( c);
    cout << "\tOp " << op <<shift
	 << "\n";
}

void
p_arg (Point p, char *op,int shift)
{
    cout << "\n\t"
         << p
         << "\tOp " << op <<shift
	 << "\n";
}

void
p_arg (int n_ix, int *ix, Point p)
{
    
    cout << "\n\t"
	 << p
	 << " at indices (";
    for ( ; n_ix>0; n_ix--,ix++ ) cout << *ix;
    cout << ")\n";
}

void
p_arg (Coord c1, char *op, Coord c2)
{
    cout << "\n";
     prt  ( c1);
    cout << "\tOp " << op;
     prt  ( c2);
    cout << "\n";
}

void
p_arg (Point p1, char *op, Point p2)
{
    cout << "\n\t"
	 << p1
	 << "\tOp " << op << "\t"
	 << p2
	 << "\n";
}
void
p_arg (Point p, char *op, Coord c)
{
    cout << "\n\t"
	 << p
	 << "\tOp " << op;
     prt  ( c);
    cout << "\n";
}

void
p_arg (Coord c, char *op, Point p)
{
    cout << "\n";
     prt  ( c);
    cout << "\tOp " << op << "\t"
	 << p
	 << "\n";
}

void
p_arg (Coord c1, char *op1, Coord c2, char *op2, Coord c3)
{
    cout << "\n";
     prt  ( c1);
    cout << "\tOp1 " << op1;
     prt  ( c2);
    cout << "\n\tOp2 " << op2;
     prt  ( c3);
    cout << "\n";
}
//----------------------------------------------
void
p_err (int i,int l)
{
 cout << "\tTest error " << i << ":";
 switch (i)
     {
     case 0:  cout << " put space after Pattern: ";
     case 19: cout << "\n1 line thrown away from the input stream";
	     break;

     case 1:  cout << "(point op??): not implemented op"; break;
     case 2:  cout << "(coord op??): not implemented op"; break;
     case 3:  cout << "(point op?? int): not implemented op"; break; 
     case 4:  cout << "(coord op?? int): not implemented op"; break;
     case 5:  cout << "(op?? point): not implemented op";  break;
     case 6:  cout << "(op?? coord): not implemented op";  break;
     case 7:  cout << "(point op?? point): not implemented op"; break;
     case 11: cout << "(point op?? point): not implemented op"; break;
     case 8:  cout << "(point op?? coord): not implemented op"; break;
     case 12: cout << "(point op?? coord): not implemented op"; break;
     case 9:  cout << "(coord op?? point): not implemented op"; break;
     case 13: cout << "(coord op?? point): not implemented op"; break;
     case 10: cout << "(coord op?? coord): not implemented op"; break;
     case 14: cout << "(coord op?? coord): not implemented op"; break;

     case 15: cout << "(point, int??,...): >4 derangement indices"; break;
     case 20: cout << "(point input):start with a '<'"
	           << "\n\tUsage: <n1 n2 ... nk> where 1<=k<=5.";break;
     case 21: cout << "(point input): finish with '>' (a warning).";break;
     case 22: cout << "(point input):sorry, only <=5 dim point is supported.";
	              break;
     default: cout << "(??): not implemented pattern"; break;	      
     };
 cout << "\n\t(message from file " << __FILE__ << ", line " << l <<")\n";
}

//----------------------------------------------

void
p_res (char h)
{
//    h==0 ? cout << "\t result: False\n"
//         : cout << "\t result: True\n";
    if (h==0) cout << "\t result: False\n";
    else      cout << "\t result: True\n";
}

void
p_res2(char h)   // to be used for Pointcmp
{
    cout << "\t result: ";
    switch (h)
	{
	case -1: cout << "< \n"; break;
	case  0: cout << "==\n"; break;
	case  1: cout << "> \n"; break;
	}
}

void
p_res (Coord res)
{
    cout << "\t result: ";
     prt  ( res);
    cout << "\n";
}

void
p_res (Point res)
{
    cout << "\t result: "
	 << res
	 << "\n";
}

//------------------------------------------

#include <stdlib.h>
#include <ctype.h>

void cut(void) { char hu; do {cin.get(hu);} while(hu!='\n'); } 

// later istream operator>> (istream& ip, Coord& c)

void
in1 (Coord& c) 
{
    register char h; char h1;
    const int B= 80; // buffer size
    const char S=' ';// reading stops here
    char buf [B],*p;
    int  sign;
    
    sign= 1;
    cin >> h1;              // eliminates initial space
    if (h1==REP) return;
    else         cin.putback(h1);
    
    cin.get (buf,B,S);//
    cin.get (h1); // throws away the stop sign
    
//    for(p=buf;(h= *p)!='\0';p++) cout << h; cout <<",";
    
    p= buf;
    if (*p=='-') { p++; sign= -1; } 
    if (*p=='0')
     {
	 h=*(++p);
	 if ('0'<=h && h<='7')  { c= (Coord) sign*strtol(  p,0, 8);return;}
	 else if(h=='x')        { c= (Coord) sign*strtol(++p,0,16);return;}
	 else if(h=='\0')       { c= (Coord) 0; return;}
     }
	 
    for(p= buf; (h= *p)!='\0'; p++)
     {
	if (h=='.'||h=='e')
	 { c= (Coord) strtod(buf,0); return;}
     };

    c= (Coord) strtol(buf,0,10);
}
 

// later istream operator>> (istream& ip, Point& p)

void
in1 (Point& p)
{
    char h; int si= 0; Coord c[5];

    cin >> h;
    switch (h)
       {
       case REP:  return; // take previous point
       case '<':  break;
       default :  p_err(20,__LINE__);return;
       }

    for ( ; ; si++)
     {
       cin  >> h;	 
       if (h=='>')   break;
       else          cin.putback (h);

       in1(c[si]);
 
       if (si==4)
	{
	  cin  >> h;  
          if (h!='>') p_err(21,__LINE__);
	  si++; break;
        }

     }

//    p.size =si;

    switch (si)
     {
     case 0:
	    break;
     case 1: p=  Point (c[0]);
            break;
     case 2: p=  Point (c[0],c[1]);
            break;
     case 3: p=  Point (c[0],c[1],c[2]);
            break;
     case 4: p=  Point (c[0],c[1],c[2],c[3]);
            break;
     case 5: p=  Point (c[0],c[1],c[2],c[3],c[4]);
            break;
     default: p_err(22,__LINE__);
//	      p= Point (c[0],c[1],c[2],c[3],c[4],0);//compiler:invalid func cast
            break;
     }
  return;
}


@


1.7
log
@t.cc is now capable of testing uninitialized operands
@
text
@d3 1
a3 1
static char rcsid[] = "$Id: t.cc,v 1.6 92/07/04 18:12:53 reti Exp Locker: reti $";
d66 3
a68 3
// 31 ,        +  +                +   +   +   +   +
// 32 toREAL                 +  
// 33 toINTE                 +  
d124 1
a124 1
char *ops[]={"= ","< ","<=","> ",">=","==","!=","+ ","+=","- ",                              "-=","* ","*=","/ ","/=","% ","%=","& ","&=","| ",                              "|=","^ ","^=","- ","~ ","++","--",">>","<<",">>=","<<=",", ",          "toREAL","toINTEGER","aint","anint","ceil","floor","rint","irint","nint",       "trunc", "Pointcmp" };
d296 8
a303 8
		     case 34: p= p1.aint (); p_res(p); break;
		     case 35: p= p1.anint(); p_res(p); break;
		     case 36: p= p1.ceil (); p_res(p); break;
		     case 37: p= p1.floor(); p_res(p); break;
		     case 38: p= p1.rint (); p_res(p); break;
		     case 39: p= p1.irint(); p_res(p); break;
		     case 40: p= p1.nint (); p_res(p); break;
		     case 41: p= p1.trunc(); p_res(p); break;
d326 3
a328 1
                     case 26: --c1; p_res(c1); break;		       
d363 1
a363 1
		     case 31: p= (p1,p2); p_res (p ); break;
d399 1
a399 1
		     case 31: p= (p1,c2); p_res (p ); break;
d426 1
a426 1
		     case 31: p= (c1,p2); p_res (p ); break;
d460 1
a460 1
		     case 31: p= (c1,c2); p_res (p ); break;
@


1.6
log
@c= c1 %&|^ c2 are now permitted
(compiler will give a warning about ambiguous type conversion)
@
text
@d3 1
a3 1
static char rcsid[] = "$Id: t.cc,v 1.5 92/07/01 19:25:07 reti Exp Locker: reti $";
d18 3
a20 2
// In pattern 7 'p3= p1 op p2', while in pattern 11 'p1= p1 op p2'
// In pattern 7 'p1 (op)= p2' , while in pattern  5 'p1 (op)= p1'
d22 9
d35 43
a77 43
//  0 =        -     -       +  +  +   +   -   +        d
//  1 <        -     -       -     +   +   +   +        e
//  2 <=       -     -       -     +   +   +   +        r
//  3 >        -     -       -     +   +   +   +        a
//  4 >=       -     -       -     +   +   +   +        n
//  5 ==       -     -       -     +   +   +   +        g
//  6 !=       -     -       -     +   +   +   +        e
//  7 +        -     -       -     +   +   +   +   +    m
//  8 +=       -     -       +  +  +   +   -   +        e
//  9 -        -     -       -     +   +   +   +   +    n
// 10 -=       -     -       +  +  +   +   -   +        t
// 11 *        -     -       -     +   +   +   +   +
// 12 *=       -     -       +  +  +   +   -   +
// 13 /        -     -       -     +   +   +   +   +
// 14 /=       -     -       +  +  +   +   -   +
// 15 %        -     -       -     +   +   +   -   +
// 16 %=       -     -       +  +  +   +   -   +
// 17 &        -     -       -     -   +   -   -
// 18 &=       -     -       +  +  +   +   -   +
// 19 |        -     -       -     -   +   -   -
// 20 |=       -     -       +  +  +   +   -   +
// 21 ^        -     -       -     -   +   -   -
// 22 ^=       -     -       +  +  +   +   -   +
// 23 -        -     -       +  +  -   
// 24 ~        -     -       +  -  -   
// 25 ++       +  +  -       +  +  -
// 26 --       +  +  -       +  +  -
// 27 >>       -     -       -     -
// 28 <<       -     -       -     -
// 29 >>=      -     +   +   -     -
// 30 <<=      -     +   +   -     -
// 31 ,        -     -       -     +   +   +   +   +
// 32 toREAL   -     -       +  -  -
// 33 toINTE   -     -       +  -  -
// 34 aint     -     -       +  -  -
// 35 anint    -     -       +  -  -
// 36 ceil     -     -       +  -  -
// 37 floor    -     -       +  -  -
// 38 rint     -     -       +  -  -
// 39 irint    -     -       +  -  -
// 40 nint     -     -       +  -  -
// 41 trunc    -     -       +  -  -
// 42 Pointcmp -     -       -  -  +   -   -   -   -
d127 2
a128 2
Point p,p1,p2;
Coord c,c1,c2;
d176 28
a203 1
                     case 26: p1--; p_res(p1); break;		       
d215 26
d289 1
a289 1
		     case 23: p_res(-p1); break;
d323 1
a323 1
		     case 23: p_res(-c1); break;
a417 1
//		     case 10: c1 -= p2; p_res (c1); break; //bad ...
a418 1
//        	     case 12: c1 *= p2; p_res (c1); break; //bad ...
a419 1
//		     case 14: c1 /= p2; p_res (c1); break; //bad ...
d421 3
a423 7
//		     case 16: c1 %= p2; p_res (c1); break; //bad ...
//		     case 17: p= c1&p2; p_res (p);  break; //type conversion required
//		     case 18: c1 &= p2; p_res (c1); break; //bad ...
//		     case 19: p= c1|p2; p_res (p);  break; //type ...
//		     case 20: c1 |= p2; p_res (c1); break; //bad ...
//		     case 21: p= c1^p2; p_res (p);  break; //type ...
//		     case 22: c1 ^= p2; p_res (c1); break; //bad ...
d503 1
a503 1
			 default: // already screened above
d722 1
a722 1
void cut(void) { char hu; while(hu!='\n') cin.get(hu); } 
d814 1
@


1.5
log
@It works! 
It is in interactive mode if we
give a parameter (i.e. argc>1)
If t.in is very long then
t <t.in >& t.out
will die after a while, at the
same time t <t.in will run
succesfully.
@
text
@d3 1
a3 1
static char rcsid[] = "$Id: t.cc,v 1.4 92/06/30 18:27:29 reti Exp Locker: reti $";
d83 2
a84 2
    void   p_arg (Coord c, int shift);
    void   p_arg (Point p, int shift);
d186 1
a186 1
		 p_arg (p1,ops[op]);
d200 1
a200 1
		 p_arg (c1,ops[op]);
d394 1
a394 1
//		     case 15: c= c1%c2; p_res (c);  break;//warning:
d396 1
a396 1
//		     case 17: c= c1&c2; p_res (c);  break;//ambiguous
d398 1
a398 1
//		     case 19: c= c1|c2; p_res (c);  break;//type conversion
d400 1
a400 1
//		     case 21: c= c1^c2; p_res (c);  break;//defaulting in int
d423 1
a423 1
			case 31:  p1= p1,p2; p_res (p1); break;
d507 1
a507 1
p_arg (Coord c, int shift)
d511 1
a511 1
    cout << "\tOp " << shift
d516 1
a516 1
p_arg (Point p, int shift)
d520 1
a520 1
         << "\tOp " << shift
d671 1
a671 1
in1 (Coord& c)
@


1.4
log
@a lot of comments
';' to stand for previous pattern,coord or point
@
text
@d3 1
a3 1
static char rcsid[] = "$Id: t.cc,v 1.3 92/06/29 20:43:40 reti Exp Locker: reti $";
d12 1
a12 1
const int NO= 1;      // if (NO!=0) no 'Pattern:' prompt
d77 1
d79 6
a84 2
int main()
{
d86 4
a89 9
//usage: all inclusive comparisons
    void        com(Coord c1,Coord c2);
//just for printing.Usage: p_arg (); actual op; p_res;    
    void        p_arg (char *op, Coord c);
    void        p_arg (char *op, Point p);
    void        p_arg (Coord c, char *op);
    void        p_arg (Point p, char *op);
    void        p_arg (Coord c, int shift);
    void        p_arg (Point p, int shift);
d91 2
a92 7
    void        p_arg (Coord c1, char *op, Coord c2);
    void        p_arg (Point p1, char *op, Point p2);
    void        p_arg (Point p , char *op, Coord c );
    void        p_arg (Coord c , char *op, Point p );

    void        p_arg (Coord c1, char *op1, Coord c2, char *op2, Coord c3);
    void        p_arg (int n_ix, int *ix, Point p);
d94 4
a97 4
    void        p_res (Coord res);
    void        p_res (Point res);
    void        p_res (char h);  // print two-way comparison: True or False
    void        p_res2(char h);  // print three-way comparison: < == or >
d99 1
a99 2
    void        p_err (int i,int l);
    inline void prompt(char *s){ if (NO) return; cerr<< s ":";};
d101 6
a106 3
    void        in    (Point& p);
    void        in    (Coord& c);
    inline void garbage(void) {char h; while(h!='\n') cin.get(h); };
d108 3
d112 1
a112 1

d115 2
a116 1
    
d126 2
a127 1
    
d149 1
a149 1
     case 'q':        // quit program
d151 1
a151 1
     default :  garbage(); // throw away garbage
d453 1
a453 1
	     default: p_err(19,__LINE__); garbage();
a661 9
/*
void
com (Coord c1, Coord c2)
{
    cout << "\n";
     prt  ( c1);
    cout << "\t cf.";
     prt  ( c2);
    cout << "\t result: ";
a662 14
    if ((c1.type() == NONE)|| (c2.type() == NONE))
	{
	    cout << " ? \n"; return;
	}
    
    if      (c1 >c2)  cout << " > ";
    else if (c1==c2)  cout << "== ";
    else if (c1 <c2)  cout << " < ";
    else              cout << "impossible to compare";

    cout << "\n";
}
*/
//--------------------------------------
d666 2
a667 1
    
d671 1
a671 1
in (Coord& c)
d681 1
a681 3
    if (h1==REP) { garbage();
		   return;
	         }
d712 1
a712 1
in (Point& p)
d719 1
a719 2
       case REP:  garbage ();
		return; // take previous point
d730 2
a731 2
       in (c[si]);

@


1.3
log
@new features in the interactive test program
projection (derangement): pattern 15
concatenation: op 31
Pointcmp: pattern 7, op 42
rounding functions: pattern 5, op 32..41
ops >>= and <<= : 29 and 30 resp.
@
text
@d3 1
a3 1
static char rcsid[] = "$Id: t.cc,v 1.2 92/06/28 17:43:28 reti Exp Locker: reti $";
d5 4
d10 63
d77 1
d101 2
a102 2
    void        p_res (char h);
    void        p_res2(char h);
d105 2
d109 1
d112 1
a112 6
//operators:
//    0 = ;1  < ; 2 <=; 3 > ; 4 >=; 5 ==; 6 !=; 7 + ; 8 +=; 9 - ;
//   10 -=;11 * ;12 *=;13 / ; 14/=;15 % ;16 %=;17 & ;18 &=;19 | ;
//   20 |=;21 ^ ;22 ^=;23 -(unary);24 ~ ;25 ++;26 --;27 >>;28<<;29>>=;
//   30 <<=;31 ,;32 toREAL;33 toINTEGER;34 aint;35 anint;36 ceil;37 floor;
//   38 rint; 39 irint; 40 nint; 41 trunc; 42 Pointcmp; 
a118 1
int no= 0;   // write 'Pattern:' iff (no==0)
d130 1
a130 2
    if (!no)  cerr << "\nPattern:";
    else      no= 0;
d137 1
a137 1
	         {
d141 1
a141 1
     case '\n': no= 1;
d145 1
a145 1
     case '.':  i= i_old;  // previous pattern
d149 1
a149 1
     default :  while (h!='\n') cin.get(h); // throw away garbage
d158 2
a159 2
	case 1 : cerr << "point:"; in(p1);
		 cerr << "op:";    cin >> op;
d169 2
a170 2
        case 2:	 cerr << "coord:"; in( c1);
		 cerr << "op:";    cin >> op;
d181 3
a183 3
        case 3 : cerr << "point:"; in(p1);
		 cerr << "op:";    cin >> op;
		 cerr << "int:";   cin >> i1;
d195 3
a197 3
        case 4:	 cerr << "coord:"; in( c1);
		 cerr << "op:";    cin >> op;
		 cerr << "int:";   cin>> i1;
d209 2
a210 2
        case 5:  cerr << "op:"; cin >> op;
		 cerr << "point:"; in(p1);
d224 2
d229 10
a238 10
//		     case 32: p= toREAL   (p1);p_res(p); break;
//		     case 33: p= toINTEGER(p1);p_res(p); break;
//		     case 34: p= aint (p1); p_res(p); break;
//		     case 35: p= anint(p1); p_res(p); break;
//		     case 36: p= ceil (p1); p_res(p); break;
//		     case 37: p= floor(p1); p_res(p); break;
//		     case 38: p= rint (p1); p_res(p); break;
//		     case 39: p= irint(p1); p_res(p); break;
//		     case 40: p= nint (p1); p_res(p); break;
//		     case 41: p= trunc(p1); p_res(p); break;
d243 2
a244 2
        case 6:  cerr << "op:";    cin >> op;
		 cerr << "coord:"; in( c1);
d258 2
d266 3
a268 3
        case 7:  cerr << "point:"; in(p1);
		 cerr << "op:";    cin >> op;
		 cerr << "point:"; in(p2);
d296 1
a296 1
		     case 31: p= p1,p2; p_res (p ); break;
d303 3
a305 3
		 cerr << "point:"; in(p1);
		 cerr << "op:";    cin >> op;
		 cerr << "coord:"; in(c2);
d332 1
a332 1
		     case 31: p= p1,c2; p_res (p ); break;
d337 3
a339 3
        case 9:  cerr << "coord:"; in(c1);
		 cerr << "op:";    cin >> op;
		 cerr << "point:"; in(p2);
d366 1
a366 1
		     case 31: p= c1,p2; p_res (p ); break;
d371 3
a373 3
	case 10: cerr << "coord:";in(c1);
		 cerr << "op:";   cin >> op;
		 cerr << "coord:";in(c2);
d400 1
a400 1
		     case 31: p= c1,c2; p_res (p ); break;
d407 3
a409 3
		    cerr << "point:";in(p1);
		    cerr <<"op:";    cin>> op;
		    cerr << "point:";in(p2);
d427 2
a428 2
		     cerr << "point:";      in(p1);
		     cerr << "number of indices:"; cin>>n_ix;
d432 1
a432 1
			  cerr<< "index["<<j<<"]:"; cin>>ix[j];
d451 1
a451 2
	     default: p_err(19,__LINE__);
		      while (h!='\n') cin.get(h);
d619 1
d687 1
d700 6
a705 1
    cin >> h1; cin.putback(h1); // eliminates initial space.
d739 7
a745 4
    if (h!='<')
     {
	  p_err(20,__LINE__);return;
     }
@


1.2
log
@EACH coordinate should end with a space
@
text
@d3 1
a3 1
static char rcsid[] = "$Id: t.cc,v 1.1 92/06/28 17:25:17 reti Exp Locker: reti $";
d22 1
d27 1
d29 2
a30 1

d34 2
d41 6
a46 7
//   << "Usage: p<point>  c coord  o operator \n"

//        0: previous pattern, -1:quit program
//   << "operator: 0 = ;1  < ; 2 <=; 3 > ; 4 >=; 5 ==; 6 !=; 7 + ; 8 +=; 9 - ;
//                10 -=;11 * ;12 *=;13 / ; 14/=;15 % ;16 %=;17 & ;18 &=;19 | ;
//                20 |=;21 ^ ;22 ^=;23 -(unary);24 ~ ;25 ++;26 --;27 >>; 28 <<;

d48 1
a48 1
char *ops[]={ "= ", "< ", "<=", "> ", ">=", "==", "!=", "+ ", "+=", "- ",                     "-=", "* ", "*=", "/ ", "/=", "% ", "%=", "& ", "&=", "| ",                     "|=", "^ ", "^=", "- ", "~ ", "++", "--", ">>", "<<" };
d52 8
a59 2
int i_old=7; int i1,i,op;    
char h;
d65 2
a66 1
    cerr << "\nPattern:";
d75 4
a78 2
                 }
     case '\n': continue;
d124 4
a127 2
//                   case 28: p= p2<<i1; p_res(p); break;//Point ops		       
		     default: p_err(3,__LINE__);            break;
d137 4
a140 2
//		     case 27: c= c1>>i1; p_res(c); break;
//                   case 28: c= c1<<i1; p_res(c); break;		       
d161 12
a172 1
                     case 26: --p1; p_res(p1); break;		       
a200 1
		 cout << "\n\tTesting c= a op b, a (op)= b or logical ops\n";
d223 1
a223 1
		     case 18: p1 &= p2; p_res (p1); break; //
d225 1
a225 1
		     case 20: p1 |= p2; p_res (p1); break; //
d227 3
a229 1
		     case 22: p1 ^= p2; p_res (p1); break; //
a237 1
                 cout << "\n\tTesting c= a op b, a (op)= b or logical ops\n";
d257 1
a257 1
		     case 16: p1 %= c2; p_res (p1); break; //
d259 1
a259 1
		     case 18: p1 &= c2; p_res (p1); break; //
d261 1
a261 1
		     case 20: p1 |= c2; p_res (p1); break; //
d263 2
a264 1
		     case 22: p1 ^= c2; p_res (p1); break; //
a271 1
		 cout << "\n\tTesting c= a op b, a (op)= b or logical ops\n";
d285 1
a285 1
//		     case 10: c1 -= p2; p_res (c1); break; //
d287 1
a287 1
//        	     case 12: c1 *= p2; p_res (c1); break; //
d289 1
a289 1
//		     case 14: c1 /= p2; p_res (c1); break; //
d291 1
a291 1
//		     case 16: c1 %= p2; p_res (c1); break; //bad argument 0
d293 6
a298 5
//		     case 18: c1 &= p2; p_res (c1); break; //bad
//		     case 19: p= c1|p2; p_res (p);  break; //type
//		     case 20: c1 |= p2; p_res (c1); break; //bad
//		     case 21: p= c1^p2; p_res (p);  break; //type
//		     case 22: c1 ^= p2; p_res (c1); break; //bad
a305 1
	         cout << "\n\tTesting c= a op b, a (op)= b or logical ops\n";
d324 1
a324 1
//		     case 15: c= c1%c2; p_res (c);  break;//warning:ambiguous
d326 1
a326 1
//		     case 17: c= c1&c2; p_res (c);  break;//warning: ambiguous
d332 1
a341 1
		    cout << "\tTesting a= a op b\n";
d350 2
a351 2
//			case 17:  p1= p1&p2; p_res (p1); break;//type conversion
//			case 19:  p1= p1|p2; p_res (p1); break;//
d353 1
d357 26
d456 11
d527 14
a540 16
     case 1:  cout << "(point op??): use ++ or --"; break;
     case 2:  cout << "(coord op??): use ++ or --"; break;
     case 3:  cout << "(point op?? int): use << or >>"; break; 
     case 4:  cout << "(coord op?? int): use << or >>"; break;
     case 5:  cout << "(op?? point): use =,+=,-=,*=,/=,%=,&=,|=,^=,++ or --";
	      break;
     case 6:  cout << "(op?? coord): use =,+=,-=,*=,/=,%=,&=,|=,^=,++ or --";
	      break;
     case 7:  cout << "(point op?? point):"; break;
     case 11: cout << "(point op?? point): use +,-,*,/,%,&,|,^"; break;
     case 8:  cout << "(point op?? coord):"; break;
     case 12: cout << "(point op?? coord): use +,-,*,/,%,&,|,^"; break;
     case 9:  cout << "(coord op?? point):"; break;
     case 13: cout << "(coord op?? point): use +,-,*,/,%,&,|,^"; break;
     case 10: cout << "(coord op?? coord):"; break;
     case 14: cout << "(coord op?? coord): use +,-,*,/,%,&,|,^"; break;
d542 1
d548 1
a548 1
     default: cout << "(??)"; break;	      
d564 12
d625 2
a626 2
    const int B= 80; //buffer size
    const char S=' ';// Stop reading here
d631 3
a633 4
    cin.get (buf,B,S);// puts space in buf[0] !!
    cin.get(h1);       // throw away ' '.

cout <<"("; for(p=buf;(h= *p)!='\0';p++) cout << h; cout <<","; cout <<")\n";
d635 2
d641 1
a641 1
	 h= *(++p);
d655 1
d673 1
a673 1
       if (h=='>')  {cin.get(h); break;} //throw away '\n'
d708 2
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
static char rcsid[] = "$Id: test5.cc,v 1.2 92/06/03 16:15:05 fischer Exp Locker: reti $";
@
