Infer package name and class name from input code