Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: xmlware/xpath/xpath-1/w3c/w3c-19991116/extracted
Source used for this grammar: W3C, XML Path Language (XPath), Version 1.0, xmlspec-v20.dtd
, 16 November 1999 [Source]
LocationPath
, AbsoluteLocationPath
, RelativeLocationPath
, Step
, AxisSpecifier
, AxisName
, NodeTest
, Predicate
, PredicateExpr
, AbbreviatedAbsoluteLocationPath
, AbbreviatedRelativeLocationPath
, AbbreviatedStep
, AbbreviatedAxisSpecifier
, Expr
, PrimaryExpr
, FunctionCall
, Argument
, UnionExpr
, PathExpr
, FilterExpr
, OrExpr
, AndExpr
, EqualityExpr
, RelationalExpr
, AdditiveExpr
, MultiplicativeExpr
, UnaryExpr
, ExprToken
, Number
, Operator
, OperatorName
, MultiplyOperator
, VariableReference
, NameTest
, NodeType
, ExprWhitespace
, Digits
), 0 root (—), 2 top (ExprToken
, ExprWhitespace
), 5 bottom (QName
2, Literal
3, S
, FunctionName
2, NCName
).[NT-LocationPath]
, [NT-AbsoluteLocationPath]
, [NT-RelativeLocationPath]
, [NT-Step]
, [NT-AxisSpecifier]
, [NT-AxisName]
, [NT-NodeTest]
, [NT-Predicate]
, [NT-PredicateExpr]
, [NT-AbbreviatedAbsoluteLocationPath]
, [NT-AbbreviatedRelativeLocationPath]
, [NT-AbbreviatedStep]
, [NT-AbbreviatedAxisSpecifier]
, [NT-Expr]
, [NT-PrimaryExpr]
, [NT-FunctionCall]
, [NT-Argument]
, [NT-UnionExpr]
, [NT-PathExpr]
, [NT-FilterExpr]
, [NT-OrExpr]
, [NT-AndExpr]
, [NT-EqualityExpr]
, [NT-RelationalExpr]
, [NT-AdditiveExpr]
, [NT-MultiplicativeExpr]
, [NT-UnaryExpr]
, [NT-ExprToken]
, [NT-Number]
, [NT-Operator]
, [NT-OperatorName]
, [NT-MultiplyOperator]
, [NT-VariableReference]
, [NT-NameTest]
, [NT-NodeType]
, [NT-ExprWhitespace]
, [NT-Digits]
.LocationPath ::= [NT-LocationPath]::RelativeLocationPath AbsoluteLocationPath
AbsoluteLocationPath ::= [NT-AbsoluteLocationPath]::"/" RelativeLocationPath AbbreviatedAbsoluteLocationPath
RelativeLocationPath ::= [NT-RelativeLocationPath]::"/" Step AbbreviatedRelativeLocationPathStep RelativeLocationPath
Step ::= [NT-Step]::AxisSpecifier NodeTest Predicate AbbreviatedStep
AxisSpecifier ::= [NT-AxisSpecifier]::"::" AbbreviatedAxisSpecifierAxisName
AxisName ::= [NT-AxisName]::"ancestor""ancestor-or-self""attribute""child""descendant""descendant-or-self""following""following-sibling""namespace""parent""preceding""preceding-sibling""self"
NodeTest ::= [NT-NodeTest]::"(" ")""processing-instruction" "(" Literal ")"NameTest NodeType
Predicate ::= [NT-Predicate]::"[" PredicateExpr "]"
PredicateExpr ::= [NT-PredicateExpr]::Expr
AbbreviatedAbsoluteLocationPath ::= [NT-AbbreviatedAbsoluteLocationPath]::"//" RelativeLocationPath
AbbreviatedRelativeLocationPath ::= [NT-AbbreviatedRelativeLocationPath]::"//" StepRelativeLocationPath
AbbreviatedStep ::= [NT-AbbreviatedStep]::"."".."
AbbreviatedAxisSpecifier ::= [NT-AbbreviatedAxisSpecifier]::"@"
Expr ::= [NT-Expr]::OrExpr
PrimaryExpr ::= [NT-PrimaryExpr]::"(" Expr ")" Literal Number FunctionCallVariableReference
FunctionCall ::= [NT-FunctionCall]::"(" Argument "," Argument ")"FunctionName
Argument ::= [NT-Argument]::Expr
UnionExpr ::= [NT-UnionExpr]::"|" PathExprPathExpr UnionExpr
PathExpr ::= [NT-PathExpr]::"/" RelativeLocationPath FilterExpr "//" RelativeLocationPathLocationPath FilterExpr FilterExpr
FilterExpr ::= [NT-FilterExpr]::PrimaryExpr FilterExpr Predicate
OrExpr ::= [NT-OrExpr]::"or" AndExprAndExpr OrExpr
AndExpr ::= [NT-AndExpr]::"and" EqualityExprEqualityExpr AndExpr
EqualityExpr ::= [NT-EqualityExpr]::"=" RelationalExpr EqualityExpr "!=" RelationalExprRelationalExpr EqualityExpr
RelationalExpr ::= [NT-RelationalExpr]::"<" AdditiveExpr RelationalExpr ">" AdditiveExpr RelationalExpr "<=" AdditiveExpr RelationalExpr ">=" AdditiveExprAdditiveExpr RelationalExpr
AdditiveExpr ::= [NT-AdditiveExpr]::"+" MultiplicativeExpr AdditiveExpr "-" MultiplicativeExprMultiplicativeExpr AdditiveExpr
MultiplicativeExpr ::= [NT-MultiplicativeExpr]::"div" UnaryExpr MultiplicativeExpr "mod" UnaryExprUnaryExpr MultiplicativeExpr MultiplyOperator UnaryExpr MultiplicativeExpr
UnaryExpr ::= [NT-UnaryExpr]::"-" UnaryExprUnionExpr
ExprToken ::= [NT-ExprToken]::"("")""[""]"".""..""@"",""::" NameTest NodeType Operator FunctionName AxisName Literal Number VariableReference
Number ::= [NT-Number]::"." Digits"." DigitsDigits
Operator ::= [NT-Operator]::"/""//""|""+""-""=""!=""<""<="">"">="OperatorName MultiplyOperator
OperatorName ::= [NT-OperatorName]::"and""or""mod""div"
MultiplyOperator ::=
[NT-MultiplyOperator]::"*"
VariableReference ::= [NT-VariableReference]::"$" QName
NameTest ::= [NT-NameTest]::"*" NCName ":" "*" QName
NodeType ::= [NT-NodeType]::"comment""text""processing-instruction""node"
ExprWhitespace ::= [NT-ExprWhitespace]::S
Digits ::= [NT-Digits]::"0""1""2""3""4""5""6""7""8""9"