Dave Jarvis' Repositories

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

Added example code to help write BNF.

Author Dave Jarvis <email>
Date 2015-02-04 22:45:01 GMT-0800
Commit bba3633c37da264b7b5e9e4f38be7b22a3200ad3
Parent 708dfd8
example.txt
+# Syntax does not include comments.
+
+root > people, # "root" is a special keyword
+person > person, # > is a node to table relation
+person.first_name -> name/first, # -> is a node/attribute to column relation
+person.last_name -> name/last,
+person.age -> [@age],
+account.person_id => person.person_id, # => is a join
+account > person/account,
+account.id -> [@id]; # ; starts the WHERE clause
+
+# Where clause syntax
+
+account.id = :id # : starts a named parameter
+account.id != :id # inequality parameter comparison
+account.id = {:id, 1} # { ... } denotes set (IN)
+account.id = null # null keyword
+account.id = null # becomes IS NULL
+account.id != null # becomes IS NOT NULL
+account.id = 'text' # string equality comparison
+account.id = -42 # numeric equality comparison
+account.id < 42 # numeric less than comparison
+account.id > 42 # numeric greater than comparison
+account.id <= 42 # numeric less than or equal to comparison
+account.id >= 42 # numeric greater than or equal to comparison
+
Delta 26 lines added, 0 lines removed, 26-line increase