1 11 package org.eclipse.jdt.internal.codeassist.complete; 12 13 import org.eclipse.jdt.internal.compiler.ast.BranchStatement; 14 import org.eclipse.jdt.internal.compiler.flow.FlowContext; 15 import org.eclipse.jdt.internal.compiler.flow.FlowInfo; 16 import org.eclipse.jdt.internal.compiler.lookup.BlockScope; 17 18 public class CompletionOnBrankStatementLabel extends BranchStatement { 19 public static final int BREAK = 1; 20 public static final int CONTINUE = 2; 21 22 private int kind; 23 public char[][] possibleLabels; 24 25 public CompletionOnBrankStatementLabel(int kind, char[] l, int s, int e, char[][] possibleLabels) { 26 super(l, s, e); 27 this.kind = kind; 28 this.possibleLabels = possibleLabels; 29 } 30 31 public FlowInfo analyseCode(BlockScope currentScope, 32 FlowContext flowContext, FlowInfo flowInfo) { 33 return null; 35 } 36 37 public void resolve(BlockScope scope) { 38 throw new CompletionNodeFound(this, scope); 39 } 40 public StringBuffer printStatement(int indent, StringBuffer output) { 41 printIndent(indent, output); 42 if(kind == CONTINUE) { 43 output.append("continue "); } else { 45 output.append("break "); } 47 output.append("<CompleteOnLabel:"); output.append(label); 49 return output.append(">;"); } 51 52 } 53 | Popular Tags |