Ibrahim F Haddad wrote:

> > The fastest way to read textual data is to write your own scanner
> > using lex/flex, and to ensure that it doesn't need to back-up (see the
> > flex info file for what backing-up is and how to avoid it).
> 
> I've used flex. Now I am parsing the file and recognizing tokens.
> My structure is defined in "decl.h". I have a directory called parser 
> in which there are the *.l *.y and the corresponding makefile and 
> another directory that contains the original software with its 
> makefile.
> 
> I need to get rid of the makefile that was writting for the parser, 
> integrate its operations within the makefile of the original software 
> and make it generate one binary. Any suggestions on how-to? (cause
> now I am generating 2 binaries and not yet using the decl.h file for
> structure operations).

        YACC    = bison -y
        LEX     = flex

        ...

        tokeniser.c:    tokeniser.l
                $(LEX) $(LFLAGS) -o$@ $<
        
        parser.c:       parser.y
                $(YACC) $(YFLAGS) -o $@ $<

Then just add parser.o and tokeniser.o to the dependencies and link
command for the executable.

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to