com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType Java Examples
The following examples show how to use
com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: jdk1.8-source-analysis Author: raysonfang File: ApplyTemplates.java License: Apache License 2.0 | 6 votes |
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; } }
Example #2
Source Project: jdk1.8-source-analysis Author: raysonfang File: CastExpr.java License: Apache License 2.0 | 6 votes |
/** * 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())); }
Example #3
Source Project: TencentKona-8 Author: Tencent File: ApplyTemplates.java License: GNU General Public License v2.0 | 6 votes |
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; } }
Example #4
Source Project: TencentKona-8 Author: Tencent File: CastExpr.java License: GNU General Public License v2.0 | 6 votes |
/** * 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())); }
Example #5
Source Project: openjdk-jdk9 Author: AdoptOpenJDK File: ApplyTemplates.java License: GNU General Public License v2.0 | 6 votes |
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; } }
Example #6
Source Project: jdk8u60 Author: chenghanpeng File: CastExpr.java License: GNU General Public License v2.0 | 6 votes |
/** * 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())); }
Example #7
Source Project: openjdk-jdk9 Author: AdoptOpenJDK File: CastExpr.java License: GNU General Public License v2.0 | 6 votes |
/** * 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())); }
Example #8
Source Project: JDKSourceCode1.8 Author: wupeixuan File: CastExpr.java License: MIT License | 6 votes |
/** * 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())); }
Example #9
Source Project: openjdk-jdk8u Author: AdoptOpenJDK File: ApplyTemplates.java License: GNU General Public License v2.0 | 6 votes |
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; } }
Example #10
Source Project: openjdk-jdk8u Author: AdoptOpenJDK File: CastExpr.java License: GNU General Public License v2.0 | 6 votes |
/** * 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())); }
Example #11
Source Project: openjdk-jdk8u-backup Author: AdoptOpenJDK File: ApplyTemplates.java License: GNU General Public License v2.0 | 6 votes |
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; } }
Example #12
Source Project: openjdk-jdk8u-backup Author: AdoptOpenJDK File: CastExpr.java License: GNU General Public License v2.0 | 6 votes |
/** * 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())); }
Example #13
Source Project: Bytecoder Author: mirkosertic File: ApplyTemplates.java License: Apache License 2.0 | 6 votes |
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; } }
Example #14
Source Project: Bytecoder Author: mirkosertic File: CastExpr.java License: Apache License 2.0 | 6 votes |
/** * 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())); }
Example #15
Source Project: jdk1.8-source-analysis Author: raysonfang File: Variable.java License: Apache License 2.0 | 5 votes |
/** * 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()))); } }
Example #16
Source Project: jdk1.8-source-analysis Author: raysonfang File: ForEach.java License: Apache License 2.0 | 5 votes |
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); }
Example #17
Source Project: jdk1.8-source-analysis Author: raysonfang File: FilteredAbsoluteLocationPath.java License: Apache License 2.0 | 5 votes |
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; }
Example #18
Source Project: jdk1.8-source-analysis Author: raysonfang File: AbsoluteLocationPath.java License: Apache License 2.0 | 5 votes |
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; }
Example #19
Source Project: jdk1.8-source-analysis Author: raysonfang File: FilterParentPath.java License: Apache License 2.0 | 5 votes |
/** * 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; }
Example #20
Source Project: jdk1.8-source-analysis Author: raysonfang File: CopyOf.java License: Apache License 2.0 | 5 votes |
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; }
Example #21
Source Project: TencentKona-8 Author: Tencent File: Variable.java License: GNU General Public License v2.0 | 5 votes |
/** * 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()))); } }
Example #22
Source Project: TencentKona-8 Author: Tencent File: ForEach.java License: GNU General Public License v2.0 | 5 votes |
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); }
Example #23
Source Project: TencentKona-8 Author: Tencent File: FilteredAbsoluteLocationPath.java License: GNU General Public License v2.0 | 5 votes |
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; }
Example #24
Source Project: TencentKona-8 Author: Tencent File: AbsoluteLocationPath.java License: GNU General Public License v2.0 | 5 votes |
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; }
Example #25
Source Project: TencentKona-8 Author: Tencent File: FilterParentPath.java License: GNU General Public License v2.0 | 5 votes |
/** * 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; }
Example #26
Source Project: TencentKona-8 Author: Tencent File: CopyOf.java License: GNU General Public License v2.0 | 5 votes |
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; }
Example #27
Source Project: jdk8u60 Author: chenghanpeng File: ForEach.java License: GNU General Public License v2.0 | 5 votes |
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); }
Example #28
Source Project: jdk8u60 Author: chenghanpeng File: FilteredAbsoluteLocationPath.java License: GNU General Public License v2.0 | 5 votes |
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; }
Example #29
Source Project: jdk8u60 Author: chenghanpeng File: AbsoluteLocationPath.java License: GNU General Public License v2.0 | 5 votes |
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; }
Example #30
Source Project: jdk8u60 Author: chenghanpeng File: CopyOf.java License: GNU General Public License v2.0 | 5 votes |
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; }