/* * Decompiled with CFR 0.152. */ package wasm.misc; import java.util.ArrayList; import java.util.List; import wasm.disassembly.instructions.Expression; import wasm.disassembly.modules.sections.code.Locals; import wasm.disassembly.types.FuncType; import wasm.disassembly.types.ValType; public class Function { private FuncType funcType = null; private List locals = null; private Expression code = null; public Function(FuncType funcType, List locals, Expression code) { this.funcType = funcType; this.locals = locals; this.code = code; } public FuncType getFuncType() { return this.funcType; } public void setFuncType(FuncType funcType) { this.funcType = funcType; } public List getLocals() { return this.locals; } public List getLocalsFloored() { ArrayList result = new ArrayList(); for (Locals loc : this.locals) { int i = 0; while ((long)i < loc.getAmount()) { result.add(loc.getValType()); ++i; } } return result; } public void setLocals(List locals) { this.locals = locals; } public Expression getCode() { return this.code; } public void setCode(Expression code) { this.code = code; } }