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


Java ErrorMsg.ILLEGAL_ARG_ERR属性代码示例

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


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

示例1: typeCheck

/**
 * Type check the two parameters for this function
 */
public Type typeCheck(SymbolTable stable) throws TypeCheckError {

    // Check that the function was passed exactly two arguments
    if (argumentCount() != 2) {
        throw new TypeCheckError(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this);
    }

    // The first argument must be a String, or cast to a String
    _base = argument(0);
    Type baseType = _base.typeCheck(stable);
    if (baseType != Type.String)
        _base = new CastExpr(_base, Type.String);

    // The second argument must also be a String, or cast to a String
    _token = argument(1);
    Type tokenType = _token.typeCheck(stable);
    if (tokenType != Type.String)
        _token = new CastExpr(_token, Type.String);

    return _type = Type.Boolean;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:ContainsCall.java

示例2: typeCheck

/**
 * Type check the two parameters for this function
 */
public Type typeCheck(SymbolTable stable) throws TypeCheckError {

    // Check that the function was passed exactly two arguments
    if (argumentCount() != 2) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR,
                                    getName(), this);
        throw new TypeCheckError(err);
    }

    // The first argument must be a String, or cast to a String
    _base = argument(0);
    Type baseType = _base.typeCheck(stable);
    if (baseType != Type.String)
        _base = new CastExpr(_base, Type.String);

    // The second argument must also be a String, or cast to a String
    _token = argument(1);
    Type tokenType = _token.typeCheck(stable);
    if (tokenType != Type.String)
        _token = new CastExpr(_token, Type.String);

    return _type = Type.Boolean;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:StartsWithCall.java

示例3: typeCheck

/**
 * Type check the two parameters for this function
 */
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    // Check that the function was passed exactly two arguments
    if (argumentCount() != 2) {
        throw new TypeCheckError(new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR,
                                              getName(), this));
    }

    // The first argument must be a literal String
    Expression exp = argument(0);
    if (exp instanceof LiteralExpr) {
        _className = ((LiteralExpr) exp).getValue();
        _type = Type.newObjectType(_className);
    }
    else {
        throw new TypeCheckError(new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR,
                                              getName(), this));
    }

     // Second argument must be of type reference or object
    _right = argument(1);
    Type tright = _right.typeCheck(stable);
    if (tright != Type.Reference &&
        tright instanceof ObjectType == false)
    {
        throw new TypeCheckError(new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
                                              tright, _type, this));
    }

    return _type;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:CastCall.java

示例4: typeCheck

public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    final int argc = argumentCount();
    if (argc > 1) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this);
        throw new TypeCheckError(err);
    }

    if (argc > 0) {
        argument().typeCheck(stable);
    }
    return _type = Type.String;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:StringCall.java


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