Package org.candle.decompiler.ast.tcf

Source Code of org.candle.decompiler.ast.tcf.CatchBlock

package org.candle.decompiler.ast.tcf;

import java.io.IOException;
import java.io.Writer;

import org.apache.bcel.classfile.Utility;
import org.candle.decompiler.ast.SerializableBlock;
import org.candle.decompiler.ast.SignatureUtility;
import org.candle.decompiler.intermediate.code.CatchIntermediate;
import org.candle.decompiler.intermediate.expression.Variable;

public class CatchBlock extends SerializableBlock<CatchIntermediate> {

  public CatchBlock(CatchIntermediate intermediate) {
    super(intermediate);
  }

  @Override
  public void write(Writer builder) throws IOException {
    final String indent = buildIndent();
    builder.append(indent);
    builder.append("catch(");
   
    Variable catchVariable = intermediate.getCatchVariable();
    String type = SignatureUtility.signatureToString(catchVariable.getType().getSignature());
   
    builder.append(type);
    builder.append(" ");
    builder.append(catchVariable.getName());
    builder.append(") ");
    super.write(builder);
  }
 
}
TOP

Related Classes of org.candle.decompiler.ast.tcf.CatchBlock

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.