286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 2001-2004 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * A test sequence is a sequence of patterns that 286N/A * (1) occured in templates in the same mode 286N/A * (2) share the same kernel node type (e.g. A/B and C/C/B) 286N/A * (3) may also contain patterns matching "*" and "node()" 286N/A * (element sequence only) or matching "@*" (attribute 286N/A * A test sequence may have a default template, which will be 286N/A * instantiated if none of the other patterns match. 286N/A * @author Jacek Ambroziak 286N/A * @author Santiago Pericas-Geertsen 286N/A * @author Erwin Bolwidt <ejb@klomp.org> 286N/A * @author Morten Jorgensen <morten.jorgensen@sun.com> 286N/A * Integer code for the kernel type of this test sequence 286N/A * Vector of all patterns in the test sequence. May include 286N/A * patterns with "*", "@*" or "node()" kernel. 286N/A * A reference to the Mode object. 286N/A * Default template for this test sequence 286N/A * Instruction list representing this test sequence. 286N/A * Cached handle to avoid compiling more than once. 286N/A * Creates a new test sequence given a set of patterns and a mode. 286N/A * Returns a string representation of this test sequence. Notice 286N/A * that test sequences are mutable, so the value returned by this 286N/A * method is different before and after calling reduce(). 286N/A * Returns the instruction list for this test sequence 286N/A * Return the highest priority for a pattern in this test 286N/A * sequence. This is either the priority of the first or 286N/A * of the default pattern. 286N/A * Returns the position of the highest priority pattern in 286N/A * Reduce the patterns in this test sequence. Creates a new 286N/A * vector of patterns and sets the default pattern if it 286N/A * finds a patterns that is fully reduced. 286N/A // Is this pattern fully reduced? 286N/A break;
// Ignore following patterns 286N/A * Returns, by reference, the templates that are included in 286N/A * this test sequence. Note that a single template can occur 286N/A * in several test sequences if its pattern is a union. 286N/A * Get the instruction handle to a template's code. This is 286N/A * used when a single template occurs in several test 286N/A * sequences; that is, if its pattern is a union of patterns 286N/A * (e.g. match="A/B | A/C"). 286N/A * Returns pattern n in this test sequence 286N/A * Compile the code for this test sequence. Compile patterns 286N/A * from highest to lowest priority. Note that since patterns 286N/A * can be share by multiple test sequences, instruction lists 286N/A * must be copied before backpatching. 286N/A // Returned cached value if already compiled 286N/A // If not patterns, then return handle for default template 286N/A // Init handle to jump when all patterns failed 286N/A // Compile all patterns in reverse order 286N/A // Patterns expect current node on top of stack 286N/A // Apply the test-code compiled for the pattern 286N/A // Make a copy of the instruction list for backpatching 286N/A // On success branch to the template code 286N/A // Next pattern's 'fail' target is this pattern's first instruction 286N/A // Append existing instruction list to the end of this one 286N/A // Set current instruction list to be this one