home *** CD-ROM | disk | FTP | other *** search
-
- { A sample Lex program that strips whitespace from stdin and writes result
- to stdout; when running the program you can use DOS I/O redirection, e.g.
- strip <input-file >output-file }
-
- uses LexLib;
-
- %%
-
- ^[ \t]*\n ; { ignore empty lines }
- [ \t]+$ ; { ignore trailing whitespace }
- [ \t]+ write(yyout, ' ');
- { replace remaining whitespace by single blank }
- %%
-
- begin
- if yylex=0 then { done }
- end.