Category : Pascal Source Code
Archive   : LEX_YACC.ZIP
Filename : STRIP.L

 
Output of file : STRIP.L contained in archive : LEX_YACC.ZIP


{ 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 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.