001: package net.sf.saxon.trace;
002:
003: /**
004: * This class holds constants identifying different kinds of location in a source stylesheet or query.
005: * These constants are used in the getConstructType() method of class InstructionInfo. Some of these
006: * locations represent points where the dynamic context changes, and they are therefore recorded as
007: * such on the context stack. Some of the locations represent points in the evaluation of a stylesheet
008: * (or query or XPath expression) that are notified to the trace listener. Some fulfil both roles.
009: *
010: * <p>Any constant used in {@link net.sf.saxon.style.StandardNames} can be used as a Location. Such
011: * names are generally used to identify XSLT instructions. They are also used for equivalent constructs
012: * in XQuery, for example XSL_ELEMENT is used for a computed element constructor in XQuery. The constants
013: * in StandardNames are all in the range 0-1023, so constants defined in this class are outside this
014: * range.</p>
015: *
016: * <p>The constants in this file are annotated with Q to indicate they can appear in XQuery trace output,
017: * T to indicate they can appear in XSLT trace output, and/or C to indicate that they can appear on the
018: * dynamic context stack.</p>
019: */
020: public class Location {
021:
022: /**
023: * The outer system environment, identified as the caller of a user query or stylesheet.
024: * Usage:C
025: */
026: public static final int CONTROLLER = 2000;
027:
028: /**
029: * An XSLT instruction. The name of the instruction (which may be an extension instruction) can
030: * be obtained using the fingerprint property. Usage:T
031: */
032: public static final int EXTENSION_INSTRUCTION = 2005;
033:
034: /**
035: * An XSLT literal result element, or an XQuery direct element constructor. Usage:QT
036: */
037: public static final int LITERAL_RESULT_ELEMENT = 2006;
038:
039: /**
040: * An attribute of an XSLT literal result element or of an XQuery direct element constructor.
041: * Usage: QT
042: */
043: public static final int LITERAL_RESULT_ATTRIBUTE = 2007;
044:
045: /**
046: * An XPath function call to a user-defined function.
047: * The "expression" property references the actual expression, of class ComputedExpression.
048: * The "target" property references the function being called, of class UserFunction.
049: * Usage: QTC
050: */
051: public static final int FUNCTION_CALL = 2009;
052:
053: /**
054: * An XSLT built-in template rule. Usage: TC
055: */
056: public static final int BUILT_IN_TEMPLATE = 2010;
057:
058: /**
059: * Entry point to a top-level XPath expression within an XSLT stylesheet.
060: * Usage: TC
061: */
062:
063: public static final int XPATH_IN_XSLT = 2011;
064:
065: /**
066: * An XPath or XQuery "for" clause. Usage: Q
067: */
068:
069: public static final int FOR_EXPRESSION = 2012;
070:
071: /**
072: * An XQuery "let" clause, or an XSLT local variable (which compiles into a LET clause).
073: * Usage: Q,T
074: */
075:
076: public static final int LET_EXPRESSION = 2013;
077:
078: /**
079: * An XPath or XQuery "return" clause. Usage: Q
080: */
081:
082: public static final int RETURN_EXPRESSION = 2014;
083:
084: /**
085: * An XPath or XQuery "if" expression. Usage: Q
086: */
087:
088: public static final int IF_EXPRESSION = 2015;
089:
090: /**
091: * An XPath or XQuery "then" clause. Usage: Q
092: */
093:
094: public static final int THEN_EXPRESSION = 2016;
095:
096: /**
097: * An XPath or XQuery "else" clause. Usage: Q
098: */
099:
100: public static final int ELSE_EXPRESSION = 2017;
101:
102: /**
103: * A WHERE clause in a FLWOR expression. Usage: Q
104: */
105:
106: public static final int WHERE_CLAUSE = 2018;
107:
108: /**
109: * An order-by clause in a FLWOR expression. Usage: Q
110: */
111:
112: public static final int ORDER_BY_CLAUSE = 2019;
113:
114: /**
115: * An XPath or XQuery "typeswitch" expression. Usage: Q
116: */
117:
118: public static final int TYPESWITCH_EXPRESSION = 2020;
119:
120: /**
121: * CASE clause within "typeswitch". Usage: Q
122: */
123:
124: public static final int CASE_EXPRESSION = 2021;
125:
126: /**
127: * DEFAULT clause within "typeswitch". Usage: Q
128: */
129:
130: public static final int DEFAULT_EXPRESSION = 2022;
131:
132: /**
133: * An XPath or XQuery "validate" expression. Usage: Q
134: */
135:
136: public static final int VALIDATE_EXPRESSION = 2023;
137:
138: /**
139: * An XPath or XQuery filter expression. Usage: C
140: */
141:
142: public static final int FILTER_EXPRESSION = 2024;
143:
144: /**
145: * An XPath or XQuery path expression. Usage: C
146: */
147:
148: public static final int PATH_EXPRESSION = 2025;
149:
150: /**
151: * An explicit call of the fn:trace() function. Usage: QT
152: */
153:
154: public static final int TRACE_CALL = 2031;
155:
156: /**
157: * An XPath expression constructed dynamically using saxon:evaluate (or saxon:expression).
158: * Usage: QTC
159: */
160:
161: public static final int SAXON_EVALUATE = 2051;
162:
163: /**
164: * A higher-order extension function such as saxon:sum, saxon:highest. Usage: C
165: */
166:
167: public static final int SAXON_HIGHER_ORDER_EXTENSION_FUNCTION = 2052;
168:
169: /**
170: * The saxon:serialize() extension function. Usage: C
171: */
172:
173: public static final int SAXON_SERIALIZE = 2053;
174:
175: /**
176: * A sort key (or order-by key). Usage: C
177: */
178:
179: public static final int SORT_KEY = 2061;
180:
181: /**
182: * A grouping key in XSLT. Usage: C
183: */
184:
185: public static final int GROUPING_KEY = 2062;
186:
187: /**
188: * Lazy evaluation of an expression (this code is used to identify a context created as a saved
189: * copy of an existing context, to be stored in a Closure). Usage: C
190: */
191:
192: public static final int LAZY_EVALUATION = 2063;
193:
194: /**
195: * An XSLT Pattern. Usage: C
196: */
197:
198: public static final int PATTERN = 2064;
199:
200: /**
201: * XPath expression, otherwise unclassified. The "expression" property references the actual expression,
202: * of class ComputedExpression. Used in fallback cases only.
203: */
204: public static final int XPATH_EXPRESSION = 2098;
205:
206: /**
207: * Unclassified location. Used in fallback cases only.
208: */
209: public static final int UNCLASSIFIED = 2099;
210:
211: private Location() {
212: }
213: }
214:
215: //
216: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
217: // you may not use this file except in compliance with the License. You may obtain a copy of the
218: // License at http://www.mozilla.org/MPL/
219: //
220: // Software distributed under the License is distributed on an "AS IS" basis,
221: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
222: // See the License for the specific language governing rights and limitations under the License.
223: //
224: // The Original Code is: all this file.
225: //
226: // The Initial Developer of the Original Code is Michael H. Kay
227: //
228: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
229: //
230: // Contributor(s): none
231: //
|