本文整理汇总了Java中org.eclipse.jdt.internal.compiler.ast.LabeledStatement类的典型用法代码示例。如果您正苦于以下问题:Java LabeledStatement类的具体用法?Java LabeledStatement怎么用?Java LabeledStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LabeledStatement类属于org.eclipse.jdt.internal.compiler.ast包,在下文中一共展示了LabeledStatement类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visit
import org.eclipse.jdt.internal.compiler.ast.LabeledStatement; //导入依赖的package包/类
/**
* @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.LabeledStatement, org.eclipse.jdt.internal.compiler.lookup.BlockScope)
*/
public boolean visit(LabeledStatement labeledStatement, BlockScope scope) {
this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
this.scribe.printNextToken(TerminalTokens.TokenNameCOLON, this.preferences.insert_space_before_colon_in_labeled_statement);
if (this.preferences.insert_space_after_colon_in_labeled_statement) {
this.scribe.space();
}
if (this.preferences.insert_new_line_after_label) {
this.scribe.printNewLine();
}
final Statement statement = labeledStatement.statement;
statement.traverse(this, scope);
if (statement instanceof Expression) {
this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
}
return false;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:CodeFormatterVisitor.java
示例2: getTargetContextForBreakLabel
import org.eclipse.jdt.internal.compiler.ast.LabeledStatement; //导入依赖的package包/类
public FlowContext getTargetContextForBreakLabel(char[] labelName) {
FlowContext current = this, lastNonReturningSubRoutine = null;
while (current != null) {
if (current.isNonReturningContext()) {
lastNonReturningSubRoutine = current;
}
char[] currentLabelName;
if (((currentLabelName = current.labelName()) != null)
&& CharOperation.equals(currentLabelName, labelName)) {
((LabeledStatement)current.associatedNode).bits |= ASTNode.LabelUsed;
if (lastNonReturningSubRoutine == null)
return current;
return lastNonReturningSubRoutine;
}
current = current.getLocalParent();
}
// not found
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:FlowContext.java
示例3: consumeStatementLabel
import org.eclipse.jdt.internal.compiler.ast.LabeledStatement; //导入依赖的package包/类
protected void consumeStatementLabel() {
// LabeledStatement ::= 'Identifier' ':' Statement
// LabeledStatementNoShortIf ::= 'Identifier' ':' StatementNoShortIf
//optimize push/pop
Statement statement = (Statement) this.astStack[this.astPtr];
this.astStack[this.astPtr] =
new LabeledStatement(
this.identifierStack[this.identifierPtr],
statement,
this.identifierPositionStack[this.identifierPtr--],
this.endStatementPosition);
this.identifierLengthPtr--;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:Parser.java
示例4: getTargetContextForContinueLabel
import org.eclipse.jdt.internal.compiler.ast.LabeledStatement; //导入依赖的package包/类
public FlowContext getTargetContextForContinueLabel(char[] labelName) {
FlowContext current = this;
FlowContext lastContinuable = null;
FlowContext lastNonReturningSubRoutine = null;
while (current != null) {
if (current.isNonReturningContext()) {
lastNonReturningSubRoutine = current;
} else {
if (current.isContinuable()) {
lastContinuable = current;
}
}
char[] currentLabelName;
if ((currentLabelName = current.labelName()) != null && CharOperation.equals(currentLabelName, labelName)) {
((LabeledStatement)current.associatedNode).bits |= ASTNode.LabelUsed;
// matching label found
if ((lastContinuable != null)
&& (current.associatedNode.concreteStatement() == lastContinuable.associatedNode)) {
if (lastNonReturningSubRoutine == null) return lastContinuable;
return lastNonReturningSubRoutine;
}
// label is found, but not a continuable location
return FlowContext.NotContinuableContext;
}
current = current.getLocalParent();
}
// not found
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:34,代码来源:FlowContext.java
示例5: unusedLabel
import org.eclipse.jdt.internal.compiler.ast.LabeledStatement; //导入依赖的package包/类
public void unusedLabel(LabeledStatement statement) {
int severity = computeSeverity(IProblem.UnusedLabel);
if (severity == ProblemSeverities.Ignore) return;
String[] arguments = new String[] {new String(statement.label)};
this.handle(
IProblem.UnusedLabel,
arguments,
arguments,
severity,
statement.sourceStart,
statement.labelEnd);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:ProblemReporter.java
示例6: endVisit
import org.eclipse.jdt.internal.compiler.ast.LabeledStatement; //导入依赖的package包/类
@Override
public void endVisit(LabeledStatement x, BlockScope scope) {
try {
JStatement statement = pop(x.statement);
if (statement == null) {
push(null);
return;
}
SourceInfo info = makeSourceInfo(x);
push(new JLabeledStatement(info, getOrCreateLabel(info, x.label), statement));
} catch (Throwable e) {
throw translateException(x, e);
}
}
开发者ID:WeTheInternet,项目名称:xapi,代码行数:15,代码来源:GwtAstBuilder.java
示例7: visit
import org.eclipse.jdt.internal.compiler.ast.LabeledStatement; //导入依赖的package包/类
@Override public boolean visit(LabeledStatement node, BlockScope scope) {
fixPositions(setGeneratedBy(node, source));
return super.visit(node, scope);
}
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:5,代码来源:SetGeneratedByVisitor.java
示例8: visit
import org.eclipse.jdt.internal.compiler.ast.LabeledStatement; //导入依赖的package包/类
@Override public boolean visit(LabeledStatement node, BlockScope scope) {
setGeneratedBy(node, source);
applyOffsetASTNode(node);
return super.visit(node, scope);
}
开发者ID:redundent,项目名称:lombok,代码行数:6,代码来源:SetGeneratedByVisitor.java
注:本文中的org.eclipse.jdt.internal.compiler.ast.LabeledStatement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论