if(channel.last() == ':') { channel.readNext(); ATerm anno = parseATerm(channel); result = result.setAnnotation(ATerm.parse("type"), anno); }  if(channel.last() == '?') { channel.readNext(); result = result.setAnnotation(ATerm.parse("result"),ATerm.parse("true")); }
  public ATerm parseATerm(ATermChannel channel)    throws IOException, ParseError  {    ATerm result, type;    ATermList list;    String fun;    switch(channel.last()) {      case '[':					//{ Read a list								if(channel.readNext() == ']') {					channel.readNext();					result = empty;				} else {					result = parseATermList(channel);					if(channel.last() != ']')						throw new ParseError(channel, channel.last(), "']' expected");					channel.readNext();				}				//}				break;      case '<':				//{ Read a placeholder				channel.readNext();				type = parseATerm(channel);				if(channel.last() != '>')					throw new ParseError(channel, channel.last(), "'>' expected");				result = makePlaceholder(type);				channel.readNext();								//}				break;      case '"':				//{ Read a quoted function								fun = parseQuotedId(channel);				if(channel.last() == '(') {					channel.readNext();					list = parseATermList(channel);					if(channel.last() != ')')						throw new ParseError(channel, channel.last(), "')' expected");					result = makeAppl(fun, list, true);					channel.readNext();				} else					result = makeAppl(fun, empty, 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(channel);				break;      default:				if(Character.isLetter((char)channel.last()) ||					 channel.last() == '_') {					//{ Parse an unquoted function					 					fun = parseId(channel);					if(channel.last() == '(') {						channel.readNext();						list = parseATermList(channel);						if(channel.last() != ')')							throw new ParseError(channel, channel.last(), "')' expected");						result = makeAppl(fun, list);						channel.readNext();					} else						result = makeAppl(fun);					//}				} else {					throw new ParseError(channel, channel.last(), "illegal character");				}    }		if(channel.last() == '{') {			ATermList annos;			// Parse annotation			if(channel.readNext() == '}') {				channel.readNext();				annos = empty;			} else {				annos = parseATermList(channel);				if(channel.last() != '}')					throw new ParseError(channel, channel.last(), "'}' expected");				channel.readNext();			}			result = result.setAnnotations(annos);			}    return result;  }