The grammar of Jex is specified using the Extended Backus-Naur Form (EBNF) notation defined in
XML 1.0 [7], with the following addition:
-
Regular expressions can be specified using #'regEx'
This appendix specifies the normative version of the complete EBNF for Jex basic.
ManyPaths ::= (JexBasicExpr "\n" | "\n" | ("&&" #'[^\n]*' "\n")) *
JexBasicExpr ::= AbsoluteLocationPath
AbsoluteLocationPath ::= '/' RelativeLocationPath
RelativeLocationPath ::= ChildAxisStep ('/' ChildAxisStep)*
ChildAxisStep ::= DataNodeNameTest Predicate? | AbbreviatedStep
DataNodeNameTest ::= DataNodeName | '*'
AbbreviatedStep ::= '.'
Predicate ::= '[' JexBasicPredicateExpr ']'
JexBasicPredicateExpr ::= MoiSelectorExpr | AttributeElementSelector
MoiSelectorExpr ::= 'id=' String
AttributeElementSelector ::= NonNegativeInteger
NonNegativeInteger ::= #'[0-9]+'
DataNodeName ::= FirstDataNodeNameChar DataNodeNameChar*
DataNodeNameChar ::= #'[^"[\]=!<>\n (),/|]'
FirstDataNodeNameChar ::= #'[^"[\]=!<>\n() (),/0123456789+-]'
String ::= '"' StringChar '"'
StringChar ::= #'[^"\/\b\f\n\r\t]*'
This appendix specifies the normative version of the complete EBNF for Jex advanced.
ManyPaths ::= (JexAdvancedExpr "\n" | "\n" | ("&&" #'[^\n]*' "\n")) *
JexAdvancedExpr ::= AbsolutePathExpr (" | " AbsolutePathExpr)*
AbsolutePathExpr ::= ('/' RelativePathExpr?)
RelativePathExpr ::= StepExpr ('/' StepExpr)*
StepExpr ::= ChildFilterExpr | ChildAxisStep
ChildFilterExpr ::= '(' UnionExpr ')'
UnionExpr ::= LocationPath ('|' LocationPath)*
LocationPath ::= AbsoluteLocationPath | RelativeLocationPath
AbsoluteLocationPath ::= '/' RelativeLocationPath
RelativeLocationPath ::= ChildAxisStep ('/' ChildAxisStep)*
ChildAxisStep ::= DataNodeNameTest Predicate? | AbbreviatedStep
DataNodeNameTest ::= '*' | DataNodeName
Predicate ::= '[' JexAdvancedPredicateExpr ']'
AbbreviatedStep ::= '.'
JexAdvancedPredicateExpr ::= OrExpr | AttributeElementSelector
AttributeElementSelector ::= NonNegativeInteger
OrExpr ::= AndExpr (' or ' AndExpr)*
AndExpr ::= AndOperandExpr (' and ' AndOperandExpr)*
AndOperandExpr ::= ComparisionExpr | LocationPath | FunctionCall | '(' OrExpr ')' | 'not' '(' OrExpr ')'
ComparisionExpr ::= EqualityExpr | RelationalExpr
EqualityExpr ::= LocationPath ('=' | '!=') (String
| Number
| true | false | null)
RelationalExpr ::= LocationPath ('<' | '>' | '<=' | '>=' ) Number
FunctionCall ::= FunctionName'('LocationPath','Argument')'
FunctionName ::= "contains"
Argument ::= String
DataNodeName ::= FirstDataNodeNameChar DataNodeNameChar*
DataNodeNameChar ::= #'[^"[\]=!<>\n (),/|]'
FirstDataNodeNameChar ::= #'[^"[\]=!<>\n() (),/0123456789+-]'
String ::= '"' StringChar '"'
StringChar ::= #'[^"]*'
Number ::= ( Minus )? NonNegativeInteger ( Fraction )? ( Exponent )?
DecimalPoint ::= '.'
Zero ::= '0'
Digit0-9 ::= #'[0-9]+'
Digit1-9 ::= #'[1-9]+'
e ::= 'e' | 'E'
Exponent ::= e ( Minus | Plus )? Digit0-9+
Fraction ::= DecimalPoint Digit0-9+
NonNegativeInteger ::= Zero | ( Digit1-9 Digit0-9* )
Minus ::= '-'
Plus ::= '+'
true ::= 'true'
false ::= 'false'
null ::= 'null'
This appendix specifies the normative version of the complete EBNF for Jex conditions.
ManyPaths ::= (JexConditionsExpr "\n" | "\n" | ("&&" #'[^\n]*' "\n")) *
JexConditionsExpr ::= JexAdvancedPredicateExpr
LocationPath ::= AbsoluteLocationPath | RelativeLocationPath
AbsoluteLocationPath ::= '/' RelativeLocationPath
RelativeLocationPath ::= ChildAxisStep ('/' ChildAxisStep)*
ChildAxisStep ::= DataNodeNameTest Predicate? | AbbreviatedStep
DataNodeNameTest ::= '*' | DataNodeName
Predicate ::= '[' JexAdvancedPredicateExpr ']'
AbbreviatedStep ::= '.'
JexAdvancedPredicateExpr ::= OrExpr | AttributeElementSelector
OrExpr ::= AndExpr (' or ' AndExpr)*
AndExpr ::= AndOperandExpr (' and ' AndOperandExpr)*
AndOperandExpr ::= ComparisionExpr | LocationPath | FunctionCall | '(' OrExpr ')' | 'not' '(' OrExpr ')'
ComparisionExpr ::= EqualityExpr | RelationalExpr
AttributeElementSelector ::= NonNegativeInteger
EqualityExpr ::= LocationPath ('=' | '!=') (String
| Number
| true | false | null)
RelationalExpr ::= LocationPath ('<' | '>' | '<=' | '>=' ) Number
FunctionCall ::= FunctionName'('LocationPath','Argument')'
FunctionName ::= "contains"
Argument ::= String
DataNodeName ::= FirstDataNodeNameChar DataNodeNameChar*
DataNodeNameChar ::= #'[^"[\]=!<>\n (),/|]'
FirstDataNodeNameChar ::= #'[^"[\]=!<>\n() (),/0123456789+-]'
String ::= '"' StringChar '"'
StringChar ::= #'[^"]*'
Number ::= ( Minus )? NonNegativeInteger ( Fraction )? ( Exponent )?
DecimalPoint ::= '.'
Zero ::= '0'
Digit0-9 ::= #'[0-9]+'
Digit1-9 ::= #'[1-9]+'
e ::= 'e' | 'E'
Exponent ::= e ( Minus | Plus )? Digit0-9+
Fraction ::= DecimalPoint Digit0-9+
NonNegativeInteger ::= Zero | ( Digit1-9 Digit0-9* )
Minus ::= '-'
Plus ::= '+'
true ::= 'true'
false ::= 'false'
null ::= 'null'