scanclrmake/src/crparser.cxx
// ===========================================================================
// Track the targetName and workingDirectory.
//
Track the targetName and workingDirectory.
Track the targetName and workingDirectory .
void CRParser::trackTarget(ParseLine &line)
{
    if (currentSection == intro_sct) {
	const char *l = line.getLine().c_str();
	Regexp tgt("arget ");
	if (tgt.Match(l, strlen(l), 0) >= 0) {
	    Regexp tgt2(" built by ");
	    const char *l2 = l + tgt.EndOfMatch(0);
	    if (tgt2.Match(l2, strlen(l2), 0) >= 0) {
		string t(l2, tgt2.BeginningOfMatch(0));
		targetName = t;
		if (targetCount == 1) {
		    firstTargetName = t;
		}
	    }
	}
	Regexp wd_re("directory was ");
	if (wd_re.Match(l, strlen(l), 0) >= 0) {
	    workingDirectory = l + wd_re.EndOfMatch(0);
	}
    }
    if (currentSection == no_sct && hRuleCount >= 2) {
	targetName = "";
	workingDirectory = "";
    }
}
void CRParser :: trackTarget ( ParseLine & line ) { if ( currentSection == intro_sct ) { const char * l = line . getLine ( ) . c_str ( ) ; Regexp tgt ( " " ) ; if ( tgt . Match ( l , strlen ( l ) , 0 ) >= 0 ) { Regexp tgt2 ( " " ) ; const char * l2 = l + tgt . EndOfMatch ( 0 ) ; if ( tgt2 . Match ( l2 , strlen ( l2 ) , 0 ) >= 0 ) { string t ( l2 , tgt2 . BeginningOfMatch ( 0 ) ) ; targetName = t ; if ( targetCount == 1 ) { firstTargetName = t ; } } } Regexp wd_re ( " " ) ; if ( wd_re . Match ( l , strlen ( l ) , 0 ) >= 0 ) { workingDirectory = l + wd_re . EndOfMatch ( 0 ) ; } } if ( currentSection == no_sct && hRuleCount >= 2 ) { targetName = " " ; workingDirectory = " " ; } }
Track the targetName and workingDirectory.
Track the targetName and workingDirectory .
// Initial working directory was /d00d/sun5-O/obj/aset_CCcc/CCcc/src