package ast
Abstract syntax tree of XPath expressions, as produced by the parsers specified in the 'parse' package.
- Alphabetic
- By Inheritance
- ast
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- sealed trait AbbrevForwardStep extends ForwardStep
- sealed trait AdditionOp extends XPathElem with LeafElem
- final case class AdditiveExpr(firstExpr: MultiplicativeExpr, operatorExprPairs: IndexedSeq[(AdditionOp, MultiplicativeExpr)]) extends XPathElem with Product with Serializable
- final case class AndExpr(comparisonExprs: IndexedSeq[ComparisonExpr]) extends XPathElem with Product with Serializable
- sealed trait Argument extends XPathElem
- final case class ArgumentList(arguments: IndexedSeq[Argument]) extends Postfix with Product with Serializable
- sealed trait ArrayConstructor extends PrimaryExpr
- sealed trait ArrayTest extends ItemType
- final case class ArrowExpr(unaryExpr: UnaryExpr, arrowFunctionCalls: IndexedSeq[ArrowFunctionCall]) extends XPathElem with Product with Serializable
- final case class ArrowFunctionCall(arrowFunctionSpecifier: ArrowFunctionSpecifier, argumentList: ArgumentList) extends XPathElem with Product with Serializable
- sealed trait ArrowFunctionSpecifier extends XPathElem
- final case class AtomicOrUnionType(tpe: EQName) extends ItemType with LeafElem with Product with Serializable
- final case class AttributeAxisAbbrevForwardStep(nodeTest: NodeTest) extends AbbrevForwardStep with Product with Serializable
- final case class AttributeNameAndTypeTest(name: EQName, tpe: EQName) extends AttributeTest with LeafElem with Product with Serializable
- final case class AttributeNameTest(name: EQName) extends AttributeTest with LeafElem with Product with Serializable
- sealed trait AttributeTest extends KindTest
- final case class AttributeTypeTest(tpe: EQName) extends AttributeTest with LeafElem with Product with Serializable
- sealed trait AxisStep extends StepExpr
-
final
case class
BracedUriLiteral(namespaceOption: Option[String]) extends Product with Serializable
Braced URI literal.
- final case class CastExpr(arrowExpr: ArrowExpr, singleTypeOption: Option[SingleType]) extends XPathElem with Product with Serializable
- final case class CastableExpr(castExpr: CastExpr, singleTypeOption: Option[SingleType]) extends XPathElem with Product with Serializable
- sealed trait Comp extends XPathElem with LeafElem
- sealed trait ComparisonExpr extends XPathElem
- final case class CompoundComparisonExpr(stringConcatExpr1: StringConcatExpr, comp: Comp, stringConcatExpr2: StringConcatExpr) extends ComparisonExpr with Product with Serializable
- final case class CompoundRangeExpr(additiveExpr1: AdditiveExpr, additiveExpr2: AdditiveExpr) extends RangeExpr with Product with Serializable
- final case class CurlyArrayConstructor(expr: EnclosedExpr) extends ArrayConstructor with Product with Serializable
- final case class DataPITest(data: StringLiteral) extends PITest with Product with Serializable
- final case class DecimalLiteral(value: BigDecimal) extends NumericLiteral with LeafElem with Product with Serializable
- sealed trait DocumentTest extends KindTest
- final case class DocumentTestContainingElementTest(elementTest: ElementTest) extends DocumentTest with Product with Serializable
- final case class DocumentTestContainingSchemaElementTest(schemaElementTest: SchemaElementTest) extends DocumentTest with Product with Serializable
- final case class DoubleLiteral(value: Double) extends NumericLiteral with LeafElem with Product with Serializable
-
sealed
trait
EQName extends AnyRef
EQName, so either a URIQualifiedName or a QName.
- final case class EQNameAsArrowFunctionSpecifier(eqName: EQName) extends ArrowFunctionSpecifier with LeafElem with Product with Serializable
- final case class ElementNameAndTypeTest(name: EQName, tpe: EQName) extends ElementTest with LeafElem with Product with Serializable
- final case class ElementNameTest(name: EQName) extends ElementTest with LeafElem with Product with Serializable
- sealed trait ElementTest extends KindTest
- final case class ElementTypeTest(tpe: EQName) extends ElementTest with LeafElem with Product with Serializable
- final case class EnclosedExpr(exprOption: Option[Expr]) extends XPathElem with Product with Serializable
- final case class ExactlyOneSequenceType(itemType: ItemType) extends SequenceType with Product with Serializable
- final case class Expr(exprSingleSeq: IndexedSeq[ExprSingle]) extends XPathElem with Product with Serializable
- sealed trait ExprSingle extends XPathElem
- final case class ExprSingleArgument(exprSingle: ExprSingle) extends Argument with Product with Serializable
- final case class ForExpr(simpleForBindings: IndexedSeq[SimpleForBinding], returnExpr: ExprSingle) extends ExprSingle with VariableIntroducingExpr with Product with Serializable
- sealed trait ForwardAxis extends XPathElem with LeafElem
- final case class ForwardAxisStep(step: ForwardStep, predicateList: IndexedSeq[Predicate]) extends AxisStep with Product with Serializable
- sealed trait ForwardStep extends XPathElem
- final case class FunctionCall(functionName: EQName, argumentList: ArgumentList) extends PrimaryExpr with Product with Serializable
- sealed trait FunctionItemExpr extends PrimaryExpr
- sealed trait FunctionTest extends ItemType
- sealed trait GeneralComp extends Comp
- final case class IfExpr(condition: Expr, thenExpr: ExprSingle, elseExpr: ExprSingle) extends ExprSingle with Product with Serializable
- final case class InlineFunctionExpr(paramListOption: Option[ParamList], resultTypeOption: Option[SequenceType], body: EnclosedExpr) extends FunctionItemExpr with Product with Serializable
- final case class InstanceOfExpr(treatExpr: TreatExpr, sequenceTypeOption: Option[SequenceType]) extends XPathElem with Product with Serializable
- final case class IntegerLiteral(value: BigInt) extends NumericLiteral with LeafElem with Product with Serializable
- final case class IntersectExceptExpr(firstExpr: InstanceOfExpr, operatorExprPairs: IndexedSeq[(IntersectExceptOp, InstanceOfExpr)]) extends XPathElem with Product with Serializable
- sealed trait IntersectExceptOp extends XPathElem with LeafElem
- sealed trait ItemType extends XPathElem
- sealed trait KeySpecifier extends XPathElem
- sealed trait KindTest extends NodeTest
- final case class KindTestItemType(kindTest: KindTest) extends ItemType with Product with Serializable
- sealed trait LeafElem extends XPathElem
- final case class LetExpr(simpleLetBindings: IndexedSeq[SimpleLetBinding], returnExpr: ExprSingle) extends ExprSingle with VariableIntroducingExpr with Product with Serializable
- sealed trait Literal extends PrimaryExpr
- final case class LocalNameWildcard(localName: NCName) extends Wildcard with LeafElem with Product with Serializable
- final case class MapConstructor(entries: IndexedSeq[MapConstructorEntry]) extends PrimaryExpr with Product with Serializable
- final case class MapConstructorEntry(keyExpr: ExprSingle, valueExpr: ExprSingle) extends XPathElem with Product with Serializable
- sealed trait MapTest extends ItemType
- final case class MultiplicativeExpr(firstExpr: UnionExpr, operatorExprPairs: IndexedSeq[(MultiplicativeOp, UnionExpr)]) extends XPathElem with Product with Serializable
- sealed trait MultiplicativeOp extends XPathElem with LeafElem
-
final
case class
NCName(name: String) extends Product with Serializable
NCName, that is, a non-colon name.
- sealed trait NameTest extends NodeTest
- final case class NamedFunctionRef(functionName: EQName, arity: BigInt) extends FunctionItemExpr with LeafElem with Product with Serializable
- final case class NamedKeySpecifier(ncName: NCName) extends KeySpecifier with LeafElem with Product with Serializable
- final case class NamespaceWildcard(bracedUriLiteral: BracedUriLiteral) extends Wildcard with LeafElem with Product with Serializable
- final case class NillableElementNameAndTypeTest(name: EQName, tpe: EQName) extends ElementTest with LeafElem with Product with Serializable
- final case class NillableElementTypeTest(tpe: EQName) extends ElementTest with LeafElem with Product with Serializable
- sealed trait NodeComp extends Comp
- sealed trait NodeTest extends XPathElem
- final case class NonAbbrevForwardStep(forwardAxis: ForwardAxis, nodeTest: NodeTest) extends ForwardStep with Product with Serializable
- final case class NonAbbrevReverseStep(reverseAxis: ReverseAxis, nodeTest: NodeTest) extends ReverseStep with Product with Serializable
- final case class NonEmptySingleType(name: EQName) extends SingleType with LeafElem with Product with Serializable
- sealed trait NumericLiteral extends Literal
- final case class OneOrMoreSequenceType(itemType: ItemType) extends SequenceType with Product with Serializable
- final case class OrExpr(andExprs: IndexedSeq[AndExpr]) extends ExprSingle with Product with Serializable
- sealed trait PITest extends KindTest
- final case class Param(paramName: EQName, typeDeclarationOption: Option[TypeDeclaration]) extends XPathElem with Product with Serializable
- final case class ParamList(params: IndexedSeq[Param]) extends XPathElem with Product with Serializable
- final case class ParenthesizedExpr(exprOption: Option[Expr]) extends PrimaryExpr with Product with Serializable
- final case class ParenthesizedExprAsArrowFunctionSpecifier(parenthesizedExpr: ParenthesizedExpr) extends ArrowFunctionSpecifier with Product with Serializable
- final case class ParenthesizedExprKeySpecifier(parenthesizedExpr: ParenthesizedExpr) extends KeySpecifier with Product with Serializable
- final case class ParenthesizedItemType(itemType: ItemType) extends ItemType with Product with Serializable
- sealed trait PathExpr extends XPathElem
- final case class PathExprStartingWithDoubleSlash(relativePathExpr: RelativePathExpr) extends PathExpr with Product with Serializable
- final case class PathExprStartingWithSingleSlash(relativePathExpr: RelativePathExpr) extends PathExpr with Product with Serializable
- final case class PositionalKeySpecifier(integerLiteral: IntegerLiteral) extends KeySpecifier with Product with Serializable
- sealed trait Postfix extends XPathElem
- final case class PostfixExpr(primaryExpr: PrimaryExpr, postfixes: IndexedSeq[Postfix]) extends StepExpr with Product with Serializable
- final case class PostfixLookup(keySpecifier: KeySpecifier) extends Postfix with Product with Serializable
- final case class PotentiallyEmptySingleType(name: EQName) extends SingleType with LeafElem with Product with Serializable
- final case class Predicate(expr: Expr) extends Postfix with Product with Serializable
- final case class PrefixWildcard(prefix: NCName) extends Wildcard with LeafElem with Product with Serializable
- sealed trait PrimaryExpr extends XPathElem
- final case class QuantifiedExpr(quantifier: Quantifier, simpleBindings: IndexedSeq[SimpleBindingInQuantifiedExpr], satisfiesExpr: ExprSingle) extends ExprSingle with VariableIntroducingExpr with Product with Serializable
- sealed trait Quantifier extends XPathElem with LeafElem
- sealed trait RangeExpr extends XPathElem
- final case class RelativePathExpr(firstExpr: StepExpr, operatorExprPairs: IndexedSeq[(StepOp, StepExpr)]) extends PathExpr with Product with Serializable
- sealed trait ReverseAxis extends XPathElem with LeafElem
- final case class ReverseAxisStep(step: ReverseStep, predicateList: IndexedSeq[Predicate]) extends AxisStep with Product with Serializable
- sealed trait ReverseStep extends XPathElem
- final case class SchemaAttributeTest(name: EQName) extends KindTest with LeafElem with Product with Serializable
- final case class SchemaElementTest(name: EQName) extends KindTest with LeafElem with Product with Serializable
- sealed trait SequenceType extends XPathElem
- final case class SimpleAbbrevForwardStep(nodeTest: NodeTest) extends AbbrevForwardStep with Product with Serializable
- final case class SimpleBindingInQuantifiedExpr(varName: EQName, expr: ExprSingle) extends VariableBinding with Product with Serializable
- final case class SimpleComparisonExpr(stringConcatExpr: StringConcatExpr) extends ComparisonExpr with Product with Serializable
- final case class SimpleForBinding(varName: EQName, expr: ExprSingle) extends VariableBinding with Product with Serializable
- final case class SimpleLetBinding(varName: EQName, expr: ExprSingle) extends VariableBinding with Product with Serializable
- final case class SimpleMapExpr(pathExprs: IndexedSeq[PathExpr]) extends XPathElem with Product with Serializable
- final case class SimpleNameTest(name: EQName) extends NameTest with LeafElem with Product with Serializable
- final case class SimpleRangeExpr(additiveExpr: AdditiveExpr) extends RangeExpr with Product with Serializable
- sealed trait SingleType extends XPathElem
- final case class SquareArrayConstructor(members: IndexedSeq[ExprSingle]) extends ArrayConstructor with Product with Serializable
- sealed trait StepExpr extends XPathElem
- sealed trait StepOp extends XPathElem with LeafElem
- final case class StringConcatExpr(rangeExprs: IndexedSeq[RangeExpr]) extends XPathElem with Product with Serializable
- final case class StringLiteral(value: String) extends Literal with LeafElem with Product with Serializable
- final case class TargetPITest(target: NCName) extends PITest with LeafElem with Product with Serializable
- final case class TreatExpr(castableExpr: CastableExpr, sequenceTypeOption: Option[SequenceType]) extends XPathElem with Product with Serializable
- final case class TypeDeclaration(tpe: SequenceType) extends XPathElem with Product with Serializable
- final case class TypedArrayTest(elementType: SequenceType) extends ArrayTest with Product with Serializable
- final case class TypedFunctionTest(argumentTypes: IndexedSeq[SequenceType], resultType: SequenceType) extends FunctionTest with Product with Serializable
- final case class TypedMapTest(keyType: AtomicOrUnionType, valueType: SequenceType) extends MapTest with Product with Serializable
- final case class UnaryExpr(ops: IndexedSeq[UnaryOp], valueExpr: ValueExpr) extends XPathElem with Product with Serializable
- final case class UnaryLookup(keySpecifier: KeySpecifier) extends PrimaryExpr with Product with Serializable
- sealed trait UnaryOp extends XPathElem with LeafElem
- final case class UnionExpr(intersectExceptExprs: IndexedSeq[IntersectExceptExpr]) extends XPathElem with Product with Serializable
- sealed trait ValueComp extends Comp
- final case class ValueExpr(expr: SimpleMapExpr) extends XPathElem with Product with Serializable
- final case class VarRef(varName: EQName) extends PrimaryExpr with LeafElem with Product with Serializable
- final case class VarRefAsArrowFunctionSpecifier(varRef: VarRef) extends ArrowFunctionSpecifier with Product with Serializable
-
sealed
trait
VariableBinding extends XPathElem
Binding of a variable name to an expression.
-
sealed
trait
VariableIntroducingExpr extends XPathElem
XPathElem that can introduce one or more variable bindings.
- sealed trait Wildcard extends NameTest
-
sealed
trait
XPathElem extends ElemLike[XPathElem]
XPath 3.1 AST.
XPath 3.1 AST. The root of the type hierarchy is XPathElem. It offers the ElemApi query API.
The purpose of this AST is as follows:
- It must represent the syntax tree of a successfully parsed XPath expression
- It is not annotated with more semantic information, like type information that is not included in the XPath expression
- It does not know anything about the context in which it runs, like bound namespaces etc.
- It is rich enough to be able to serialize the AST back to XPath, knowing exactly where to place parentheses, braces, etc.
- It is rich enough to contain operator precedence in the AST itself
- Serialization of the AST to XPath may lead to differences in whitespace (and operator aliases), but other than that the result must be the same
- The AST class hierarchy does not have to use the exact same names as the XPath grammar
Having such an AST of a successfully parsed XPath expression, it must be easy to reliably find used namespace prefixes, for example.
TODO Improve several class names.
- final case class XPathExpr(expr: Expr) extends XPathElem with Product with Serializable
- final case class ZeroOrMoreSequenceType(itemType: ItemType) extends SequenceType with Product with Serializable
- final case class ZeroOrOneSequenceType(itemType: ItemType) extends SequenceType with Product with Serializable
Value Members
- object AbbrevReverseStep extends ReverseStep with Product with Serializable
- object AdditionOp
- object AnyArrayTest extends ArrayTest with LeafElem with Product with Serializable
- object AnyAttributeTest extends AttributeTest with LeafElem with Product with Serializable
- object AnyElementTest extends ElementTest with LeafElem with Product with Serializable
- object AnyFunctionTest extends FunctionTest with LeafElem with Product with Serializable
- object AnyItemType extends ItemType with LeafElem with Product with Serializable
- object AnyKindTest extends KindTest with LeafElem with Product with Serializable
- object AnyMapTest extends MapTest with LeafElem with Product with Serializable
- object AnyWildcard extends Wildcard with LeafElem with Product with Serializable
- object ArgumentPlaceholder extends Argument with LeafElem with Product with Serializable
- object BracedUriLiteral extends Serializable
- object CommentTest extends KindTest with LeafElem with Product with Serializable
- object ContextItemExpr extends PrimaryExpr with LeafElem with Product with Serializable
- object EQName
- object EmptySequenceType extends SequenceType with LeafElem with Product with Serializable
- object ForwardAxis
- object GeneralComp
- object IntersectExceptOp
- object MultiplicativeOp
- object NCName extends Serializable
-
object
Names
Names, as per the XML specification.
Names, as per the XML specification. See for example https://www.w3.org/TR/REC-xml/#NT-Name.
Only characters in the Unicode BMP (max. ) are considered. So the range from #x10000 to #xEFFFF is not recognized as valid name characters in this implementation.
The functions of this class must be fast, because they are typically called very many times during parsing of XPath expressions.
Classes like NCName lean on this object. An NCName is an XML name without colon.
- object NamespaceNodeTest extends KindTest with LeafElem with Product with Serializable
- object NodeComp
- object Quantifier
- object ReverseAxis
- object SimpleDocumentTest extends DocumentTest with LeafElem with Product with Serializable
- object SimplePITest extends PITest with LeafElem with Product with Serializable
- object SlashOnlyPathExpr extends PathExpr with LeafElem with Product with Serializable
- object StepOp
- object TextTest extends KindTest with LeafElem with Product with Serializable
- object UnaryOp
- object ValueComp
- object WildcardKeySpecifier extends KeySpecifier with LeafElem with Product with Serializable