source: tests/generator/.expect/fmtLines.txt @ df2e00f

Last change on this file since df2e00f was 3ac5fd8, checked in by Peter A. Buhr <pabuhr@…>, 9 days ago

first attempt changing end-of-file to an exception

  • Property mode set to 100644
File size: 2.4 KB
Line 
1////   Cfo  rall   Ver  sion 
2 1.0  .0 C  opyr  ight   (C) 
3 201  7 Un  iver  sity   of   
4Wate  rloo  ////   The   con 
5tent  s of   thi  s fi  le a 
6re c  over  ed u  nder   the 
7 lic  ence   agr  eeme  nt i 
8n th  e//   file   "LI  CENC 
9E" d  istr  ibut  ed w  ith   
10Cfor  all.  ////   fmt  Line 
11s.cf  a --   for  mat   char 
12acte  rs i  nto   bloc  ks o 
13f 4   and   grou  ps o  f 5   
14bloc  ks p  er l  ine/  ///   
15Auth  or                 : T 
16hier  ry D  elis  le//   Cre 
17ated   On           :   Thu   
18Mar    5 1  6:09  :08   2020 
19// L  ast   Modi  fied   By   
20: Pe  ter   A. B  uhr/  / La 
21st M  odif  ied   On :   Sat 
22 Aug   17   14:2  1:28   202 
234//   Upda  te C  ount       
24 : 5  //#i  nclu  de <  fstr 
25eam.  hfa>  gene  rato  r Fo 
26rmat   {        c  har   ch;                                     
27                                                //   use  d fo  r co 
28mmun  icat  ion   int   g, b 
29;                                                                                         // g  loba 
30l be  caus  e us  ed i  n de 
31stru  ctor  };vo  id m  ain( 
32 For  mat   & fm  t )   with 
33( fm  t )   {   fo  r ()   {             
34                                                                        //   for   as m 
35any   char  acte  rs              for   
36( g   = 0;   g <   5;   g += 
37 1 )   {                                        /  / gr  oups 
38 of   5 bl  ocks                        f  or ( 
39 b =   0;   b <   4; b   +=   
401 )   {                         //   bloc  ks o 
41f 4   char  acte  rs                            fo 
42r ()   {                                                                //   for 
43 new  line   cha  ract  ers       
44                                  susp  end;                                if 
45 ( c  h !=   '\n  ' )   brea 
46k;                              //   ign  ore   newl 
47ine                             }   //   for                            s 
48out   | ch  ;                                                           //   
49prin  t ch  arac  ter                   }   
50// f  or                        sou  t |   "  " 
51;                                                               //   prin  t bl 
52ock   sepa  rato  r             }   //   
53for             sou  t |   nl;                                   
54                                        //   prin  t gr  oup   
55sepa  rato  r   }   // f  or}   
56// m  ainv  oid   ?{}(   For 
57mat   & fm  t )   {     re  sume 
58( fm  t );                                                                              // 
59 pri  me (  star  t) c  orou 
60tine  }voi  d ^?  {}(   Form 
61at &   fmt   ) w  ith(   fmt 
62 ) {    if   ( g   != 0   ||   
63b !=   0 )   sou  t |   nl;} 
64void   for  mat(   For  mat   
65& fm  t )   {   re  sume  ( fm 
66t );  } //   for  mati  nt m 
67ain(  ) {         Form  at f  mt;         
68sout   | n  lOff  ;                                                       
69                        /  / tu  rn o  ff a  uto   
70newl  ine         try   {               f  or ( 
71) {                                                                             //   read 
72 unt  il e  nd o  f fi  le               
73        sin   | f  mt.c  h;                                               
74                //   rea  d on  e ch  arac 
75ter                     fo  rmat  ( fm  t ); 
76                                                                  // p  ush   char 
77acte  r fo  r fo  rmat  ting 
78                }   // f  or    }   cat  ch(   
79end_  of_f  ile   * )   {       }   
80// t  ry}   // m  ain
Note: See TracBrowser for help on using the repository browser.