Documentation Home
X DevAPI User Guide
Download this Manual
PDF (US Ltr) - 1.4Mb
PDF (A4) - 1.4Mb


X DevAPI User Guide  /  Expressions EBNF Definitions

Chapter 12 Expressions EBNF Definitions

This section provides a visual reference guide to the grammar for the expression language used in X DevAPI.

ident

ident 
   ::= ID | QUOTED_ID

Figure 12.1 ident

Image shows the syntax in EBNF form as described in the preceding text.

schemaQualifiedIdent

schemaQualifiedIdent 
                  ::= ( ident_schema '.' )? ident

Figure 12.2 schemaQualifiedIdent

Image shows the syntax in EBNF form as described in the preceding text.

columnIdent

Figure 12.3 columnIdent

columnIdent
         ::= ( ident '.' ( ident '.' )? )? ident ( ( '->' | '->>' ) "'" '$' documentPath "'" )?
Image shows the syntax in EBNF form as described in the preceding text.

documentPathLastItem

documentPathLastItem
         ::= '[*]'
           | '[' INT ']'
           | '.*'
           | '.' documentPathMember

Figure 12.4 documentPathLastItem

Image shows the syntax in EBNF form as described in the preceding text.

documentPathItem

documentPathItem
         ::= documentPathLastItem
           | '**'

Figure 12.5 documentPathItem

Image shows the syntax in EBNF form as described in the preceding text.

documentPath

documentPath        
          ::= documentPathItem* documentPathLastItem

Figure 12.6 documentPath

Image shows the syntax in EBNF form as described in the preceding text.

documentField

Figure 12.7 documentField

documentField
         ::= fieldId documentPath*
           | '$' documentPath
Image shows the syntax in EBNF form as described in the preceding text.

argsList

argsList ::= expr ( ',' expr )*

Figure 12.8 argsList

Image shows the syntax in EBNF form as described in the preceding text.

lengthSpec

lengthSpec ::= '(' INT ')'

Figure 12.9 lengthSpec

Image shows the syntax in EBNF form as described in the preceding text.

castType

castType ::= 'SIGNED' 'INTEGER'*
           | 'UNSIGNED' 'INTEGER'*
           | 'CHAR' lengthSpec*
           | 'BINARY' lengthSpec*
           | 'DECIMAL' ( lengthSpec | '(' INT ',' INT ')' )?
           | 'TIME'
           | 'DATE'
           | 'DATETIME'
           | 'JSON'

Figure 12.10 castType

Image shows the syntax in EBNF form as described in the preceding text.

functionCall

functionCall
         ::= schemaQualifiedIdent '(' argsList? ')'

Figure 12.11 functionCall

Image shows the syntax in EBNF form as described in the preceding text.

placeholder

placeholder ::= ':' ID

Figure 12.12 placeholder

Image shows the syntax in EBNF form as described in the preceding text.

groupedExpr

groupedExpr ::= '(' expr ')'

Figure 12.13 groupedExpr

Image shows the syntax in EBNF form as described in the preceding text.

unaryOp

unaryOp  ::= ( '!' | '~' | '+' | '-' ) atomicExpr

Figure 12.14 unaryOp

Image shows the syntax in EBNF form as described in the preceding text.

literal

literal  ::= INT
           | FLOAT
           | STRING_SQ
           | STRING_DQ
           | 'NULL'
           | 'FALSE'
           | 'TRUE'

Figure 12.15 literal

Image shows the syntax in EBNF form as described in the preceding text.

jsonKeyValue

jsonKeyValue ::= STRING_DQ ':' expr

Figure 12.16 jsonKeyValue

Image shows the syntax in EBNF form as described in the preceding text.

jsonDoc

jsonDoc  ::= '{' ( jsonKeyValue ( ',' jsonKeyValue )* )* '}'

Figure 12.17 jsonDoc

Image shows the syntax in EBNF form as described in the preceding text.

jsonarray

jsonArray ::= '[' ( expr ( ',' expr )* )* ']'

Figure 12.18 jsonarray

Image shows the syntax in EBNF form as described in the preceding text.

atomicExpr

atomicExpr
         ::= placeholder
           | columnOrPath
           | functionCall
           | groupedExpr
           | unaryOp
           | castOp

Figure 12.19 atomicExpr

Image shows the syntax in EBNF form as described in the preceding text.

intervalUnit

INTERVAL_UNIT
         ::= 'MICROSECOND'
           | 'SECOND'
           | 'MINUTE'
           | 'HOUR'
           | 'DAY'
           | 'WEEK'
           | 'MONTH'
           | 'QUARTER'
           | 'YEAR'
           | 'SECOND_MICROSECOND'
           | 'MINUTE_MICROSECOND'
           | 'MINUTE_SECOND'
           | 'HOUR_MICROSECOND'
           | 'HOUR_SECOND'
           | 'HOUR_MINUTE'
           | 'DAY_MICROSECOND'
           | 'DAY_SECOND'
           | 'DAY_MINUTE'
           | 'DAY_HOUR'
           | 'YEAR_MONTH'

Figure 12.20 INTERVAL_UNIT

Image shows the syntax in EBNF form as described in the preceding text.

interval

interval ::= 'INTERVAL' expr INTERVAL_UNIT

Figure 12.21 interval

Image shows the syntax in EBNF form as described in the preceding text.

intervalExpr

intervalExpr
         ::= atomicExpr ( ( '+' | '-' ) interval )*

Figure 12.22 intervalExpr

Image shows the syntax in EBNF form as described in the preceding text.

mulDivExpr

mulDivExpr
         ::= intervalExpr ( ( '*' | '/' | '%' ) intervalExpr )*

Figure 12.23 mulDivExpr

Image shows the syntax in EBNF form as described in the preceding text.

addSubExpr

addSubExpr
         ::= mulDivExpr ( ( '+' | '-' ) mulDivExpr )*

Figure 12.24 addSubExpr

Image shows the syntax in EBNF form as described in the preceding text.

shiftExpr

shiftExpr
         ::= addSubExpr ( ( '<<' | '>>' ) addSubExpr )*

Figure 12.25 shiftExpr

Image shows the syntax in EBNF form as described in the preceding text.

bitExpr

bitExpr  ::= shiftExpr ( ( '&' | '|' | '^' ) shiftExpr )*

Figure 12.26 bitExpr

Image shows the syntax in EBNF form as described in the preceding text.

compExpr

compExpr ::= bitExpr ( ( '>=' | '>' | '<=' | '<' | '=' | '<>' | '!=' ) bitExpr )*

Figure 12.27 compExpr

Image shows the syntax in EBNF form as described in the preceding text.

ilriExpr

ilriExpr ::= compExpr 'IS' 'NOT'* ( 'NULL' | 'TRUE' | 'FALSE' )
           | compExpr 'NOT'* 'IN' '(' argsList* ')'
           | compExpr 'NOT'* 'IN' compExpr
           | compExpr 'NOT'* 'LIKE' compExpr ( 'ESCAPE' compExpr )*
           | compExpr 'NOT'* 'BETWEEN' compExpr 'AND' compExpr
           | compExpr 'NOT'* 'REGEXP' compExpr
           | compExpr

Figure 12.28 ilriExpr

Image shows the syntax in EBNF form as described in the preceding text.

andExpr

andExpr  ::= ilriExpr ( ( '&&' | 'AND' ) ilriExpr )*

Figure 12.29 andExpr

Image shows the syntax in EBNF form as described in the preceding text.

orExpr

orExpr   ::= andExpr ( ( '||' | 'OR' ) andExpr )*

Figure 12.30 orExpr

Image shows the syntax in EBNF form as described in the preceding text.

expr

expr     ::= orExpr

Figure 12.31 expr

Image shows the syntax in EBNF form as described in the preceding text.

DIGIT

DIGIT    ::= '0' - '9'

Figure 12.32 DIGIT

Image shows the syntax in EBNF form as described in the preceding text.

FLOAT

FLOAT    ::= DIGIT* '.' DIGIT+ ( 'E' ( '+' | '-' )* DIGIT+ )*
           | DIGIT+ 'E' ( '+' | '-' )* DIGIT+

Figure 12.33 FLOAT

Image shows the syntax in EBNF form as described in the preceding text.

INT

INT      ::= DIGIT+

Figure 12.34 INT

Image shows the syntax in EBNF form as described in the preceding text.

QUOTED_ID

QUOTED_ID
         ::= '`' ID '`'
           | '`' ( '~' '`'* | '``' )* '`'

Figure 12.35 QUOTED_ID

Image shows the syntax in EBNF form as described in the preceding text.

ID

ID       ::= ( 'a' - 'z' | 'A' - 'Z' | '_' ) ( 'a' - 'z' | 'A' - 'Z' | '0' - '9' | '_' )*

Figure 12.36 ID

Image shows the syntax in EBNF form as described in the preceding text.

WS

WS       ::= [ \t\r\n]+

Figure 12.37 WS

Image shows the syntax in EBNF form as described in the preceding text.

SCHAR

SCHAR    ::= [\u0020\u0021\u0023\u0024\u0025\u0026\u0028-\u005B\u005D-\u007E]

Figure 12.38 SCHAR

Image shows the syntax in EBNF form as described in the preceding text.

STRING_DQ

STRING_DQ
         ::= '"' ( SCHAR | "'" | ESCAPED_DQ )* '"'

Figure 12.39 STRING_DQ

Image shows the syntax in EBNF form as described in the preceding text.

STRING_SQ

STRING_SQ
         ::= "'" ( SCHAR | '"' | ESCAPED_SQ )* "'"

Figure 12.40 STRING_SQ

Image shows the syntax in EBNF form as described in the preceding text.