com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType Java Examples
The following examples show how to use
com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType.
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 File: FilterExpr.java From jdk8u60 with GNU General Public License v2.0 | 6 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 where $x is a parameter reference. * All optimizations are turned off before type checking underlying * predicates. */ public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.elementAt(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
Example #2
Source File: Expression.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * If this expression is of type node-set and it is not a variable * reference, then call setStartNode() passing the context node. */ public void startIterator(ClassGenerator classGen, MethodGenerator methodGen) { // Ignore if type is not node-set if (_type instanceof NodeSetType == false) { return; } // setStartNode() should not be called if expr is a variable ref Expression expr = this; if (expr instanceof CastExpr) { expr = ((CastExpr) expr).getExpr(); } if (expr instanceof VariableRefBase == false) { final InstructionList il = methodGen.getInstructionList(); il.append(methodGen.loadContextNode()); il.append(methodGen.setStartNode()); } }
Example #3
Source File: FilterExpr.java From TencentKona-8 with GNU General Public License v2.0 | 6 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 where $x is a parameter reference. * All optimizations are turned off before type checking underlying * predicates. */ public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.elementAt(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
Example #4
Source File: ApplyTemplates.java From TencentKona-8 with 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 #5
Source File: FilterExpr.java From Bytecoder with Apache License 2.0 | 6 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 where $x is a parameter reference. * All optimizations are turned off before type checking underlying * predicates. */ public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.get(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
Example #6
Source File: ApplyTemplates.java From Bytecoder with 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 #7
Source File: FilterExpr.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 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 where $x is a parameter reference. * All optimizations are turned off before type checking underlying * predicates. */ public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.elementAt(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
Example #8
Source File: Expression.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * If this expression is of type node-set and it is not a variable * reference, then call setStartNode() passing the context node. */ public void startIterator(ClassGenerator classGen, MethodGenerator methodGen) { // Ignore if type is not node-set if (_type instanceof NodeSetType == false) { return; } // setStartNode() should not be called if expr is a variable ref Expression expr = this; if (expr instanceof CastExpr) { expr = ((CastExpr) expr).getExpr(); } if (expr instanceof VariableRefBase == false) { final InstructionList il = methodGen.getInstructionList(); il.append(methodGen.loadContextNode()); il.append(methodGen.setStartNode()); } }
Example #9
Source File: ApplyTemplates.java From jdk8u60 with 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 File: ApplyTemplates.java From openjdk-jdk8u-backup with 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 #11
Source File: Expression.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * If this expression is of type node-set and it is not a variable * reference, then call setStartNode() passing the context node. */ public void startIterator(ClassGenerator classGen, MethodGenerator methodGen) { // Ignore if type is not node-set if (_type instanceof NodeSetType == false) { return; } // setStartNode() should not be called if expr is a variable ref Expression expr = this; if (expr instanceof CastExpr) { expr = ((CastExpr) expr).getExpr(); } if (expr instanceof VariableRefBase == false) { final InstructionList il = methodGen.getInstructionList(); il.append(methodGen.loadContextNode()); il.append(methodGen.setStartNode()); } }
Example #12
Source File: FilterExpr.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 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 where $x is a parameter reference. * All optimizations are turned off before type checking underlying * predicates. */ public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.elementAt(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
Example #13
Source File: FilterExpr.java From JDKSourceCode1.8 with MIT License | 6 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 where $x is a parameter reference. * All optimizations are turned off before type checking underlying * predicates. */ public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.elementAt(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
Example #14
Source File: Expression.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
/** * If this expression is of type node-set and it is not a variable * reference, then call setStartNode() passing the context node. */ public void startIterator(ClassGenerator classGen, MethodGenerator methodGen) { // Ignore if type is not node-set if (_type instanceof NodeSetType == false) { return; } // setStartNode() should not be called if expr is a variable ref Expression expr = this; if (expr instanceof CastExpr) { expr = ((CastExpr) expr).getExpr(); } if (expr instanceof VariableRefBase == false) { final InstructionList il = methodGen.getInstructionList(); il.append(methodGen.loadContextNode()); il.append(methodGen.setStartNode()); } }
Example #15
Source File: FilterExpr.java From jdk1.8-source-analysis with Apache License 2.0 | 6 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 where $x is a parameter reference. * All optimizations are turned off before type checking underlying * predicates. */ public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.elementAt(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
Example #16
Source File: Expression.java From JDKSourceCode1.8 with MIT License | 6 votes |
/** * If this expression is of type node-set and it is not a variable * reference, then call setStartNode() passing the context node. */ public void startIterator(ClassGenerator classGen, MethodGenerator methodGen) { // Ignore if type is not node-set if (_type instanceof NodeSetType == false) { return; } // setStartNode() should not be called if expr is a variable ref Expression expr = this; if (expr instanceof CastExpr) { expr = ((CastExpr) expr).getExpr(); } if (expr instanceof VariableRefBase == false) { final InstructionList il = methodGen.getInstructionList(); il.append(methodGen.loadContextNode()); il.append(methodGen.setStartNode()); } }
Example #17
Source File: Expression.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * If this expression is of type node-set and it is not a variable * reference, then call setStartNode() passing the context node. */ public void startIterator(ClassGenerator classGen, MethodGenerator methodGen) { // Ignore if type is not node-set if (_type instanceof NodeSetType == false) { return; } // setStartNode() should not be called if expr is a variable ref Expression expr = this; if (expr instanceof CastExpr) { expr = ((CastExpr) expr).getExpr(); } if (expr instanceof VariableRefBase == false) { final InstructionList il = methodGen.getInstructionList(); il.append(methodGen.loadContextNode()); il.append(methodGen.setStartNode()); } }
Example #18
Source File: Expression.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * If this expression is of type node-set and it is not a variable * reference, then call setStartNode() passing the context node. */ public void startIterator(ClassGenerator classGen, MethodGenerator methodGen) { // Ignore if type is not node-set if (_type instanceof NodeSetType == false) { return; } // setStartNode() should not be called if expr is a variable ref Expression expr = this; if (expr instanceof CastExpr) { expr = ((CastExpr) expr).getExpr(); } if (expr instanceof VariableRefBase == false) { final InstructionList il = methodGen.getInstructionList(); il.append(methodGen.loadContextNode()); il.append(methodGen.setStartNode()); } }
Example #19
Source File: FilterParentPath.java From JDKSourceCode1.8 with MIT License | 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 File: ForEach.java From JDKSourceCode1.8 with MIT License | 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 #21
Source File: FilterParentPath.java From openjdk-jdk8u with 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 #22
Source File: CopyOf.java From openjdk-jdk8u with 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 #23
Source File: CopyOf.java From Bytecoder with 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 #24
Source File: CopyOf.java From openjdk-jdk9 with 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 #25
Source File: CopyOf.java From JDKSourceCode1.8 with MIT License | 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 #26
Source File: Key.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type check match pattern _match.typeCheck(stable); // Cast node values to string values (except for nodesets) _useType = _use.typeCheck(stable); if (_useType instanceof StringType == false && _useType instanceof NodeSetType == false) { _use = new CastExpr(_use, Type.String); } return Type.Void; }
Example #27
Source File: Key.java From JDKSourceCode1.8 with MIT License | 5 votes |
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type check match pattern _match.typeCheck(stable); // Cast node values to string values (except for nodesets) _useType = _use.typeCheck(stable); if (_useType instanceof StringType == false && _useType instanceof NodeSetType == false) { _use = new CastExpr(_use, Type.String); } return Type.Void; }
Example #28
Source File: CopyOf.java From jdk8u60 with 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 #29
Source File: ForEach.java From openjdk-jdk8u-backup with 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 #30
Source File: FilterParentPath.java From openjdk-jdk9 with 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; }