if (c == '.') {  if (parsedDecimalPoint) { throw new MapyrusException("Invalid number in expression at " + p.getCurrentFilenameAndLineNumber()); } parsedDecimalPoint = true; }
	private ExpressionTreeNode parseFactor(Preprocessor p) throws IOException, MapyrusException	{		boolean hasUnaryMinus = false;		boolean parsedDecimalPoint = false;		StringBuffer buf = new StringBuffer();		ExpressionTreeNode expr;		int c, lastC, quote;		int type;		c = p.readNonSpace();		if (c == '\'' || c == '"')		{			/*			 * It's a quoted string.  Keep reading up until matching quote.			 */			lastC = quote = c;			while ((c = p.read()) != quote || lastC == '\\')			{				if (c == -1)				{					throw new MapyrusException("Unexpected end of file in string at " +						p.getCurrentFilenameAndLineNumber());				}				if (c == '\\' && lastC != '\\')				{					/*					 * Ignore all escaped characters except '\\'.					 */				}				else				{					/*					 * Compress '\\' in string into					 * a single backslash.					 */					buf.append((char)c);				}				lastC = c;			}			return(new ExpressionTreeNode(new Argument(Argument.STRING, buf.toString())));		}		if (c == '+')		{			/*			 * Skip unary plus.			 */			c = p.readNonSpace();		}		if (c == '-')		{			/*			 * Note unary minus and continue.			 */			hasUnaryMinus = true;			c = p.readNonSpace();		}		if (Character.isDigit((char)c) || c == '.')		{			/*			 * Parse a decimal number and return it as a leaf node.			 */			while (Character.isDigit((char)c) || c == '.')			{				buf.append((char)c);				if (c == '.')				{					/*					 * Expect only one decimal point in a number.					 */					if (parsedDecimalPoint)					{						throw new MapyrusException("Invalid number in expression at " +							p.getCurrentFilenameAndLineNumber());					}					parsedDecimalPoint = true;				}				c = p.read();			}			p.unread(c);			double d = 0.0;			try			{				d = Double.parseDouble(buf.toString());			}			catch (NumberFormatException e)			{			}			if (hasUnaryMinus)				d = -d;			return(new ExpressionTreeNode(new Argument(d)));		}		if (c == -1)		{			throw new MapyrusException("Unexpected end of file at " + p.getCurrentFilenameAndLineNumber());		}		if (c == '(')		{			expr = parseAndBoolean(p);			c = p.readNonSpace();			if (c != ')')			{				throw new MapyrusException("Unmatched '(' in expression at " +					p.getCurrentFilenameAndLineNumber());			}		}		else if (Character.isLetter((char)c))		{			/*			 * It does not look like a numeric expression or a string			 * expression so maybe it is a variable name.			 */			buf.append((char)c);			c = p.read();			while (c != -1 && (c == '.' || c == '_' ||				Character.isLetterOrDigit((char)c)))			{				buf.append((char)c);				c = p.read();			}			p.unread(c);			expr = new ExpressionTreeNode(new Argument(Argument.VARIABLE, buf.toString()));			}		else		{			/*			 * It's nothing that we understand.			 */			throw new MapyrusException("Invalid expression at " +				p.getCurrentFilenameAndLineNumber());		}		if (hasUnaryMinus)		{			/*			 * Expand expression to negate value.			 */			ExpressionTreeNode left = new ExpressionTreeNode(new Argument(-1.0));			expr = new ExpressionTreeNode(left, MULTIPLY_OPERATION, expr);		}		return(expr);	}