MacMindy 2.2.0r2 
Author Message
 MacMindy 2.2.0r2

Just thought I'd share a "gotcha" - the PowerMacMindy complier seems to just
ignore files which have DOS line breaks. If you're using BBEdit you can use
the options in the save-as dialog to save them with Macintosh line breaks
(or use some other specific utility).

(If you're reading this - thanks for the great work Rob)

Regards
Gareth Baker
CCLRC, Daresbury Laboratory



Tue, 30 Oct 2001 03:00:00 GMT  
 MacMindy 2.2.0r2

Quote:

> Just thought I'd share a "gotcha" - the PowerMacMindy complier seems to just
> ignore files which have DOS line breaks. If you're using BBEdit you can use
> the options in the save-as dialog to save them with Macintosh line breaks
> (or use some other specific utility).

Thanks, I'll add a pre-flight check for this that will flag an error if
no Mac line endings are found.

It's just a thought, but does anyone know if it's possible to fudge a
Lex/Yacc parser so it will accept multiple line endings, DOS/UN*X/Mac ?
That would be allow a more helpful solution.

- Rob.
__________________________________________________________________
                           __            __    _      __        

http://www.lostwax.com/  / /__/ _ \(_-</ __/  | |/ |/ / - `/\ \ /
                        /____/\___/___/\__/   |__/|__/\_,_//_\_\



Tue, 30 Oct 2001 03:00:00 GMT  
 MacMindy 2.2.0r2

Quote:

> It's just a thought, but does anyone know if it's possible to fudge a
> Lex/Yacc parser so it will accept multiple line endings, DOS/UN*X/Mac ?
> That would be allow a more helpful solution.

Sure -- just list all the possibilities for the end-of-line token.

e.g.

----------------- ttt.lex -----------------
%{
  int lines = 0;
%}
%%
\n|\r|\r\n   ++lines;
.
%%

#include <stdio.h>

main(int argc, char **argv )
{
  ++argv, --argc;  /* skip over program name */
  if ( argc > 0 )
    yyin = fopen( argv[0], "r" );
  else
    yyin = stdin;

  yylex();

  printf("Number of lines: %d\n", lines);

Quote:
}

----------------------------------------------

this^Mis^Ma^Mtest^Mof^Mline^Mcounting^M



Number of lines: 7

I just tried this and it correctly counted the number of lines in test
Mac, DOS and Unix files. It'll even cope with wierd mixes, and anyone who
does that is asking for whatever they get.

-- Bruce



Wed, 31 Oct 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. NetScape V4.0R2 - Messages

2. where to get the MacMindy plug-in

3. MacMindy

4. MacMindy for CodeWarrior 10?

5. MacMindy & CW9

6. MacMindy for CFM-68K

7. MacMindy 1.4 for CodeWarrior

8. MacMindy 1.4d4 Problem

9. MacMindy for SPM

10. MacMindy-68K Available

 

 
Powered by phpBB® Forum Software