public static Expression extend(Expression expr, TokenStream stream)
	{
		String nextToken = stream.getFirst().toString();
		while (nextToken.equals(".") || nextToken.equals("(") || nextToken.equals("["))
		{
			if (nextToken.equals("."))
			{
				stream.removeFirst();
				expr = new ExpressionIdentifier(expr, stream.removeFirst());
			}
			else if (nextToken.equals("("))
			{
				stream.removeFirst();
				expr = new ExpressionCall(expr, stream);
			}
			else if (nextToken.equals("["))
			{
				stream.removeFirst();
				Expression reference = Expression.interpret(stream);
				Token temp = stream.removeFirst();
				if (temp == Token.COLON)
				{
					Expression sliceRight = Expression.interpret(stream);
					expr = new ExpressionReference(expr, reference, sliceRight);
					temp = stream.removeFirst();
				}
				else
					expr = new ExpressionReference(expr, reference);
				if (!temp.toString().equals("]"))
					throw new SyntaxError("Expecting close bracket, found " + temp);
			}
			nextToken = stream.getFirst().toString();
		}
		return expr;
	}