@Override public void generate() { body(); }
@Override protected void doExecute(MethodExecuteContext context) { for (InstructionNode node : getChildren()) { node.execute(context); } }
@Override public Label getSerialStart() { return tryBlock.getStart(); }
"Syntax error, insert \"Finally\" block or \"Catch\" block to complete Try Block."); } else if (CollectionUtils.isNotEmpty(catches) && finallyBlock == null) { tryBlock.prepare(); if (!tryBlock.isFinish()) { OperatorFactory.newOperator(GOTO.class, new Class[] { KernelProgramBlock.class, Label.class }, tryBlock, getSerialEnd()); addAnyExceptionCatchRange(tryBlock.getStart()); tryBlock.prepare(); if (!tryBlock.isFinish()) { OperatorFactory.newOperator(GOTO.class, new Class[] { KernelProgramBlock.class, Label.class }, tryBlock, finallyBlock.getStart()); addAnyExceptionCatchRange(tryBlock.getEnd()); addAnyExceptionCatchRange(tryBlock.getStart()); tryBlock.prepare(); if (!tryBlock.isFinish()) { OperatorFactory.newOperator(GOTO.class, new Class[] { KernelProgramBlock.class, Label.class }, tryBlock, finallyBlock.getStart());
void appendEpisode(KernelCatch catchBlock) { initEpisode(catchBlock); if (catches == null) { catches = new ArrayList<>(); getChildren().addAfter(tryBlock, catchBlock); } else { KernelCatch previous = catches.get(catches.size() - 1); IClass exceptionType = catchBlock.getExceptionType(); if (exceptionType != null && exceptionType.isChildOrEqual(previous.getExceptionType())) { throw new ASMSupportException("Unreachable catch block for " + exceptionType + ". It is already handled by the catch block for " + exceptionType); } getChildren().addAfter(previous, catchBlock); } catches.add(catchBlock); // Add Exception Table: addTreCatchInfo(tryBlock.getStart(), tryBlock.getEnd(), catchBlock.getStart(), catchBlock.getExceptionType()); }
@Override public Catch catch_(Catch catchBlock) { catchBlock.parent = parent; getDelegate().catch_(catchBlock.getDelegate()); return catchBlock; }
@Override public Finally finally_(Finally finallyClient) { finallyClient.parent = parent; getDelegate().finally_(finallyClient.getDelegate()); return finallyClient; }
@Override public void execute(MethodExecuteContext context) { tryBlock.execute(context); if (CollectionUtils.isNotEmpty(catches)) { for (KernelCatch c : catches) { c.execute(context); } } if (finallyBlock != null) { implicitCatch.execute(context); finallyBlock.execute(context); } }