Re: Does Flex support file nesting (C/C++ like include files)?

Kevin Handy <kth@srv.net>
13 Aug 2000 18:58:57 -0400

          From comp.compilers

Related articles
Does Flex support file nesting (C/C++ like include files)? lerhlerh@yahoo.com (2000-08-10)
Re: Does Flex support file nesting (C/C++ like include files)? kth@srv.net (Kevin Handy) (2000-08-13)
Re: Does Flex support file nesting (C/C++ like include files)? rkrayhawk@aol.com (2000-08-21)
| List of all articles for this month |

From: Kevin Handy <kth@srv.net>
Newsgroups: comp.compilers
Date: 13 Aug 2000 18:58:57 -0400
Organization: Software Solutions, Inc
References: 00-08-048
Keywords: lex

lerhlerh@yahoo.com wrote:
>
> I am trying to do a parsar, using bison and flex, to read a file of the
> following format:
>
> statement1
> statement2
> #include "file1"
....
> If I move all the include statements to the end of the input file, Flex
> does work perfectly. So File chaining works as expected.
>
> What have I done wrong?
>
> Could anyone confirm Flex does support file nesting?
>
> Your help is much appreciated! Many thanks!!
>
> Peter.
> [Yes, flex does support file nesting. If you're not getting the EOF
> correctly, you're probably smashing the buffer or pointers to it somehow.
> -John]


I've used include files in flex, and they work fine. If you want to
see the source to what I've done, go to http://www.srv.net/~kth and
get the btran.tgz file (Vax/Basic to C++ conversion program) I believe
I got most of the code out of the flex documentation for this.


It's includes are of the form '%include' instead of '#include', but
the same idea applies.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.