cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FW: cons 2.1.2 issues


From: Zachary Deretsky
Subject: FW: cons 2.1.2 issues
Date: Thu, 2 Nov 2000 14:29:18 -0800

> Notice that within the scanner function itself, you can read multiple
> lines.  You could read the entire file, in which case the 
> scanner would
> be called only once per file.

This is NOT the case.

Here is my scanner which prints every time it is called:
-------------------------------------
sub cons::iScan {
    my(@includes);
    do {
        if(/^%(include|import|extern)\s+(\w+\.)(i|ii|iic|iim|hpp)\s*$/) {
            push (@includes, "$2$3");
        };
    }
    while <SCAN> ;
#    if(scalar(@includes)) {
        print "INCLUDES:   ", join(' ', @includes), "\n";
#    };
    close(SCAN);
    @includes
    };
----------------------------------------

I do close the SCAN handle.
execution produces hundres of
empty "INCLUDES: " lines and 9 non-empty lines:

INCLUDES:   gandalf.i
INCLUDES:   autpyapi.ii
INCLUDES:   geom.ii
INCLUDES:   ctm.ii
INCLUDES:   rtc.ii
INCLUDES:   rngCommon.hpp
INCLUDES:   rings_typemaps.i
INCLUDES:   rings.ii
INCLUDES:   rings.iim

all of these files are includes in the single file being scanned
and should have been returned in one list.
Log tells me that scanner is called for every line, at least.

If the files were scanned only once, there should have been at most
9 empty "INCLUDES: " lines (actually 4 because there are 4 local 
files and path does not work).

Zach.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]