1 /*
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
3 * @LastModified: Oct 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 * $Id: AttributeValueTemplate.java,v 1.2.4.1 2005/09/01 10:26:57 pvedula Exp $
23 */
26
27 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
28 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
29 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
30 import com.sun.org.apache.bcel.internal.generic.Instruction;
31 import com.sun.org.apache.bcel.internal.generic.InstructionList;
32 import com.sun.org.apache.bcel.internal.generic.NEW;
33 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
34 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
35 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
36 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
37 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
38 import java.util.Iterator;
39 import java.util.List;
40 import java.util.NoSuchElementException;
41 import java.util.StringTokenizer;
42
43 /**
44 * @author Jacek Ambroziak
45 * @author Santiago Pericas-Geertsen
46 */
47 final class AttributeValueTemplate extends AttributeValue {
48
49 final static int OUT_EXPR = 0;
50 final static int IN_EXPR = 1;
51 final static int IN_EXPR_SQUOTES = 2;
52 final static int IN_EXPR_DQUOTES = 3;
53 final static String DELIMITER = "\uFFFE"; // A Unicode nonchar
54
55 public AttributeValueTemplate(String value, Parser parser,
56 SyntaxTreeNode parent)
57 {
58 setParent(parent);
59 setParser(parser);
60
61 try {
62 parseAVTemplate(value, parser);
63 }
64 catch (NoSuchElementException e) {
65 reportError(parent, parser,
|
1 /*
2 * Copyright (c) 2015, 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 * $Id: AttributeValueTemplate.java,v 1.2.4.1 2005/09/01 10:26:57 pvedula Exp $
22 */
25
26 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
27 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
28 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
29 import com.sun.org.apache.bcel.internal.generic.Instruction;
30 import com.sun.org.apache.bcel.internal.generic.InstructionList;
31 import com.sun.org.apache.bcel.internal.generic.NEW;
32 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
33 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
34 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
35 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
36 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
37 import java.util.Iterator;
38 import java.util.List;
39 import java.util.NoSuchElementException;
40 import java.util.StringTokenizer;
41
42 /**
43 * @author Jacek Ambroziak
44 * @author Santiago Pericas-Geertsen
45 * @LastModified: Oct 2017
46 */
47 final class AttributeValueTemplate extends AttributeValue {
48
49 final static int OUT_EXPR = 0;
50 final static int IN_EXPR = 1;
51 final static int IN_EXPR_SQUOTES = 2;
52 final static int IN_EXPR_DQUOTES = 3;
53 final static String DELIMITER = "\uFFFE"; // A Unicode nonchar
54
55 public AttributeValueTemplate(String value, Parser parser,
56 SyntaxTreeNode parent)
57 {
58 setParent(parent);
59 setParser(parser);
60
61 try {
62 parseAVTemplate(value, parser);
63 }
64 catch (NoSuchElementException e) {
65 reportError(parent, parser,
|