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


Java TokenTypes.ELIST属性代码示例

本文整理汇总了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;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:Resolver.java

示例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);
    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:63,代码来源:Resolver.java

示例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;
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:9,代码来源:BooleanExpressionComplexityCheck.java


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