| 
					
				 | 
			
			
				@@ -39,6 +39,7 @@ import java.util.Map.Entry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.Set;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.apache.commons.lang3.StringUtils;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.apache.log4j.Logger;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.reflections.Reflections;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.reflections.util.ClasspathHelper;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.reflections.util.ConfigurationBuilder;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -92,6 +93,7 @@ public class SPSAssembler { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   private Macro actualMacro;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   private Map<String, Macro> macros;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   private List<Integer> lineNumbers;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  private Logger log = Logger.getLogger(this.getClass());
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   @SwitchOption(shortKey = 'h', longKey = "help", name = "help", help = "show this help page", required = false, defaultValue = false)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   public static void doHelp(boolean value) {
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -297,14 +299,14 @@ public class SPSAssembler { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   public void doWork(File source) throws IOException, SyntaxError {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    System.out.printf("start parsing file: %s\r\n", source.getName());
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    log.debug(String.format("start parsing file: %s\r\n", source.getName()));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     List<String> sourceFile = Files.readAllLines(source.toPath(), Charset.forName("UTF-8"));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     doCompile(sourceFile);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   public void doWork(String source) throws IOException, SyntaxError {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    System.out.printf("start parsing source string: %s\r\n", source);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    log.debug(String.format("start parsing source string: %s\r\n", source));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     List<String> sourceFile = new ArrayList<>();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     source.lines().forEach(l -> sourceFile.add(l));
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -576,14 +578,14 @@ public class SPSAssembler { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (!includeFile.exists()) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       throw new IllegalArgument(srcLineNumber, String.format("include file not found: %s", includeFile.getName()));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    System.out.println("=====");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    System.out.printf("include file: %s \r\n", includeFile.getName());
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    log.debug("=====");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    log.debug(String.format("include file: %s \r\n", includeFile.getName()));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     SPSAssembler spsAssembler = new SPSAssembler();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     spsAssembler.doWork(includeFile);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     outputMnemonics(spsAssembler.getMnemonics());
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     outputLabels(spsAssembler);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     outputMacros(spsAssembler);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    System.out.println("=====");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    log.debug("=====");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   private Mnemonic getMnemonic(String line, int srcLineNumber) throws SyntaxError {
 
			 |