本文整理汇总了Java中com.puppycrawl.tools.checkstyle.api.TokenTypes.ELIST属性的典型用法代码示例。如果您正苦于以下问题:Java TokenTypes.ELIST属性的具体用法?Java TokenTypes.ELIST怎么用?Java TokenTypes.ELIST使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.puppycrawl.tools.checkstyle.api.TokenTypes
的用法示例。
在下文中一共展示了TokenTypes.ELIST属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newIsConstructor
private boolean newIsConstructor(SymTabAST newNode) {
boolean result = false;
SymTabAST typeNode =
(SymTabAST) (newNode.getFirstChild().getNextSibling());
//handle Checkstyle grammar
if (typeNode.getType() == TokenTypes.LPAREN) {
typeNode = (SymTabAST) typeNode.getNextSibling();
}
if (typeNode.getType() == TokenTypes.ELIST) {
result = true;
}
return result;
}
示例2: handleFor
/**
* processes a for loop and resolves references in it
*
* @param block the <code>BlockDef</code> to process
*/
private void handleFor(BlockDef block) {
SymTabAST node = block.getTreeNode();
SymTabAST body;
SymTabAST forEach = node.findFirstToken(TokenTypes.FOR_EACH_CLAUSE);
if (forEach == null) {
SymTabAST init = node.findFirstToken(TokenTypes.FOR_INIT);
// only need to handle the elist case. if the init node is a variable
// definition, the variable def will be handled later on in the resolution
if (init.getFirstChild() != null) {
if (init.getFirstChild().getType() == TokenTypes.ELIST) {
resolveExpression(
(SymTabAST) (init.getFirstChild()),
block,
null,
true);
}
}
SymTabAST cond = node.findFirstToken(TokenTypes.FOR_CONDITION);
if (cond.getFirstChild() != null) {
resolveExpression(
(SymTabAST) (cond.getFirstChild()),
block,
null,
true);
}
SymTabAST iterator = node.findFirstToken(TokenTypes.FOR_ITERATOR);
if (iterator.getFirstChild() != null) {
resolveExpression(
(SymTabAST) (iterator.getFirstChild()),
block,
null,
true);
}
body = (SymTabAST) (iterator.getNextSibling());
}
else {
resolveExpression(
(forEach.findFirstToken(TokenTypes.EXPR)),
block,
null,
true);
body = (SymTabAST) (forEach.getNextSibling());
}
//could be an SLIST, EXPR or an EMPTY_STAT
if (body.getType() == TokenTypes.RPAREN) {
body = (SymTabAST) body.getNextSibling();
}
if (body.getType() == TokenTypes.SLIST) {
handleSList(body, block);
}
else {
resolveExpression(body, block, null, true);
}
}
示例3: isPassedInParameter
/**
* Checks if logical operator is part of constructor or method call.
* @param logicalOperator logical operator
* @return true if logical operator is part of constructor or method call
*/
private static boolean isPassedInParameter(DetailAST logicalOperator) {
return logicalOperator.getParent().getType() == TokenTypes.EXPR
&& logicalOperator.getParent().getParent().getType() == TokenTypes.ELIST;
}