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


Java NodeType类代码示例

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


NodeType类属于com.sun.org.apache.xalan.internal.xsltc.compiler.util包,在下文中一共展示了NodeType类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: typeCheck

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType; //导入依赖的package包/类
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    if (_select != null) {
        _type = _select.typeCheck(stable);
        if (_type instanceof NodeType || _type instanceof ReferenceType) {
            _select = new CastExpr(_select, Type.NodeSet);
            _type = Type.NodeSet;
        }
        if (_type instanceof NodeSetType||_type instanceof ResultTreeType) {
            typeCheckContents(stable); // with-params
            return Type.Void;
        }
        throw new TypeCheckError(this);
    }
    else {
        typeCheckContents(stable);          // with-params
        return Type.Void;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:ApplyTemplates.java

示例2: typeCheck

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType; //导入依赖的package包/类
/**
 * Type checking a cast expression amounts to verifying that the
 * type conversion is legal. Cast expressions are created during
 * type checking, but typeCheck() is usually not called on them.
 * As a result, this method is called from the constructor.
 */
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    Type tleft = _left.getType();
    if (tleft == null) {
        tleft = _left.typeCheck(stable);
    }
    if (tleft instanceof NodeType) {
        tleft = Type.Node;  // multiple instances
    }
    else if (tleft instanceof ResultTreeType) {
        tleft = Type.ResultTree; // multiple instances
    }
    if (InternalTypeMap.maps(tleft, _type) != null) {
        return _type;
    }
    // throw new TypeCheckError(this);
    throw new TypeCheckError(new ErrorMsg(
        ErrorMsg.DATA_CONVERSION_ERR, tleft.toString(), _type.toString()));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:CastExpr.java

示例3: initialize

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType; //导入依赖的package包/类
/**
 * This method is part of a little trick that is needed to use local
 * variables inside nested for-each loops. See the initializeVariables()
 * method in the ForEach class for an explanation
 */
public void initialize(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // This is only done for local variables that are actually used
    if (isLocal() && !_refs.isEmpty()) {
        // Create a variable slot if none is allocated
        if (_local == null) {
            _local = methodGen.addLocalVariable2(getEscapedName(),
                                                 _type.toJCType(),
                                                 null);
        }
        // Push the default value on the JVM's stack
        if ((_type instanceof IntType) ||
            (_type instanceof NodeType) ||
            (_type instanceof BooleanType))
            il.append(new ICONST(0)); // 0 for node-id, integer and boolean
        else if (_type instanceof RealType)
            il.append(new DCONST(0)); // 0.0 for floating point numbers
        else
            il.append(new ACONST_NULL()); // and 'null' for anything else

        // Mark the store as the start of the live range of the variable
        _local.setStart(il.append(_type.STORE(_local.getIndex())));

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

示例4: typeCheck

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType; //导入依赖的package包/类
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    _type = _select.typeCheck(stable);

    if (_type instanceof ReferenceType || _type instanceof NodeType) {
        _select = new CastExpr(_select, Type.NodeSet);
        typeCheckContents(stable);
        return Type.Void;
    }
    if (_type instanceof NodeSetType||_type instanceof ResultTreeType) {
        typeCheckContents(stable);
        return Type.Void;
    }
    throw new TypeCheckError(this);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:ForEach.java

示例5: typeCheck

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType; //导入依赖的package包/类
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    if (_path != null) {
        final Type ptype = _path.typeCheck(stable);
        if (ptype instanceof NodeType) {            // promote to node-set
            _path = new CastExpr(_path, Type.NodeSet);
        }
    }
    return _type = Type.NodeSet;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:FilteredAbsoluteLocationPath.java

示例6: typeCheck

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType; //导入依赖的package包/类
/**
 * Type check a FilterParentPath. If the filter is not a node-set add a
 * cast to node-set only if it is of reference type. This type coercion is
 * needed for expressions like $x/LINE where $x is a parameter reference.
 */
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    final Type ftype = _filterExpr.typeCheck(stable);
    if (ftype instanceof NodeSetType == false) {
        if (ftype instanceof ReferenceType)  {
            _filterExpr = new CastExpr(_filterExpr, Type.NodeSet);
        }
        /*
        else if (ftype instanceof ResultTreeType)  {
            _filterExpr = new CastExpr(_filterExpr, Type.NodeSet);
        }
        */
        else if (ftype instanceof NodeType)  {
            _filterExpr = new CastExpr(_filterExpr, Type.NodeSet);
        }
        else {
            throw new TypeCheckError(this);
        }
    }

    // Wrap single node path in a node set
    final Type ptype = _path.typeCheck(stable);
    if (!(ptype instanceof NodeSetType)) {
        _path = new CastExpr(_path, Type.NodeSet);
    }

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

示例7: typeCheck

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType; //导入依赖的package包/类
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    final Type tselect = _select.typeCheck(stable);
    if (tselect instanceof NodeType ||
        tselect instanceof NodeSetType ||
        tselect instanceof ReferenceType ||
        tselect instanceof ResultTreeType) {
        // falls through
    }
    else {
        _select = new CastExpr(_select, Type.String);
    }
    return Type.Void;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:CopyOf.java


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