Package org.candle.decompiler.ast

Source Code of org.candle.decompiler.ast.StatementBlock

package org.candle.decompiler.ast;

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

import org.candle.decompiler.intermediate.code.StatementIntermediate;
import org.candle.decompiler.intermediate.expression.Expression;

public class StatementBlock extends SerializableBlock<StatementIntermediate> {

  public StatementBlock(StatementIntermediate statement) {
    super(statement);
  }
 
  @Override
  public void write(Writer builder) throws IOException {
    final String indent = buildIndent();
    Expression expression = intermediate.getExpression();
   
    builder.write(indent);
    expression.write(builder);
    builder.write(";");
  }
 
  @Override
  public void addChild(Block block) {
    throw new IllegalStateException("Not able to nest statements.");
  }
 
}
TOP

Related Classes of org.candle.decompiler.ast.StatementBlock

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.