class SubroutineDeclarationParser {

    public SubroutineDeclaration parse(final String declaration) {
        if (declaration == null) {
            throw new IllegalArgumentException("Subroutine declaration cannot be null.");
        }

        final EtmPoint point = PointFactory.getPoint(getClass(), "parse(String)");
        String reducedDeclaration = reduceDeclaration(uncommentDeclaration(declaration).trim());
        try {
            return new SubroutineDeclaration(parseName(declaration, reducedDeclaration),
                    parseReturnType(declaration, reducedDeclaration), parseArguments(reducedDeclaration));
        } finally {
            point.collect();
        }
    }

}