Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!axion!uzi-9mm.fulcrum.bt.co.uk!simonp From: simonp@fulcrum.bt.co.uk (Simon Parsons) Newsgroups: comp.lang.c Subject: Re: Question about Lex Message-ID: Date: 3 Jun 91 09:15:58 GMT References: <1991May29.081912.16808@fel.tno.nl> <1159@mwtech.UUCP> Sender: news@fulcrum.bt.co.uk (News with an UZI) Organization: Fulcrum Communications Ltd., Birmingham, England Lines: 19 In-Reply-To: martin@mwtech.UUCP's message of 31 May 91 10: 32:37 GMT In article <1159@mwtech.UUCP> martin@mwtech.UUCP (Martin Weitzel) writes: > If you have a 'plain vanilla' lex (as delivered with many UNIXes), there > might be an easy - yet undocumented - way: The standard input/unput-macros > support a variable 'yylino' which is incremented with every line read. But if you want it to be 'portable' between lex and flex, you CAN define a rule "\n" { LineNo++; } and do it yourself. Simon -- "Hey girl, as I've always said, I prefer your lips red, Not what the good lord made, but what he intended." Simon Parsons, Fulcrum Communications Ltd.- simonp@fulcrum.bt.co.uk