package be.kuleuven.cs.distrinet.jnome.tool;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import be.kuleuven.cs.distrinet.jnome.tool.dependency.DependencyAnalysisTool;
import be.kuleuven.cs.distrinet.jnome.tool.design.DesignAnalysisTool;
import be.kuleuven.cs.distrinet.jnome.tool.syntax.SyntaxAnalysisTool;

public class FrontEnd {

	public static void main(String[] args) {
		new FrontEnd().process(args);
	}
	
	public FrontEnd() {
		add(new DesignAnalysisTool());
		add(new SyntaxAnalysisTool());
		add(new DependencyAnalysisTool());
	}
	
	private void add(Tool tool) {
		_tools.put(tool.name(), tool);
	}
	
	public void process(String[] args) {
		if(args.length == 0) {
			System.out.println("Please provide the name of the tool and its arguments.");
		} else {
			//Arrays.asList is immutable.
			List<String> arguments = new ArrayList(Arrays.asList(args));
			String toolName = arguments.get(0);
			Tool tool = _tools.get(toolName);
			arguments.remove(0);
			String[] newArgs = new String[args.length-1];
			tool.execute(arguments.toArray(newArgs));
		}
	}
	
	private Map<String, Tool> _tools = new HashMap<String,Tool>();
}

@@ -408,16 +408,107 @@
 tEnd %7B%0A%0A
+  /**%0A   * @param args The first argument determines the analysis that is performed.%0A   */%0A
 %09public 
@@ -920,16 +920,72 @@
 nts.%22);%0A
+%09%09%09_tools.keySet().forEach(s -%3E System.out.println(s));%0A
 %09%09%7D else

Print the list of tools.