BNF for rdql.jj
NON-TERMINALS
CompilationUnit
::=
Query
<EOF>
CommaOpt
::=
( <COMMA> )?
Query
::=
SelectClause
(
SourceClause
)?
TriplePatternClause
(
ConstraintClause
)? (
PrefixesClause
)?
SelectClause
::=
( <SELECT>
Var
(
CommaOpt
Var
)* | <SELECT> "*" )
SourceClause
::=
( <SOURCE> | <FROM> )
SourceSelector
SourceSelector
::=
URL
TriplePatternClause
::=
<WHERE>
TriplePattern
(
CommaOpt
TriplePattern
)*
ConstraintClause
::=
<SUCHTHAT>
Expression
( ( <COMMA> | <SUCHTHAT> )
Expression
)*
TriplePattern
::=
<LPAREN>
VarOrURI
CommaOpt
VarOrURI
CommaOpt
VarOrLiteral
<RPAREN>
VarOrURI
::=
Var
|
URI
VarOrLiteral
::=
Var
|
Literal
Var
::=
"?"
Identifier
PrefixesClause
::=
<PREFIXES>
PrefixDecl
(
CommaOpt
PrefixDecl
)*
PrefixDecl
::=
Identifier
<FOR>
QuotedURI
Expression
::=
ConditionalOrExpression
ConditionalOrExpression
::=
ConditionalXorExpression
( <SC_OR>
ConditionalXorExpression
)*
ConditionalXorExpression
::=
ConditionalAndExpression
ConditionalAndExpression
::=
ValueLogical
( <SC_AND>
ValueLogical
)*
ValueLogical
::=
StringEqualityExpression
StringEqualityExpression
::=
NumericalLogical
( <STR_EQ>
NumericalLogical
| <STR_NE>
NumericalLogical
| <STR_MATCH>
PatternLiteral
| <STR_NMATCH>
PatternLiteral
)*
NumericalLogical
::=
InclusiveOrExpression
InclusiveOrExpression
::=
ExclusiveOrExpression
( <BIT_OR>
ExclusiveOrExpression
)*
ExclusiveOrExpression
::=
AndExpression
( <BIT_XOR>
AndExpression
)*
AndExpression
::=
ArithmeticCondition
( <BIT_AND>
ArithmeticCondition
)*
ArithmeticCondition
::=
EqualityExpression
EqualityExpression
::=
RelationalExpression
( <EQ>
RelationalExpression
| <NEQ>
RelationalExpression
)?
RelationalExpression
::=
NumericExpression
( <LT>
NumericExpression
| <GT>
NumericExpression
| <LE>
NumericExpression
| <GE>
NumericExpression
)?
NumericExpression
::=
ShiftExpression
ShiftExpression
::=
AdditiveExpression
( <LSHIFT>
AdditiveExpression
| <RSIGNEDSHIFT>
AdditiveExpression
| <RUNSIGNEDSHIFT>
AdditiveExpression
)*
AdditiveExpression
::=
MultiplicativeExpression
( <PLUS>
MultiplicativeExpression
| <MINUS>
MultiplicativeExpression
)*
MultiplicativeExpression
::=
UnaryExpression
( <STAR>
UnaryExpression
| <SLASH>
UnaryExpression
| <REM>
UnaryExpression
)*
UnaryExpression
::=
UnaryExpressionNotPlusMinus
|
( <PLUS>
UnaryExpression
| <MINUS>
UnaryExpression
)
UnaryExpressionNotPlusMinus
::=
( <TILDE> | <BANG> )
UnaryExpression
|
PrimaryExpression
PrimaryExpression
::=
Var
|
Literal
|
<LPAREN>
Expression
<RPAREN>
ArgList
::=
VarOrLiteral
( <COMMA>
VarOrLiteral
)*
Literal
::=
URI
|
NumericLiteral
|
TextLiteral
|
BooleanLiteral
|
NullLiteral
NumericLiteral
::=
( <INTEGER_LITERAL> | <FLOATING_POINT_LITERAL> )
TextLiteral
::=
( <STRING_LITERAL1> | <STRING_LITERAL2> ) ( <AT>
Identifier
)? ( <DATATYPE>
URI
)?
PatternLiteral
::=
BooleanLiteral
::=
<BOOLEAN_LITERAL>
NullLiteral
::=
<NULL_LITERAL>
URL
::=
URI
URI
::=
QuotedURI
|
QName
QName
::=
Identifier
":"
Identifier
QuotedURI
::=
"<" <URI> ">"
Identifier
::=
( <IDENTIFIER> | <SELECT> | <SOURCE> | <FROM> | <WHERE> | <SUCHTHAT> | <PREFIXES> | <FOR> | <STR_EQ> | <STR_NE> )