Hi,

I made some changes to the array constructor in grammar.jj in [1]. I debug it and I get the array that I put as input, so I guess it parses it correctly. I have the same question as Riyafa, regarding the translator. It is not so clear to me how I can create a translate method.

[1] https://github.com/apache/vxquery/pull/48

Thank you,
Christina

On 05/29/2016 07:40 AM, Riyafa Abdul Hameed wrote:
Hi,

I have created a pull request with the Object constructor
implementation[1]. Since I cannot create a duplicate token of kind "{", I
have attempted to use <Lbrace>. When I build the code and try to debug to
see if the parser recognizes an object, a parserexception is thrown. I have
also tried using <LbraceExprEnclosure>. But as I understand both are not
START_TAGs. How can I change the grammar so that token "{" would be
recognized as a START_TAG to be processed by the MainModule() of the
parser.

Also a translate method for object constructor in the class
XMLQueryTranslator needs to be created. I am not sure I understand how that
should be done. Kindly provide any guidance.

[1] https://github.com/apache/vxquery/pull/47

Thank you.

Yours sincerely,
Riyafa

On 24 May 2016 at 00:03, Riyafa Abdul Hameed <[email protected]>
wrote:

Hi,

I have been attempting to extend the xquery-grammar.jj file to support
JSONiq object constructor[1]. As I understand we need to create classes
that extends ASTNode class in the package org.apache.vxquery.xmlquery.ast
to be able to return ASTNode objects by the ObjectConstructor--currently it
returns nothing. I hope it needs to be discussed what classes to be
created. Correct me if I am mistaken.

[1] https://github.com/apache/vxquery/pull/44
<https://github.com/apache/vxquery/pull/40>

Thank you.

Yours sincerely,
Riyafa

On 17 May 2016 at 22:57, Preston Carman <[email protected]> wrote:

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/



--
Riyafa Abdul Hameed
Undergraduate, University of Moratuwa

Email: [email protected]
Website: https://riyafa.wordpress.com/ <http://riyafa.wordpress.com/>
<http://facebook.com/riyafa.ahf>  <http://lk.linkedin.com/in/riyafa>
<http://twitter.com/Riyafa1>




Reply via email to