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


Java Token.TRUE属性代码示例

本文整理汇总了Java中org.mozilla.javascript.Token.TRUE属性的典型用法代码示例。如果您正苦于以下问题:Java Token.TRUE属性的具体用法?Java Token.TRUE怎么用?Java Token.TRUE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.mozilla.javascript.Token的用法示例。


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

示例1: toSource

@Override
public String toSource(int depth) {
    StringBuilder sb = new StringBuilder();
    sb.append(makeIndent(depth));
    switch (getType()) {
    case Token.THIS:
        sb.append("this");
        break;
    case Token.NULL:
        sb.append("null");
        break;
    case Token.TRUE:
        sb.append("true");
        break;
    case Token.FALSE:
        sb.append("false");
        break;
    case Token.DEBUGGER:
        sb.append("debugger;\n");
        break;
    default:
        throw new IllegalStateException("Invalid keyword literal type: "
                                        + getType());
    }
    return sb.toString();
}
 
开发者ID:MikaGuraN,项目名称:HL4A,代码行数:26,代码来源:KeywordLiteral.java

示例2: toSource

@Override
public String toSource(int depth) {
    StringBuilder sb = new StringBuilder();
    sb.append(makeIndent(depth));
    switch (getType()) {
    case Token.THIS:
        sb.append("this");
        break;
    case Token.NULL:
        sb.append("null");
        break;
    case Token.TRUE:
        sb.append("true");
        break;
    case Token.FALSE:
        sb.append("false");
        break;
    case Token.DEBUGGER:
        sb.append("debugger");
        break;
    default:
        throw new IllegalStateException("Invalid keyword literal type: "
                                        + getType());
    }
    return sb.toString();
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:26,代码来源:KeywordLiteral.java

示例3: setType

/**
 * Sets node token type
 * @throws IllegalArgumentException if {@code nodeType} is unsupported
 */
@Override
public KeywordLiteral setType(int nodeType) {
    if (!(nodeType == Token.THIS
          || nodeType == Token.NULL
          || nodeType == Token.TRUE
          || nodeType == Token.FALSE
          || nodeType == Token.DEBUGGER))
        throw new IllegalArgumentException("Invalid node type: "
                                           + nodeType);
    type = nodeType;
    return this;
}
 
开发者ID:MikaGuraN,项目名称:HL4A,代码行数:16,代码来源:KeywordLiteral.java

示例4: processChild

/**
 * process child node
 * 
 * @param parent
 * @param child
 * @param tree
 * @param columnExprList
 * @throws BirtException
 */
private void processChild( Node child, ScriptNode tree,
		List columnExprList ) throws BirtException
{
	switch ( child.getType( ) )
	{
		case Token.NUMBER :
		case Token.STRING :
		case Token.NULL :
		case Token.TRUE :
		case Token.FALSE :
			break;

		case Token.GETPROP :
		case Token.GETELEM :
		case Token.SETPROP :
		case Token.SETELEM :
		{
			compileDirectColRefExpr( child, tree, columnExprList );
			break;
		}
		case Token.CALL :
			compileAggregateExpr( child, tree, columnExprList );
			break;
		default :
			compileComplexExpr( child, tree, columnExprList );
	}

}
 
开发者ID:eclipse,项目名称:birt,代码行数:37,代码来源:ExpressionParserUtility.java

示例5: compileComplexExpr

/**
 * compile the complex expression
 * 
 * @param complexNode
 * @throws BirtException
 */
private void compileComplexExpr( Node complexNode, ScriptNode tree,
		List columnExprList ) throws BirtException
{
	Node child = complexNode.getFirstChild( );
	while ( child != null )
	{
		if ( child.getType( ) == Token.FUNCTION )
		{
			int index = getFunctionIndex( child.getString( ), tree );
			compileFunctionNode( tree.getFunctionNode( index ),
					tree,
					columnExprList );
		}
		// keep reference to next child, since subsequent steps could
		// lose
		// the reference to it
		Node nextChild = child.getNext( );

		// do not include constants into the sub-expression list
		if ( child.getType( ) == Token.NUMBER
				|| child.getType( ) == Token.STRING
				|| child.getType( ) == Token.TRUE
				|| child.getType( ) == Token.FALSE
				|| child.getType( ) == Token.NULL )
		{
			processChild( child, tree, columnExprList );
			child = nextChild;
			continue;
		}

		processChild( child, tree, columnExprList );
		child = nextChild;
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:40,代码来源:ExpressionParserUtility.java

示例6: processChild

/**
	 * 
	 * returns the compiled expression from processing a child node
	 * 
	 * @param context
	 * @param customerChecked
	 * @param parent
	 * @param child
	 * @return
	 * @throws DataException
	 */
protected CompiledExpression processChild( Context context,
		boolean customerChecked, Node parent, Node child, Node grandFather )
		throws DataException
{
	CompiledExpression compiledExpr = null;
	switch ( child.getType( ) )
	{
		case Token.NUMBER :
			compiledExpr = new ConstantExpression( child.getDouble( ) );
			break;

		case Token.STRING :
			compiledExpr = new ConstantExpression( child.getString( ) );
			break;

		case Token.NULL :
			compiledExpr = new ConstantExpression( );
			break;

		case Token.TRUE :
			compiledExpr = new ConstantExpression( true );
			break;

		case Token.FALSE :
			compiledExpr = new ConstantExpression( false );
			break;

		case Token.GETPROP :
		{
			ConstantExpression ce = AggregationConstantsUtil.getConstantExpression( child );
			if ( ce != null )
			{
				compiledExpr = ce;
				break;
			}
		}

		case Token.GETELEM :
			compiledExpr = compileDirectColRefExpr( parent,
					child,
					grandFather,
					customerChecked,
					context );
			break;

		case Token.CALL :
		{
			compiledExpr = compileAggregateExpr( context, parent, child );
			break;
		}
	}
	if ( compiledExpr == null )
		compiledExpr = compileComplexExpr( context, child, customerChecked );
	return compiledExpr;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:66,代码来源:AbstractExpressionCompiler.java

示例7: isBooleanLiteral

/**
 * Returns true if the token type is {@link Token#TRUE} or
 * {@link Token#FALSE}.
 */
public boolean isBooleanLiteral() {
    return type == Token.TRUE || type == Token.FALSE;
}
 
开发者ID:MikaGuraN,项目名称:HL4A,代码行数:7,代码来源:KeywordLiteral.java


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