Question about Lex

Simon Parsons simonp at fulcrum.bt.co.uk
Mon Jun 3 19:15:58 AEST 1991


In article <1159 at mwtech.UUCP> martin at 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 at fulcrum.bt.co.uk



More information about the Comp.lang.c mailing list