result = result.setAnnotation(ATerm.parse("type"), anno);
result = result.setAnnotation(parse("type"), anno);
  synchronized private ATerm parseFromReader(ATermReader reader)  {        ATerm[] list;    ATerm result;    int c;    String funname;    switch(reader.readSkippingWS()) {      case -1:	throw new ParseError("permature EOF encountered.");      case '[':	//{ Read a list	c = reader.readSkippingWS();	if (c == -1) {	  throw new ParseError("premature EOF encountered.");	}		if(c == ']') {	  c = reader.readSkippingWS();	  if (c == -1) {	    throw new ParseError("premature EOF encountered.");	  }	  	  result = (ATerm)ATermListImpl.empty;	} else {	  list = parseATermsArray(reader);	  if(reader.getLastChar() != ']') {	    throw new ParseError("expected ']' but got '" + (char)reader.getLastChar() + "'");	  }	}	//}	break;      case '<':	//{ Read a placeholder	c = reader.readSkippingWS();	ATerm ph = parseFromReader(reader);		if (reader.getLastChar() != '>') {	  throw new ParseError("expected '>' but got '" + (char)reader.getLastChar() + "'");	}	c = reader.readSkippingWS();	result = makePlaceholder(ph);	//}	break;      case '"':	//{ Read a quoted function	funname = parseString(reader);		c = reader.readSkippingWS();	if (reader.getLastChar() == '(') {	  c = reader.readSkippingWS();	  if (c == -1) {	    throw new ParseError("premature EOF encountered.");	  }	  if (reader.getLastChar() == ')') {	    result = makeAppl(makeAFun(funname, 0, true));	  } else {	    list = parseATermsArray(reader);	    if(reader.getLastChar() != ')') {	      throw new ParseError("expected ')' but got '" + reader.getLastChar() + "'");	    }	    result = makeAppl(makeAFun(funname, list.length, true));	  }	  c = reader.readSkippingWS();	  if (c == -1) {	    throw new ParseError("premature EOF encountered.");	  }	} else {	  result = makeAppl(makeAFun(funname, 0, true));	}	//}	break;      case '-':      case '0':	case '1': case '2': case '3': case '4':      case '5':	case '6': case '7': case '8': case '9':        result = parseNumber(reader);	break;      default:	c = reader.getLastChar();	if (Character.isLetter((char)c)) {	  //{ Parse an unquoted function					 	  funname = parseId(reader);	  if (reader.getLastChar() == '(') {	    c = reader.readSkippingWS();	    if (c == -1) {	      throw new ParseError("premature EOF encountered.");	    }	    if (reader.getLastChar() == ')') {	      result = makeAppl(makeAFun(funname, 0, false));	    } else {	      list = parseATermsArray(reader);	      if(reader.getLastChar() != ')') {		throw new ParseError("expected ')' but got '" + reader.getLastChar() + "'");	      }	      result = makeAppl(makeAFun(funname, list.length, false));	    }	    c = reader.readSkippingWS();	    if (c == -1) {	      throw new ParseError("premature EOF encountered.");	    }	  } else {	    result = makeAppl(makeAFun(funname, 0, false));	  }	  	  //}	} else {	  throw new ParseError("illegal character: " + reader.getLastChar());	}    }	    if(reader.getLastChar() == '{') {      //{ Parse annotation      ATermList annos;      // Parse annotation      if(reader.readSkippingWS() == '}') {	reader.readSkippingWS();	annos = ATermListImpl.empty;      } else {	annos = parseATermList(reader);	if(reader.getLastChar() != '}') {	  throw new ParseError("'}' expected");	}	reader.readSkippingWS();      }      result = result.setAnnotations(annos);	      //}    }    /* Parse some ToolBus anomalies for backwards compatibility */    if(reader.getLastChar() == ':') {      reader.read();      ATerm anno = parseFromReader(reader);      result = result.setAnnotation(ATerm.parse("type"), anno);    }    if(reader.getLastChar() == '?') {      reader.readSkippingWS();      result = result.setAnnotation(ATerm.parse("result"),ATerm.parse("true"));    }    return result;      }