当前位置: 首页>>代码示例>>Java>>正文


Java LabeledStatement类代码示例

本文整理汇总了Java中org.eclipse.jdt.core.dom.LabeledStatement的典型用法代码示例。如果您正苦于以下问题:Java LabeledStatement类的具体用法?Java LabeledStatement怎么用?Java LabeledStatement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LabeledStatement类属于org.eclipse.jdt.core.dom包,在下文中一共展示了LabeledStatement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getParentLoopBody

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
private Statement getParentLoopBody(ASTNode node) {
	Statement stmt = null;
	ASTNode start = node;
	while (start != null && !(start instanceof ForStatement) && !(start instanceof DoStatement) && !(start instanceof WhileStatement) && !(start instanceof EnhancedForStatement) && !(start instanceof SwitchStatement)) {
		start = start.getParent();
	}
	if (start instanceof ForStatement) {
		stmt = ((ForStatement) start).getBody();
	} else if (start instanceof DoStatement) {
		stmt = ((DoStatement) start).getBody();
	} else if (start instanceof WhileStatement) {
		stmt = ((WhileStatement) start).getBody();
	} else if (start instanceof EnhancedForStatement) {
		stmt = ((EnhancedForStatement) start).getBody();
	}
	if (start != null && start.getParent() instanceof LabeledStatement) {
		LabeledStatement labeledStatement = (LabeledStatement) start.getParent();
		fEnclosingLoopLabel = labeledStatement.getLabel();
	}
	return stmt;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:22,代码来源:ExtractMethodAnalyzer.java

示例2: getParentLoopBody

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
private Statement getParentLoopBody(ASTNode node) {
  Statement stmt = null;
  ASTNode start = node;
  while (start != null
      && !(start instanceof ForStatement)
      && !(start instanceof DoStatement)
      && !(start instanceof WhileStatement)
      && !(start instanceof EnhancedForStatement)
      && !(start instanceof SwitchStatement)) {
    start = start.getParent();
  }
  if (start instanceof ForStatement) {
    stmt = ((ForStatement) start).getBody();
  } else if (start instanceof DoStatement) {
    stmt = ((DoStatement) start).getBody();
  } else if (start instanceof WhileStatement) {
    stmt = ((WhileStatement) start).getBody();
  } else if (start instanceof EnhancedForStatement) {
    stmt = ((EnhancedForStatement) start).getBody();
  }
  if (start != null && start.getParent() instanceof LabeledStatement) {
    LabeledStatement labeledStatement = (LabeledStatement) start.getParent();
    fEnclosingLoopLabel = labeledStatement.getLabel();
  }
  return stmt;
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:ExtractMethodAnalyzer.java

示例3: getParentLoopBody

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
private Statement getParentLoopBody(ASTNode node) {
	Statement stmt= null;
	ASTNode start= node;
	while (start != null
			&& !(start instanceof ForStatement)
			&& !(start instanceof DoStatement)
			&& !(start instanceof WhileStatement)
			&& !(start instanceof EnhancedForStatement)
			&& !(start instanceof SwitchStatement)) {
		start= start.getParent();
	}
	if (start instanceof ForStatement) {
		stmt= ((ForStatement)start).getBody();
	} else if (start instanceof DoStatement) {
		stmt= ((DoStatement)start).getBody();
	} else if (start instanceof WhileStatement) {
		stmt= ((WhileStatement)start).getBody();
	} else if (start instanceof EnhancedForStatement) {
		stmt= ((EnhancedForStatement)start).getBody();
	}
	if (start != null && start.getParent() instanceof LabeledStatement) {
		LabeledStatement labeledStatement= (LabeledStatement)start.getParent();
		fEnclosingLoopLabel= labeledStatement.getLabel();
	}
	return stmt;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:ExtractMethodAnalyzer.java

示例4: keepWalkingUp

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
private boolean keepWalkingUp(ASTNode node) {
	if (node == null)
		return false;
	if (isAnyInstanceOf(STOPPERS, node))
		return false;
	if (fLabel != null && LabeledStatement.class.isInstance(node)){
		LabeledStatement ls= (LabeledStatement)node;
		return ! areEqualLabels(ls.getLabel(), fLabel);
	}
	if (fLabel == null) {
		if (isAnyInstanceOf(fIsBreak ? BREAKTARGETS : CONTINUETARGETS, node))
			return node.getParent() instanceof LabeledStatement; // for behavior consistency of break targets: see bug 339176
		if (node instanceof LabeledStatement)
			return false;
	}
	return true;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:BreakContinueTargetFinder.java

示例5: visit

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
@Override
public boolean visit(LabeledStatement node) {
	if (fDefiningLabel == null) {
		SimpleName label= node.getLabel();
		if (fLabel == label || isSameLabel(label) && ASTNodes.isParent(fLabel, node)) {
			fDefiningLabel= node;
			fResult.add(label);
		}
	}
	node.getBody().accept(this);
	return false;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:13,代码来源:LinkedNodeFinder.java

示例6: endVisit

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
@Override
public void endVisit(LabeledStatement node) {
	if (skipNode(node)) {
		return;
	}
	FlowInfo info = assignFlowInfo(node, node.getBody());
	if (info != null) {
		info.removeLabel(node.getLabel());
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:11,代码来源:FlowAnalyzer.java

示例7: visit

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
@Override
public boolean visit(LabeledStatement node) {
  if (fDefiningLabel == null) {
    SimpleName label = node.getLabel();
    if (fLabel == label || isSameLabel(label) && ASTNodes.isParent(fLabel, node)) {
      fDefiningLabel = node;
      fResult.add(label);
    }
  }
  node.getBody().accept(this);
  return false;
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:LinkedNodeFinder.java

示例8: isDangligIf

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
public boolean isDangligIf() {
  List<Statement> statements = fDeclaration.getBody().statements();
  if (statements.size() != 1) return false;

  ASTNode p = statements.get(0);

  while (true) {
    if (p instanceof IfStatement) {
      return ((IfStatement) p).getElseStatement() == null;
    } else {

      ChildPropertyDescriptor childD;
      if (p instanceof WhileStatement) {
        childD = WhileStatement.BODY_PROPERTY;
      } else if (p instanceof ForStatement) {
        childD = ForStatement.BODY_PROPERTY;
      } else if (p instanceof EnhancedForStatement) {
        childD = EnhancedForStatement.BODY_PROPERTY;
      } else if (p instanceof DoStatement) {
        childD = DoStatement.BODY_PROPERTY;
      } else if (p instanceof LabeledStatement) {
        childD = LabeledStatement.BODY_PROPERTY;
      } else {
        return false;
      }
      Statement body = (Statement) p.getStructuralProperty(childD);
      if (body instanceof Block) {
        return false;
      } else {
        p = body;
      }
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:35,代码来源:SourceProvider.java

示例9: isDangligIf

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
public boolean isDangligIf() {
	List<Statement> statements= fDeclaration.getBody().statements();
	if (statements.size() != 1)
		return false;

	ASTNode p= statements.get(0);

	while (true) {
		if (p instanceof IfStatement) {
			return ((IfStatement) p).getElseStatement() == null;
		} else {

			ChildPropertyDescriptor childD;
			if (p instanceof WhileStatement) {
				childD= WhileStatement.BODY_PROPERTY;
			} else if (p instanceof ForStatement) {
				childD= ForStatement.BODY_PROPERTY;
			} else if (p instanceof EnhancedForStatement) {
				childD= EnhancedForStatement.BODY_PROPERTY;
			} else if (p instanceof DoStatement) {
				childD= DoStatement.BODY_PROPERTY;
			} else if (p instanceof LabeledStatement) {
				childD= LabeledStatement.BODY_PROPERTY;
			} else {
				return false;
			}
			Statement body= (Statement) p.getStructuralProperty(childD);
			if (body instanceof Block) {
				return false;
			} else {
				p= body;
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:36,代码来源:SourceProvider.java

示例10: endVisit

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
@Override
public void endVisit(LabeledStatement node) {
	if (skipNode(node))
		return;
	FlowInfo info= assignFlowInfo(node, node.getBody());
	if (info != null)
		info.removeLabel(node.getLabel());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:FlowAnalyzer.java

示例11: visit

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
@Override
public boolean visit(LabeledStatement node) {
	node.getLabel().accept(this);
	this.fBuffer.append(": ");//$NON-NLS-1$
	node.getBody().accept(this);
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:8,代码来源:ASTFlattener.java

示例12: visit

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
public boolean visit(LabeledStatement node) {
	printIndent();
	node.getLabel().accept(this);
	this.buffer.append(": ");//$NON-NLS-1$
	node.getBody().accept(this);
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:8,代码来源:NaiveASTFlattener.java

示例13: visit

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
/**
 * Labeled statement.
 * 
 * identifier ':' statement
 */
@Override
public boolean visit(final LabeledStatement node)
{
  // visit children
  return true;
}
 
开发者ID:UBPL,项目名称:jive,代码行数:12,代码来源:StatementVisitor.java

示例14: visit

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
@Override
public boolean visit(LabeledStatement node) {
	//System.out.println("Found: " + node.getClass());
	int oldIndent = indent;
	indent = 0;
	node.getLabel().accept(this);
	println(":");
	indent = oldIndent;
	node.getBody().accept(this);
	return false;
}
 
开发者ID:mrmonday,项目名称:j2d,代码行数:12,代码来源:J2dVisitor.java

示例15: DOMLabeledStatement

import org.eclipse.jdt.core.dom.LabeledStatement; //导入依赖的package包/类
public DOMLabeledStatement(LabeledStatement statement) {
    this.statement = statement;
}
 
开发者ID:capergroup,项目名称:bayou,代码行数:4,代码来源:DOMLabeledStatement.java


注:本文中的org.eclipse.jdt.core.dom.LabeledStatement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。