Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/rxm.git

Updated comments to grammar; emphasized sections.

AuthorDave Jarvis <email>
Date2015-03-16 09:54:45 GMT-0700
Commit2717de8fec8fae9e550c501051636e57196b778d
Parent3766403
source/grammar/Query.g
-/* 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? ;
Delta22 lines added, 6 lines removed, 16-line increase