示例#1
0
void parseBp(){	
	parseA();
	string keyOperators[10] = {"gr", ">", "ge", ">=", "ls", "<", "le", "<=", "eq", "ne"};
	if(NT == 4000 && find(keyOperators, keyOperators + 10, keyword) != keyOperators + 10){
		if(keyword == "gr" || keyword == ">"){
			read(keyword);
			parseA();
			buildTree("gr", 2);
		}else if(keyword == "ge" || keyword == ">="){
			read(keyword);
			parseA();
			buildTree("ge", 2);
		}else if(keyword == "ls" || keyword == "<"){
			read(keyword);
			parseA();
			buildTree("ls", 2);
		}else if(keyword == "le" || keyword == "<="){
			read(keyword);
			parseA();
			buildTree("le", 2);
		}else if(keyword == "eq"){		
			read(keyword);
			parseA();
			buildTree("eq", 2);
		}else if(keyword == "ne"){
			read(keyword);
			parseA();
			buildTree("ne", 2);
		}
	}
}
示例#2
0
void parseIntoAxt(char *lavFile, FILE *f, 
	char *tNibDir, struct dlList *tCache, 
	char *qNibDir, struct dlList *qCache)
/* Parse a blastz lav file and put it an axt. */
{
struct lineFile *lf = lineFileOpen(lavFile, TRUE);
char *line;
struct block *blockList = NULL;
boolean isRc = FALSE;
char *tName = NULL, *qName = NULL;
char *matrix = NULL, *command = NULL;
int qSize = 0, tSize = 0;
int score = 0;

/* Check header. */
if (!lineFileNext(lf, &line, NULL))
   errAbort("%s is empty", lf->fileName);
if (!startsWith("#:lav", line))
   errAbort("%s is not a lav file\n", lf->fileName);

while (lineFileNext(lf, &line, NULL))
    {
    if (startsWith("s {", line))
        {
	parseS(lf, &tSize, &qSize);
	}
    else if (startsWith("h {", line))
        {
	parseH(lf, &tName, &qName, &isRc);
	}
    else if (startsWith("d {", line))
        {
	parseD(lf, &matrix, &command, f);
	}
    else if (startsWith("a {", line))
        {
	parseA(lf, &blockList, &score);
        if (optionExists("dropSelf"))
	    {
	    struct block *bArr[256];
	    int numBLs = 0, i = 0;
	    boolean rescore = FALSE;
	    rescore = breakUpIfOnDiagonal(blockList, isRc, qName, tName,
					  qSize, tSize, bArr, ArraySize(bArr),
					  &numBLs);
	    for (i=0;  i < numBLs;  i++)
		{
		outputBlocks(lf, bArr[i], score, f, isRc, 
			     qName, qSize, qNibDir, qCache,
			     tName, tSize, tNibDir, tCache, rescore);
		slFreeList(&bArr[i]);
		}
	    }
	else
	    {
	    outputBlocks(lf, blockList, score, f, isRc, 
			 qName, qSize, qNibDir, qCache,
			 tName, tSize, tNibDir, tCache, FALSE);
	    slFreeList(&blockList);
	    }
	}
    }
lineFileClose(&lf);
}