Expression* Expression :: Compile (const RGString& expressionString) {
	
	int errcnt = 0;
	finalExpression = NULL;
	RemainingCharacters = (int)expressionString.Length ();
	ExpressionCriterion = expressionString;
	name_stack.ClearAndDelete ();
		
	if ( Exprparse ())
		errcnt++;
	
	if (errcnt > 0)
		cout << "Found errors in:  " << expressionString.GetData () << endl;
		
	if (name_stack.Entries () > 0)
		cout << "Left with " << name_stack.Entries () << " names still in stack...compilation incomplete." << endl;
		
	name_stack.ClearAndDelete ();
		
	if (errcnt == 0)
		return finalExpression;
	
	return NULL;

}
Exemple #2
0
bool IndividualLocus :: IsContainedIn (const RGDList& alleleList) const {

	RGDList temp (mAllelesByName);
	IndividualAllele* nextAllele;

	while (nextAllele = (IndividualAllele*) temp.GetFirst ()) {

		if (!alleleList.Contains (nextAllele)) {

			temp.ClearAndDelete ();
			delete nextAllele;
			return false;
		}

		delete nextAllele;
	}

	return true;
}
Exemple #3
0
bool LocusCollection :: IsContainedIn (const LocusCollection& collection) const {

	RGDList tempLocusList (mLociByName);
	IndividualLocus* nextLocus;
	IndividualLocus* foundLocus;

	while (nextLocus = (IndividualLocus*) tempLocusList.GetFirst ()) {

		foundLocus = collection.FindLocus (nextLocus->GetName ());

		if ((foundLocus == NULL) || (!nextLocus->Matches (*foundLocus))) {

			delete nextLocus;
			tempLocusList.ClearAndDelete ();
			return false;
		}

		delete nextLocus;
	}

	return true;
}