Class DeadCodeEliminator

java.lang.Object
com.javacc.parser.Node.Visitor
com.javacc.output.java.DeadCodeEliminator

public class DeadCodeEliminator extends Node.Visitor
A visitor that eliminates unused code. It is not absolutely correct, in the sense of catching all unused methods or fields, but works for our purposes. For example, it does not take account overloaded methods, so if the method name is referenced somewhere, it is assumed to be used. However, it might be a reference to a method with the same name with different arguments. Also variable names can be in a sense overloaded by being defined in inner classes, but we don't bother about that either.