|
@@ -137,7 +137,7 @@ public class SPSAssembler {
|
|
|
|
|
|
CommandlineProcessor.processCommandline(SPSAssembler.class, args);
|
|
|
|
|
|
- registerOutputter();
|
|
|
+ registerAllOutputter();
|
|
|
|
|
|
if ((source == null) || (!source.exists())) {
|
|
|
CommandlineProcessor.showHelp(
|
|
@@ -171,6 +171,7 @@ public class SPSAssembler {
|
|
|
|
|
|
outputFile(mnemonics);
|
|
|
|
|
|
+ System.out.println("assembling succesfully");
|
|
|
} catch (SyntaxError e) {
|
|
|
e.printStackTrace();
|
|
|
System.err.println(e.getMessage());
|
|
@@ -186,8 +187,8 @@ public class SPSAssembler {
|
|
|
* @throws IllegalAccessException
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- private static void registerOutputter() throws InstantiationException, IllegalAccessException, Exception {
|
|
|
- Set<Class<?>> outputClasses = registerOutputter(SPSOutputter.class);
|
|
|
+ private static void registerAllOutputter() throws InstantiationException, IllegalAccessException, Exception {
|
|
|
+ Set<Class<?>> outputClasses = searchOutputter(SPSOutputter.class);
|
|
|
for (Class<?> outClass : outputClasses) {
|
|
|
SPSOutputter annotation = outClass.getAnnotation(SPSOutputter.class);
|
|
|
if (annotation.name().equalsIgnoreCase(outputFormat)) {
|
|
@@ -200,14 +201,12 @@ public class SPSAssembler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static Set<Class<?>> registerOutputter(Class<? extends Annotation>... annotationClasses) {
|
|
|
+ private static Set<Class<?>> searchOutputter(Class<? extends Annotation> annotationClass) {
|
|
|
ConfigurationBuilder builder = new ConfigurationBuilder();
|
|
|
builder.addUrls(ClasspathHelper.forPackage(DEFAULT_PACKAGE_FILTER));
|
|
|
Reflections reflections = new Reflections(builder);
|
|
|
Set<Class<?>> classes = new HashSet<Class<?>>();
|
|
|
- for (Class<? extends Annotation> class1 : annotationClasses) {
|
|
|
- classes.addAll(reflections.getTypesAnnotatedWith(class1));
|
|
|
- }
|
|
|
+ classes.addAll(reflections.getTypesAnnotatedWith(annotationClass));
|
|
|
return classes;
|
|
|
}
|
|
|
|
|
@@ -417,7 +416,7 @@ public class SPSAssembler {
|
|
|
// seems to be a macro usage
|
|
|
name = name.substring(1);
|
|
|
String[] arguments = label.split(" ");
|
|
|
- if (arguments.length < 2) {
|
|
|
+ if (arguments.length < 1) {
|
|
|
throw new IllegalArgument(srcLineNumber, "Need at least one argument for the macro name.");
|
|
|
}
|
|
|
String[] args = null;
|