com.dragome.compiler.ast.ExceptionHandlers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dragome-bytecode-js-compiler Show documentation
Show all versions of dragome-bytecode-js-compiler Show documentation
Dragome SDK module: bytecode to javascript compiler
package com.dragome.compiler.ast;
import java.util.ArrayList;
import org.apache.bcel.classfile.Code;
import org.apache.bcel.classfile.CodeException;
public class ExceptionHandlers extends ArrayList
{
public ExceptionHandlers(Code code)
{
CodeException previousCodeException= null;
for (CodeException codeException : code.getExceptionTable())
{
if (previousCodeException != null && previousCodeException.getHandlerPC() == codeException.getHandlerPC())
{
previousCodeException.setEndPC(codeException.getEndPC());
}
else
{
add(new ExceptionHandler(codeException));
}
previousCodeException= codeException;
}
}
}