throw new PreprocessException(fileName + " line " + line
throw new BuildException(fileName + " line " + line
	protected boolean evaluateTerm(String term, String fileName, int line)	throws PreprocessException	{		// check for parenthesisses:		if (term.indexOf('(') != -1) {			throw new PreprocessException(fileName + " line " + line 					+ ": invalid/additional parenthesis \"(\" in term [" + term 					+ "] (the term might be simplified)." ); 		}		if (term.indexOf(')') != -1) {			throw new PreprocessException(fileName + " line " + line 					+ ": invalid/additional parenthesis \")\" in term [" + term 					+ "] (the term might be simplified)." ); 		}		Matcher symbolMatcher = SYMBOL_PATTERN.matcher( term );		Matcher operatorMatcher = OPERATOR_PATTERN.matcher( term );		int lastSymbolEnd = 0;		boolean result = true;		int operator = NONE;		String symbol = null;		while (symbolMatcher.find()) {			// evaluate symbol:			symbol = symbolMatcher.group();			int negatePos = term.indexOf( '!', lastSymbolEnd );			boolean negate = ( (negatePos != -1) && (negatePos < symbolMatcher.start()) );			lastSymbolEnd = symbolMatcher.end();			boolean symbolResult = false;			if ("true".equals( symbol )) {				symbolResult = true;			} else if ("false".equals( symbol)) {				symbolResult = false;			} else {				symbolResult = ( this.symbols.get( symbol ) != null );			}			if (negate) {				symbolResult = !symbolResult;			}			// combine temporary result with main result:			switch (operator) {				case NONE: result = symbolResult; break;				case AND: result &= symbolResult; break;				case OR: result |= symbolResult; break;				case XOR: result ^= symbolResult; break;				case INVALID:					throw new PreprocessException(fileName + " line " + line 							+ ": found no operator before symbol [" + symbol + "] in term [" + term 							+ "] (both symbol and term might be simplified)." ); 			}						// evaluate next operator:			if (operatorMatcher.find()) {				// check if operator is in the correct position:				int operatorPos = operatorMatcher.start();				if (operatorPos < lastSymbolEnd ) {					throw new PreprocessException( fileName + " line " + line  							+": found invalid/additional operator in [" + term +"] (that term might be simplified)." );									}				String empty = term.substring( lastSymbolEnd + 1, operatorPos ).trim();				if (empty.length() > 0) {					throw new PreprocessException( fileName + " line " + line  							+": missing or invalid operator after [" + symbol +"] in term [" + term							+"] (both symbol and term might be simplified)." );				}				// okay operator is in correct position, so know check what operator it is:				String operatorSymbol = operatorMatcher.group();				if ("&&".equals( operatorSymbol)) {					operator = AND;				} else if ("||".equals( operatorSymbol)) {					operator = OR;				} else if ("^".equals( operatorSymbol)) {					operator = XOR;				}			} else { // no more operator found:				operator = INVALID;			}		}		// check if there are any more operators after the last symbol:		if (operator != INVALID){			throw new PreprocessException( fileName + " line " + line  					+ ": found invalid/additional operator [" + operatorMatcher.group() 					+ "] after symbol [" + symbol + "] in term [" + term 					+ "] (both symbol and term might be simplified)." ); 		}		return result;	}