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: TestSeq.java,v 1.2.4.1 2005/09/12 11:31:38 pvedula Exp $
23 */
174 * Returns, by reference, the templates that are included in
175 * this test sequence. Note that a single template can occur
176 * in several test sequences if its pattern is a union.
177 */
178 public void findTemplates(Map<Template, Object> templates) {
179 if (_default != null) {
180 templates.put(_default, this);
181 }
182 for (LocationPathPattern pattern : _patterns) {
183 templates.put(pattern.getTemplate(), this);
184 }
185 }
186
187 /**
188 * Get the instruction handle to a template's code. This is
189 * used when a single template occurs in several test
190 * sequences; that is, if its pattern is a union of patterns
191 * (e.g. match="A/B | A/C").
192 */
193 private InstructionHandle getTemplateHandle(Template template) {
194 return (InstructionHandle)_mode.getTemplateInstructionHandle(template);
195 }
196
197 /**
198 * Returns pattern n in this test sequence
199 */
200 private LocationPathPattern getPattern(int n) {
201 return _patterns.get(n);
202 }
203
204 /**
205 * Compile the code for this test sequence. Compile patterns
206 * from highest to lowest priority. Note that since patterns
207 * can be share by multiple test sequences, instruction lists
208 * must be copied before backpatching.
209 */
210 public InstructionHandle compile(ClassGenerator classGen,
211 MethodGenerator methodGen,
212 InstructionHandle continuation)
213 {
214 // Returned cached value if already compiled
|
1 /*
2 * Copyright (c) 2015, 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 * $Id: TestSeq.java,v 1.2.4.1 2005/09/12 11:31:38 pvedula Exp $
23 */
174 * Returns, by reference, the templates that are included in
175 * this test sequence. Note that a single template can occur
176 * in several test sequences if its pattern is a union.
177 */
178 public void findTemplates(Map<Template, Object> templates) {
179 if (_default != null) {
180 templates.put(_default, this);
181 }
182 for (LocationPathPattern pattern : _patterns) {
183 templates.put(pattern.getTemplate(), this);
184 }
185 }
186
187 /**
188 * Get the instruction handle to a template's code. This is
189 * used when a single template occurs in several test
190 * sequences; that is, if its pattern is a union of patterns
191 * (e.g. match="A/B | A/C").
192 */
193 private InstructionHandle getTemplateHandle(Template template) {
194 return _mode.getTemplateInstructionHandle(template);
195 }
196
197 /**
198 * Returns pattern n in this test sequence
199 */
200 private LocationPathPattern getPattern(int n) {
201 return _patterns.get(n);
202 }
203
204 /**
205 * Compile the code for this test sequence. Compile patterns
206 * from highest to lowest priority. Note that since patterns
207 * can be share by multiple test sequences, instruction lists
208 * must be copied before backpatching.
209 */
210 public InstructionHandle compile(ClassGenerator classGen,
211 MethodGenerator methodGen,
212 InstructionHandle continuation)
213 {
214 // Returned cached value if already compiled
|