private String[] splitString(String ipFormula) throws ScriptSyntaxException {
		LinkedList<String> tokens = new LinkedList<String>();
		int braces=0;//level of braces
		
		//considering that there is always only one space
		int posBegin=0;
		int posEnd=0;
		
		while (posEnd<ipFormula.length()){
			if (isSpace(ipFormula.charAt(posEnd)) && braces==0){
				//space found
				String token=ipFormula.substring(posBegin,posEnd).trim();
				if (token.length()!=0)
					tokens.add(token);//adding only non-empty tokens
				posBegin=posEnd;//moving to the next token
			}
			if (ipFormula.charAt(posEnd)=='(')
				braces++;
			if (ipFormula.charAt(posEnd)==')')
				braces--;
			posEnd++;
		}
		String token=ipFormula.substring(posBegin,posEnd).trim();
		if (token.length()!=0)
			tokens.add(token);//adding only non-empty tokens
	
		//tokens parsed
		//checking braces consistency
		if (braces!=0){
			throw new ScriptSyntaxException("Braces are inconsistent: "+ipFormula);
		}
		
		String[] rval=new String[tokens.size()];
		int i=0;
		for (Iterator<String> iToken = tokens.iterator(); iToken.hasNext();++i) {
			rval[i] = iToken.next();
		}
		//returning array. temporary list is thrown away.
		return rval;
	}