1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 * @LastModified: Nov 2017
4 */
5 /*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements. See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22 package com.sun.org.apache.xalan.internal.xsltc.compiler;
23
37 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
38 import com.sun.org.apache.bcel.internal.generic.InstructionList;
39 import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
40 import com.sun.org.apache.bcel.internal.generic.NEW;
41 import com.sun.org.apache.bcel.internal.generic.PUSH;
42 import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
43 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
44 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MatchGenerator;
45 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
46 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeCounterGenerator;
47 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.RealType;
48 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
49 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
50 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
51 import java.util.ArrayList;
52 import java.util.List;
53
54 /**
55 * @author Jacek Ambroziak
56 * @author Santiago Pericas-Geertsen
57 */
58 final class Number extends Instruction implements Closure {
59 private static final int LEVEL_SINGLE = 0;
60 private static final int LEVEL_MULTIPLE = 1;
61 private static final int LEVEL_ANY = 2;
62
63 static final private String[] ClassNames = {
64 "com.sun.org.apache.xalan.internal.xsltc.dom.SingleNodeCounter", // LEVEL_SINGLE
65 "com.sun.org.apache.xalan.internal.xsltc.dom.MultipleNodeCounter", // LEVEL_MULTIPLE
66 "com.sun.org.apache.xalan.internal.xsltc.dom.AnyNodeCounter" // LEVEL_ANY
67 };
68
69 static final private String[] FieldNames = {
70 "___single_node_counter", // LEVEL_SINGLE
71 "___multiple_node_counter", // LEVEL_MULTIPLE
72 "___any_node_counter" // LEVEL_ANY
73 };
74
75 private Pattern _from = null;
76 private Pattern _count = null;
|
1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 */
4 /*
5 * Licensed to the Apache Software Foundation (ASF) under one or more
6 * contributor license agreements. See the NOTICE file distributed with
7 * this work for additional information regarding copyright ownership.
8 * The ASF licenses this file to You under the Apache License, Version 2.0
9 * (the "License"); you may not use this file except in compliance with
10 * the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21 package com.sun.org.apache.xalan.internal.xsltc.compiler;
22
36 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
37 import com.sun.org.apache.bcel.internal.generic.InstructionList;
38 import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
39 import com.sun.org.apache.bcel.internal.generic.NEW;
40 import com.sun.org.apache.bcel.internal.generic.PUSH;
41 import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
42 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
43 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MatchGenerator;
44 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
45 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeCounterGenerator;
46 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.RealType;
47 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
48 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
49 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
50 import java.util.ArrayList;
51 import java.util.List;
52
53 /**
54 * @author Jacek Ambroziak
55 * @author Santiago Pericas-Geertsen
56 * @LastModified: Nov 2017
57 */
58 final class Number extends Instruction implements Closure {
59 private static final int LEVEL_SINGLE = 0;
60 private static final int LEVEL_MULTIPLE = 1;
61 private static final int LEVEL_ANY = 2;
62
63 static final private String[] ClassNames = {
64 "com.sun.org.apache.xalan.internal.xsltc.dom.SingleNodeCounter", // LEVEL_SINGLE
65 "com.sun.org.apache.xalan.internal.xsltc.dom.MultipleNodeCounter", // LEVEL_MULTIPLE
66 "com.sun.org.apache.xalan.internal.xsltc.dom.AnyNodeCounter" // LEVEL_ANY
67 };
68
69 static final private String[] FieldNames = {
70 "___single_node_counter", // LEVEL_SINGLE
71 "___multiple_node_counter", // LEVEL_MULTIPLE
72 "___any_node_counter" // LEVEL_ANY
73 };
74
75 private Pattern _from = null;
76 private Pattern _count = null;
|