com.jclark.xsl.expr

Class ExprParser

Implemented Interfaces:
NamespaceConstants

public class ExprParser
extends ExprTokenizer
implements NamespaceConstants

XPAth expression parser / compiler extends the lexer ExprTokenizer

Field Summary

Fields inherited from class com.jclark.xsl.expr.ExprTokenizer

TOK_AND, TOK_AT, TOK_AXIS, TOK_CNAME_LPAR, TOK_COMMA, TOK_COMMENT_LPAR, TOK_DIV, TOK_DOT, TOK_DOT_DOT, TOK_EOF, TOK_EQUALS, TOK_FUNCTION_LPAR, TOK_GT, TOK_GTE, TOK_LITERAL, TOK_LPAR, TOK_LSQB, TOK_LT, TOK_LTE, TOK_MINUS, TOK_MOD, TOK_MULTIPLY, TOK_NAME_COLON_STAR, TOK_NODE_LPAR, TOK_NOT_EQUALS, TOK_NUMBER, TOK_OR, TOK_PLUS, TOK_PROCESSING_INSTRUCTION_LPAR, TOK_QNAME, TOK_RPAR, TOK_RSQB, TOK_SLASH, TOK_SLASH_SLASH, TOK_STAR, TOK_TEXT_LPAR, TOK_VARIABLE_REF, TOK_VBAR, currentToken, currentTokenValue

Fields inherited from interface com.jclark.xsl.om.NamespaceConstants

EXSL_COMMON_NAMESPACE, EXSL_DATE_NAMESPACE, EXSL_DYNAMIC_NAMESPACE, EXSL_FUNCTIONS_NAMESPACE, EXSL_MATH_NAMESPACE, EXSL_REGEXP_NAMESPACE, EXSL_SETS_NAMESPACE, EXSL_STRINGS_NAMESPACE, XFYXT_NAMESPACE, XSL_NAMESPACE, XT_NAMESPACE

Method Summary

(package private) static boolean
functionAvailable(Name name, ExprContext context)
static NodeSetExpr
getChildrenExpr()
(package private) ConvertibleExpr
makeRelationalExpr(Relation rel, ConvertibleExpr e1, ConvertibleExpr e2)
A ConvertibleExpr allows for the casting of one type to another for the purpose of making a comparison
static BooleanExpr
parseBooleanExpr(Node node, String expr, VariableSet locals)
parse an XPath expression which is to be used in a context in which a Boolean is expected
static NodeSetExpr
parseNodeSetExpr(Node node, String expr, VariableSet locals)
parse an XPath expression which is to be used in a context in which a NodeSet is expected i.e.
static NumberExpr
parseNumberExpr(Node node, String expr, VariableSet locals)
parse an XPath expression which is to be used in a context in which a Number is expected
static TopLevelPattern
parsePattern(Node node, String pattern)
parse an XPath match Pattern
static TopLevelPattern
parsePattern(Node node, String pattern, VariableSet locals)
parse an XPath match pattern (with some variables!?!?)
static StringExpr
parseStringExpr(Node node, String expr, VariableSet locals)
parse an XPath expression which is to be used in a context in which a String is expected
static StringExpr
parseValueExpr(Node node, String value, VariableSet locals)
parse an XSLT attribute value template (which may include XPath expression(s) enclosed in curlybraces "{" "}")
static VariantExpr
parseVariantExpr(Node node, String expr, VariableSet locals)
parse an XPath expression which is to be used in a context in which a Variant (xsl:variable, xsl:param) is expected

Methods inherited from class com.jclark.xsl.expr.ExprTokenizer

next

Method Details

functionAvailable

(package private) static boolean functionAvailable(Name name,
                                                   ExprContext context)
            throws XSLException

getChildrenExpr

public static NodeSetExpr getChildrenExpr()

makeRelationalExpr

(package private)  ConvertibleExpr makeRelationalExpr(Relation rel,
                                                      ConvertibleExpr e1,
                                                      ConvertibleExpr e2)
            throws ParseException
A ConvertibleExpr allows for the casting of one type to another for the purpose of making a comparison

parseBooleanExpr

public static BooleanExpr parseBooleanExpr(Node node,
                                           String expr,
                                           VariableSet locals)
            throws XSLException
parse an XPath expression which is to be used in a context in which a Boolean is expected

parseNodeSetExpr

public static NodeSetExpr parseNodeSetExpr(Node node,
                                           String expr,
                                           VariableSet locals)
            throws XSLException
parse an XPath expression which is to be used in a context in which a NodeSet is expected i.e. for the "select" attribute of an "xsl:apply-templates"

parseNumberExpr

public static NumberExpr parseNumberExpr(Node node,
                                         String expr,
                                         VariableSet locals)
            throws XSLException
parse an XPath expression which is to be used in a context in which a Number is expected

parsePattern

public static TopLevelPattern parsePattern(Node node,
                                           String pattern)
            throws XSLException
parse an XPath match Pattern

parsePattern

public static TopLevelPattern parsePattern(Node node,
                                           String pattern,
                                           VariableSet locals)
            throws XSLException
parse an XPath match pattern (with some variables!?!?)
Parameters:
node - represents the node in the stylesheet with the expression we're parsing. Used for plugging the location in any Exception we might throw xsl:number allows variables in the "count" and "from" attributes

parseStringExpr

public static StringExpr parseStringExpr(Node node,
                                         String expr,
                                         VariableSet locals)
            throws XSLException
parse an XPath expression which is to be used in a context in which a String is expected

parseValueExpr

public static StringExpr parseValueExpr(Node node,
                                        String value,
                                        VariableSet locals)
            throws XSLException
parse an XSLT attribute value template (which may include XPath expression(s) enclosed in curlybraces "{" "}")

parseVariantExpr

public static VariantExpr parseVariantExpr(Node node,
                                           String expr,
                                           VariableSet locals)
            throws XSLException
parse an XPath expression which is to be used in a context in which a Variant (xsl:variable, xsl:param) is expected