Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpda!hpcuhb!najmi From: najmi@hpcuhb.HP.COM (Farrukh Najmi) Newsgroups: comp.lang.c Subject: Re: LEX Question Message-ID: <9580001@hpcuhb.HP.COM> Date: 13 Feb 89 22:55:48 GMT References: <32240@auc.UUCP> Organization: Hewlett Packard, Cupertino Lines: 16 Its not clear to me what it is you are trying to do. Lex produces a function in lex.yy.c called yylex(). This function as a default reads from standard input. However one can make it read from a file (using file pointer) by declaring the file pointer variable and then assigning it to yyin. The yyin assignment must be before after the %% and before any regular definitions. %{ extern FILE *input_fileptr; %} %% yyin = input_fileptr; /* regular definitions go here. */