19f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson/*
29f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * Licensed to the Apache Software Foundation (ASF) under one
39f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * or more contributor license agreements. See the NOTICE file
49f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * distributed with this work for additional information
59f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * regarding copyright ownership. The ASF licenses this file
69f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * to you under the Apache License, Version 2.0 (the  "License");
79f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * you may not use this file except in compliance with the License.
89f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * You may obtain a copy of the License at
99f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson *
109f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson *     http://www.apache.org/licenses/LICENSE-2.0
119f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson *
129f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * Unless required by applicable law or agreed to in writing, software
139f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * distributed under the License is distributed on an "AS IS" BASIS,
149f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
159f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * See the License for the specific language governing permissions and
169f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * limitations under the License.
179f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson */
189f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson/*
199f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * $Id: Keywords.java 468655 2006-10-28 07:12:06Z minchau $
209f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson */
219f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilsonpackage org.apache.xpath.compiler;
229f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
239f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilsonimport java.util.Hashtable;
249f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
259f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson/**
269f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * Table of strings to operation code lookups.
279f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson * @xsl.usage internal
289f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson */
299f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilsonpublic class Keywords
309f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson{
319f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
329f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** Table of keywords to opcode associations. */
339f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static Hashtable m_keywords = new Hashtable();
349f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
359f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** Table of axes names to opcode associations. */
369f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static Hashtable m_axisnames = new Hashtable();
379f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
389f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** Table of function name to function ID associations. */
399f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static Hashtable m_nodetests = new Hashtable();
409f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
419f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** Table of node type strings to opcode associations. */
429f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static Hashtable m_nodetypes = new Hashtable();
439f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
449f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** ancestor axes string. */
459f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_ANCESTORS_STRING = "ancestor";
469f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
479f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** ancestor-or-self axes string. */
489f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_ANCESTORS_OR_SELF_STRING =
499f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    "ancestor-or-self";
509f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
519f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** attribute axes string. */
529f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_ATTRIBUTES_STRING = "attribute";
539f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
549f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** child axes string. */
559f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_CHILDREN_STRING = "child";
569f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
579f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** descendant-or-self axes string. */
589f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_DESCENDANTS_STRING = "descendant";
599f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
609f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** ancestor axes string. */
619f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_DESCENDANTS_OR_SELF_STRING =
629f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    "descendant-or-self";
639f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
649f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** following axes string. */
659f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_FOLLOWING_STRING = "following";
669f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
679f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** following-sibling axes string. */
689f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_FOLLOWING_SIBLINGS_STRING =
699f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    "following-sibling";
709f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
719f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** parent axes string. */
729f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_PARENT_STRING = "parent";
739f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
749f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** preceding axes string. */
759f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_PRECEDING_STRING = "preceding";
769f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
779f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** preceding-sibling axes string. */
789f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_PRECEDING_SIBLINGS_STRING =
799f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    "preceding-sibling";
809f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
819f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** self axes string. */
829f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_SELF_STRING = "self";
839f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
849f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** namespace axes string. */
859f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_NAMESPACE_STRING = "namespace";
869f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
879f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** self axes abreviated string. */
889f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String FROM_SELF_ABBREVIATED_STRING = ".";
899f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
909f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** comment node test string. */
919f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String NODETYPE_COMMENT_STRING = "comment";
929f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
939f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** text node test string. */
949f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String NODETYPE_TEXT_STRING = "text";
959f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
969f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** processing-instruction node test string. */
979f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String NODETYPE_PI_STRING = "processing-instruction";
989f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
999f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** Any node test string. */
1009f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String NODETYPE_NODE_STRING = "node";
1019f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1029f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** Wildcard element string. */
1039f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  private static final String NODETYPE_ANYELEMENT_STRING = "*";
1049f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1059f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** current function string. */
1069f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_CURRENT_STRING = "current";
1079f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1089f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** last function string. */
1099f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_LAST_STRING = "last";
1109f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1119f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** position function string. */
1129f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_POSITION_STRING = "position";
1139f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1149f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** count function string. */
1159f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_COUNT_STRING = "count";
1169f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1179f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** id function string. */
1189f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  static final String FUNC_ID_STRING = "id";
1199f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1209f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** key function string (XSLT). */
1219f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_KEY_STRING = "key";
1229f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1239f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** local-name function string. */
1249f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_LOCAL_PART_STRING = "local-name";
1259f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1269f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** namespace-uri function string. */
1279f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_NAMESPACE_STRING = "namespace-uri";
1289f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1299f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** name function string. */
1309f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_NAME_STRING = "name";
1319f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1329f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** generate-id function string (XSLT). */
1339f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_GENERATE_ID_STRING = "generate-id";
1349f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1359f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** not function string. */
1369f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_NOT_STRING = "not";
1379f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1389f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** true function string. */
1399f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_TRUE_STRING = "true";
1409f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1419f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** false function string. */
1429f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_FALSE_STRING = "false";
1439f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1449f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** boolean function string. */
1459f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_BOOLEAN_STRING = "boolean";
1469f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1479f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** lang function string. */
1489f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_LANG_STRING = "lang";
1499f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1509f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** number function string. */
1519f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_NUMBER_STRING = "number";
1529f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1539f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** floor function string. */
1549f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_FLOOR_STRING = "floor";
1559f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1569f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** ceiling function string. */
1579f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_CEILING_STRING = "ceiling";
1589f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1599f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** round function string. */
1609f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_ROUND_STRING = "round";
1619f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1629f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** sum function string. */
1639f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_SUM_STRING = "sum";
1649f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1659f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** string function string. */
1669f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_STRING_STRING = "string";
1679f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1689f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** starts-with function string. */
1699f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_STARTS_WITH_STRING = "starts-with";
1709f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1719f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** contains function string. */
1729f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_CONTAINS_STRING = "contains";
1739f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1749f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** substring-before function string. */
1759f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_SUBSTRING_BEFORE_STRING =
1769f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    "substring-before";
1779f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1789f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** substring-after function string. */
1799f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_SUBSTRING_AFTER_STRING = "substring-after";
1809f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1819f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** normalize-space function string. */
1829f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_NORMALIZE_SPACE_STRING = "normalize-space";
1839f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1849f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** translate function string. */
1859f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_TRANSLATE_STRING = "translate";
1869f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1879f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** concat function string. */
1889f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_CONCAT_STRING = "concat";
1899f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1909f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** system-property function string. */
1919f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_SYSTEM_PROPERTY_STRING = "system-property";
1929f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1939f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** function-available function string (XSLT). */
1949f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_EXT_FUNCTION_AVAILABLE_STRING =
1959f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    "function-available";
1969f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
1979f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** element-available function string (XSLT). */
1989f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_EXT_ELEM_AVAILABLE_STRING =
1999f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    "element-available";
2009f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2019f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** substring function string. */
2029f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_SUBSTRING_STRING = "substring";
2039f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2049f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** string-length function string. */
2059f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_STRING_LENGTH_STRING = "string-length";
2069f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2079f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** unparsed-entity-uri function string (XSLT). */
2089f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_UNPARSED_ENTITY_URI_STRING =
2099f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    "unparsed-entity-uri";
2109f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2119f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  // Proprietary, built in functions
2129f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2139f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  /** current function string (Proprietary). */
2149f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  public static final String FUNC_DOCLOCATION_STRING = "document-location";
2159f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2169f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  static
2179f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  {
2189f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_ANCESTORS_STRING,
2199f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_ANCESTORS));
2209f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_ANCESTORS_OR_SELF_STRING,
2219f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_ANCESTORS_OR_SELF));
2229f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_ATTRIBUTES_STRING,
2239f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_ATTRIBUTES));
2249f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_CHILDREN_STRING,
2259f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_CHILDREN));
2269f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_DESCENDANTS_STRING,
2279f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_DESCENDANTS));
2289f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_DESCENDANTS_OR_SELF_STRING,
2299f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_DESCENDANTS_OR_SELF));
2309f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_FOLLOWING_STRING,
2319f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_FOLLOWING));
2329f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_FOLLOWING_SIBLINGS_STRING,
2339f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_FOLLOWING_SIBLINGS));
2349f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_PARENT_STRING,
2359f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_PARENT));
2369f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_PRECEDING_STRING,
2379f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_PRECEDING));
2389f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_PRECEDING_SIBLINGS_STRING,
2399f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_PRECEDING_SIBLINGS));
2409f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_SELF_STRING,
2419f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_SELF));
2429f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_axisnames.put(FROM_NAMESPACE_STRING,
2439f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.FROM_NAMESPACE));
2449f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_nodetypes.put(NODETYPE_COMMENT_STRING,
2459f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.NODETYPE_COMMENT));
2469f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_nodetypes.put(NODETYPE_TEXT_STRING,
2479f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.NODETYPE_TEXT));
2489f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_nodetypes.put(NODETYPE_PI_STRING,
2499f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.NODETYPE_PI));
2509f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_nodetypes.put(NODETYPE_NODE_STRING,
2519f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.NODETYPE_NODE));
2529f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_nodetypes.put(NODETYPE_ANYELEMENT_STRING,
2539f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.NODETYPE_ANYELEMENT));
2549f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_keywords.put(FROM_SELF_ABBREVIATED_STRING,
2559f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                   new Integer(OpCodes.FROM_SELF));
2569f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_keywords.put(FUNC_ID_STRING,
2579f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                   new Integer(FunctionTable.FUNC_ID));
2589f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_keywords.put(FUNC_KEY_STRING,
2599f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                   new Integer(FunctionTable.FUNC_KEY));
2609f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2619f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_nodetests.put(NODETYPE_COMMENT_STRING,
2629f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.NODETYPE_COMMENT));
2639f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_nodetests.put(NODETYPE_TEXT_STRING,
2649f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.NODETYPE_TEXT));
2659f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_nodetests.put(NODETYPE_PI_STRING,
2669f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.NODETYPE_PI));
2679f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson    m_nodetests.put(NODETYPE_NODE_STRING,
2689f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson                    new Integer(OpCodes.NODETYPE_NODE));
2699f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  }
2709f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2719f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  static Object getAxisName(String key){
2729f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson          return m_axisnames.get(key);
2739f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  }
2749f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2759f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  static Object lookupNodeTest(String key){
2769f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson          return m_nodetests.get(key);
2779f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  }
2789f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2799f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  static Object getKeyWord(String key){
2809f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson          return m_keywords.get(key);
2819f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  }
2829f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson
2839f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  static Object getNodeType(String key){
2849f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson          return m_nodetypes.get(key);
2859f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson  }
2869f8118474e9513f7a5b7d2a05e4a0fb15d1a6569Jesse Wilson}
287