Re: Parsing circular includes...

"Bob Sheff" <bsheff2@jyahoo.com>
14 Sep 2002 20:09:39 -0400

          From comp.compilers

Related articles
Parsing circular includes... ojl@hotmail.com (Orlando Llanes) (2002-09-14)
Re: Parsing circular includes... peter_flass@yahoo.com (Peter Flass) (2002-09-14)
Re: Parsing circular includes... bsheff2@jyahoo.com (Bob Sheff) (2002-09-14)
| List of all articles for this month |

From: "Bob Sheff" <bsheff2@jyahoo.com>
Newsgroups: comp.compilers
Date: 14 Sep 2002 20:09:39 -0400
Organization: AT&T Worldnet
References: 02-09-090
Keywords: design
Posted-Date: 14 Sep 2002 20:09:39 EDT

On 14 Sep 2002 00:18:28 -0400, "Orlando Llanes" <ojl@hotmail.com> wrote:


> I'm currently working on an assembler, part of what I need is the
>ability to process include files. I understand that I simply save the
>current file pointer, read in the include file, and restore the previous
>file pointer.


You probably need an array of some depth greater than the max you
would assume thinkable;-)


> What I'm having trouble with are circular includes. In other
>words, when file A includes file B, and file B includes file A.


You probably need to look at conditionals here since a lot of MODERN
programmers seem to include the world (and set a flag), then test if
you already included it, ignore the code and embedded includes.


> Am I being a wimp by not allowing circular references?


they are a fact of life.
ciao, Bob


Post a followup to this message

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