private String processType( Object type )
	{		
		Object[] tokens;
		StringBuilder sb;
		boolean first = true;

		Class<? extends Object> typeClass = type.getClass();

		switch( typeClass.getSimpleName() ) 
		{
		case "TypeContext":
			return processType( getTokens(type)[0] );			
		case "PrimitiveTypeContext": 
			return getTokens(type)[0].toString();
		case "FunctionTypeContext":
			tokens = getTokens(type);
			return processType(tokens[1]) + " => " + processType(tokens[3]);			
		case "ReferenceTypeContext": 
			return  processType(getTokens(type)[0]);
		case "ClassOrInterfaceTypeContext":
			sb = new StringBuilder();
			for( Object token : getTokens(type) )
				if( token.getClass().getSimpleName().equals("ClassOrInterfaceTypeSuffixContext"))
					if( first )
					{
						sb.append(processType(token));
						first = false;
					}	
					else
						sb.append(":").append(processType(token));

			return sb.toString();
		case "ClassOrInterfaceTypeSuffixContext":
			tokens = getTokens(type); 
			if( tokens.length > 1 )
				return tokens[0].toString() + processType( tokens[1] );
			else
				return tokens[0].toString();
		case "TypeArgumentsContext":
		case "TypeParametersContext":
			sb = new StringBuilder("<");
			for( Object token : getTokens(type) ) 
			{
				if(this.contextClass.isInstance(token))
				{
					if( first )
					{
						sb.append(processType(token));
						first = false;
					}
					else
						sb.append(",").append(processType(token));
				}
			}
			sb.append(">");
			return sb.toString();
		case "TypeParameterContext":
			tokens = getTokens(type); 
			if( tokens.length > 1 )
				return tokens[0].toString() + " " + processType(tokens[1]);
			else
				return tokens[0].toString();
		case "IsListContext":
			sb = new StringBuilder("is ");
			for( Object token : getTokens(type) )
				if(this.contextClass.isInstance(token))
				{
					if( first )
					{
						sb.append(processType(token));
						first = false;
					}
					else
						sb.append(" and ").append(processType(token));
				}
			return sb.toString();
		case "ResultTypesContext":
		case "FormalParametersContext":
			sb = new StringBuilder("(");
			for( Object token : getTokens(type) )
			{								
				if ( contextClass.isInstance(token)){
					if( first )
					{
						sb.append(processType(token));
						first = false;
					}
					else
						sb.append(",").append(processType(token));
				}
			}
			sb.append(")");
			return sb.toString();
		case "ResultTypeContext":
		case "FormalParameterContext":
			tokens = getTokens(type);			
			return getModifiers(tokens[0]) + processType(tokens[1]);
		}

		return "";
	}