1 /* |
1 /* |
2 * reserved comment block |
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT REMOVE OR ALTER! |
3 * @LastModified: Oct 2017 |
4 */ |
4 */ |
5 /* |
5 /* |
6 * Licensed to the Apache Software Foundation (ASF) under one or more |
6 * Licensed to the Apache Software Foundation (ASF) under one or more |
7 * contributor license agreements. See the NOTICE file distributed with |
7 * contributor license agreements. See the NOTICE file distributed with |
8 * this work for additional information regarding copyright ownership. |
8 * this work for additional information regarding copyright ownership. |
19 * limitations under the License. |
19 * limitations under the License. |
20 */ |
20 */ |
21 |
21 |
22 package com.sun.org.apache.xalan.internal.xsltc.compiler; |
22 package com.sun.org.apache.xalan.internal.xsltc.compiler; |
23 |
23 |
24 import java.util.Vector; |
|
25 |
|
26 import com.sun.org.apache.bcel.internal.generic.ALOAD; |
24 import com.sun.org.apache.bcel.internal.generic.ALOAD; |
27 import com.sun.org.apache.bcel.internal.generic.ASTORE; |
25 import com.sun.org.apache.bcel.internal.generic.ASTORE; |
28 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen; |
26 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen; |
29 import com.sun.org.apache.bcel.internal.generic.ILOAD; |
27 import com.sun.org.apache.bcel.internal.generic.ILOAD; |
30 import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE; |
|
31 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; |
28 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; |
32 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC; |
29 import com.sun.org.apache.bcel.internal.generic.ISTORE; |
33 import com.sun.org.apache.bcel.internal.generic.InstructionList; |
30 import com.sun.org.apache.bcel.internal.generic.InstructionList; |
34 import com.sun.org.apache.bcel.internal.generic.ISTORE; |
|
35 import com.sun.org.apache.bcel.internal.generic.LocalVariableGen; |
31 import com.sun.org.apache.bcel.internal.generic.LocalVariableGen; |
36 import com.sun.org.apache.bcel.internal.generic.NEW; |
32 import com.sun.org.apache.bcel.internal.generic.NEW; |
37 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator; |
33 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator; |
38 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator; |
34 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator; |
39 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType; |
35 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType; |
40 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType; |
36 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType; |
41 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type; |
37 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type; |
42 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError; |
38 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError; |
43 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util; |
39 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util; |
|
40 import java.util.List; |
44 |
41 |
45 /** |
42 /** |
46 * @author Jacek Ambroziak |
43 * @author Jacek Ambroziak |
47 * @author Santiago Pericas-Geertsen |
44 * @author Santiago Pericas-Geertsen |
48 * @author Morten Jorgensen |
45 * @author Morten Jorgensen |
55 private Expression _primary; |
52 private Expression _primary; |
56 |
53 |
57 /** |
54 /** |
58 * Array of predicates in '(e)[p1]...[pn]'. |
55 * Array of predicates in '(e)[p1]...[pn]'. |
59 */ |
56 */ |
60 private final Vector _predicates; |
57 private final List<Expression> _predicates; |
61 |
58 |
62 public FilterExpr(Expression primary, Vector predicates) { |
59 public FilterExpr(Expression primary, List<Expression> predicates) { |
63 _primary = primary; |
60 _primary = primary; |
64 _predicates = predicates; |
61 _predicates = predicates; |
65 primary.setParent(this); |
62 primary.setParent(this); |
66 } |
63 } |
67 |
64 |
76 super.setParser(parser); |
73 super.setParser(parser); |
77 _primary.setParser(parser); |
74 _primary.setParser(parser); |
78 if (_predicates != null) { |
75 if (_predicates != null) { |
79 final int n = _predicates.size(); |
76 final int n = _predicates.size(); |
80 for (int i = 0; i < n; i++) { |
77 for (int i = 0; i < n; i++) { |
81 final Expression exp = (Expression)_predicates.elementAt(i); |
78 final Expression exp = (Expression)_predicates.get(i); |
82 exp.setParser(parser); |
79 exp.setParser(parser); |
83 exp.setParent(this); |
80 exp.setParent(this); |
84 } |
81 } |
85 } |
82 } |
86 } |
83 } |