MODULE line_counter; DECLARE count : INTEGER; TOKEN eol { S'EOL' }; MACRO find_eol TRIGGER { eol }; count = count + 1; END MACRO /* find_eol */; PROCEDURE count_the_lines MAIN; START SCAN INPUT FILE 'file.in' OUTPUT FILE 'nl:'; WRITE count, ' lines'; END PROCEDURE /* count_the_lines */; END MODULE /* line_counter */;