Dave Jarvis' Repositories

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

Reorganized BNF. Revised documentation with more Java code simplifications.

Author Dave Jarvis <email>
Date 2015-02-09 18:58:16 GMT-0800
Commit 83b8b4d487a7fc6329554e419326036a8a3d8f6f
Parent 3f5b776
README.md
^, # pop stack to previous context
address > address, # switch context to "address" node
-.*; # * globs all columns. ; is WHERE
+.*, # .* globs all columns
+; # Starts WHERE clause
```
rxm.cf
+entrypoints Query ;
+
token Identifier (letter (letter | digit | '_')*) ;
-token Terminator (',') ;
+token LineTerminator (',') ;
+token MapTerminator (';') ;
+token AssociatedWith ('>') ;
-TTable. Table ::= Identifier ;
-TColumn. Column ::= "." Identifier ;
+TTable. Table ::= Identifier ;
+TColumn. Column ::= "." Identifier ;
TTableColumn. TableColumn ::= Identifier Column ;
-TAttribute. Attribute ::= "@" Identifier ;
-TParameter. Parameter ::= "$" Identifier ;
+TAttribute. Attribute ::= "@" Identifier ;
+TParameter. Parameter ::= "$" Identifier ;
-Program. Query ::= Root Map ";" Where ;
-Start. Root ::= "root" ">" Element Terminator ;
+RXM. Query ::= Start Map Where ;
-rules Map ::= ".*" | Line ;
+SDecl. Start ::= StartDecl LineTerminator;
+SStart. StartDecl ::= "root" AssociatedWith Element ;
+SModule. StartDecl ::= "module" Identifier ;
+SImport. StartDecl ::= "import" Identifier ;
-rules Line ::= LineXPath | LineJoin ;
+MDecl. Map ::= MapDecl LineTerminator ;
+MGlob. MapDecl ::= ".*" ;
+MLine. MapDecl ::= LineElement ;
-LXPath. LineXPath ::= Entity ">" XPath Terminator ;
-LJoin. LineJoin ::= TableColumn ">" TableColumn Terminator ;
+LENode. LineElement ::= LineNode;
+LEJoin. LineElement ::= LineJoin;
+LEPop. LineElement ::= LinePop;
+
+LNode. LineNode ::= Entity AssociatedWith Node ;
+LJoin. LineJoin ::= TableColumn AssociatedWith TableColumn ;
+LPop. LinePop ::= "^" ;
rules Entity ::= Table | Column | TableColumn ;
-rules XPath ::= Element | Attribute ;
-rules Element ::= Identifier | Identifier "/" Element ;
+NodeElem. Node ::= Element ;
+NodeAttr. Node ::= Attribute ;
-rules Where ::= Expression | Expression LogicalOp Expression ;
+ElIdent. Element ::= Identifier ;
+ElPath. Element ::= Identifier "/" Element ;
-EEq. Expression ::= TableColumn "=" AllValues ;
-EIneq. Expression ::= TableColumn "<>" AllValues ;
-ELt. Expression ::= TableColumn "<" Value ;
-EGt. Expression ::= TableColumn ">" Value ;
-ELtEq. Expression ::= TableColumn "<=" Value ;
-EGtEq. Expression ::= TableColumn ">=" Value ;
+WCompEq. ComparatorOperatorEquality ::= "=" ;
+WCompNeq. ComparatorOperatorEquality ::= "<>" ;
-rules LogicalOp ::= "&&" | "||" ;
+WCompLt. ComparatorOperator ::= "<" ;
+WCompGt. ComparatorOperator ::= ">" ;
+WCompLte. ComparatorOperator ::= "<=" ;
+WCompGte. ComparatorOperator ::= ">=" ;
-rules AllValues ::= Value | Set ;
+WAnd. LogicalOp ::= "&&" ;
+WOr. LogicalOp ::= "||" ;
+
+WEmpty. Where ::= "" ;
+WEq. Where ::= TableColumn ComparatorOperatorEquality AllValues ;
+WComp. Where ::= TableColumn ComparatorOperator Value ;
+WLogic. Where ::= Where LogicalOp Where ;
+WParen. Where ::= "(" Where ")" ;
+
+VValue. AllValues ::= Value ;
+VSet. AllValues ::= Set ;
+
rules Value ::= Parameter | "null" | String | Double ;
Delta 48 lines added, 23 lines removed, 25-line increase