Tracer.java
上传用户:afrynkmhm
上传日期:2007-01-06
资源大小:1262k
文件大小:0k
- package 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 += " ";
- }
- }