Newer
Older
org.ntlab.traceDebugger / src / org / ntlab / traceDebugger / CallStackVisitor.java
r-isitani on 18 Nov 2019 997 bytes 初コミット
package org.ntlab.traceDebugger;

import org.ntlab.traceAnalysisPlatform.tracer.trace.IStatementVisitor;
import org.ntlab.traceAnalysisPlatform.tracer.trace.MethodInvocation;
import org.ntlab.traceAnalysisPlatform.tracer.trace.Statement;
import org.ntlab.traceAnalysisPlatform.tracer.trace.TracePoint;

public class CallStackVisitor implements IStatementVisitor {
	private TracePoint before = null;
	
	public CallStackVisitor() {
		
	}
	
	public CallStackVisitor(TracePoint before) {
		this.before = before;
	}
	
	@Override
	public boolean preVisitStatement(Statement statement) {
		System.out.println("CallStackVisitor#preVisitStatement(Statement)");
		if (!(statement instanceof MethodInvocation)) return false;
		if (before == null) return true;
		MethodInvocation mi = (MethodInvocation)statement;
		return (mi.getTimeStamp() < before.getStatement().getTimeStamp());
	}

	@Override
	public boolean postVisitStatement(Statement statement) {
		return false;
	}
}