As you (JSONiq GSOC students) look at extending the xquery-grammar.jj [1] file for JSONiq, just remember to check the specification for specifics [2]. The specification has a nice syntax block at the beginning of the construction chapter. Also, check out the JavaCC documentation [3] if you need to catch up on our parser.
Post if you have any questions. Also, post the final pull request for the data model implementations. [1] https://github.com/apache/vxquery/blob/master/vxquery-core/src/main/javacc/xquery-grammar.jj [2] http://jsoniq.org/docs/JSONiqExtensionToXQuery/html-single/index.html#section-json-value-construction [3] https://javacc.java.net/
