All Downloads are FREE. Search and download functionalities are using the official Maven repository.

persistence.antlr.debug.Tracer Maven / Gradle / Ivy

There is a newer version: 2.1-60f
Show newest version
package persistence.antlr.debug;

public class Tracer extends TraceAdapter implements TraceListener {
	String indent=""; // TBD: should be StringBuffer


	protected void dedent() {
		if (indent.length() < 2)
			indent = "";
		else
			indent = indent.substring(2);
	}
	public void enterRule(TraceEvent e) {
		System.out.println(indent+e);
		indent();
	}
	public void exitRule(TraceEvent e) {
		dedent();
		System.out.println(indent+e);
	}
	protected void indent() {
		indent += "  ";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy