| | -/* Relational eXpression Map */ |
| | +/* Relational eXpression Map (rxm) */ |
| | grammar Query ; |
| | + |
| | +/************************************************************************ |
| | + * |
| | + * Define lexer rules. |
| | + * |
| | + ************************************************************************/ |
| | |
| | /* Define the keywords first (otherwise T_ID would match first). */ |
| | T_ROOT : 'root' ; |
| | T_IMPORT: 'import' ; |
| | T_MODULE: 'module' ; |
| | T_NULL : 'null' ; |
| | |
| | +/* Define SQL strings that can include space tokens. */ |
| | T_STRING: '\'' (~'\'' | '\'\'')* '\'' ; |
| | |
 |
| | /* Define the WHER clause parameter token. */ |
| | T_EXPR_PARAMETER: '$' ; |
| | + |
| | +/************************************************************************ |
| | + * |
| | + * Define SELECT and JOIN statement. |
| | + * |
| | + ************************************************************************/ |
| | |
| | query: start statement+ where? EOF ; |
| | |
| | -/* Define the root, line map, and JOIN clauses. |
| | - */ |
| | +/* Define the root, line map, and JOIN clauses. */ |
| | start : (root | module) T_COMMA ; |
| | root : T_ROOT T_GT element ; |
| | module: T_MODULE T_ID ; |
| | |
| | statement: (pop | glob | map | include) T_COMMA ; |
| | pop : T_POP ; |
| | glob : T_GLOB ; |
| | |
| | -/* Map lines affect the tree depth differently. |
| | - */ |
| | +/* Map lines affect the tree depth differently. */ |
| | map : tableMap | columnMap | attributeMap | innerMap | outerMap ; |
| | tableMap : table T_GT path ; |
 |
| | path : element | elementPath; |
| | |
| | -/* Define the WHERE clause. */ |
| | +/************************************************************************ |
| | + * |
| | + * Define WHERE clause. |
| | + * |
| | + ************************************************************************/ |
| | + |
| | where : T_WHERE expression? ; |
| | |