On 08/06/15 10:27, Qihong Lin wrote:
Hi,

The grammar has been modified for the problems you pointed out.
I've tried to run grammar script to generate arq.jj, sparql_11.jj and
their parser java classes, in cygwin with JavaCC 5.0. However the
generated java classes are different from those in the code base:
1) ARQParser
- the new generated one:
public class ARQParser extends ARQParserBase implements ARQParserConstants
- the old one in the code base:
public class ARQParser extends ARQParserBase

Ignore that difference - "implements ARQParserConstants" is fine and correct.

(ARQParserBase implements ARQParserConstants)

ARQParser got modified in some code clean up and should not have been.

There's no such difference for SPARQLParser11 (both new and old ones
have "implements ...")

Good.

2) checksum for Token, ParseException, JavaCharStream and so on
- the new generated one (Token.java):
/* JavaCC - OriginalChecksum=335d1922781852977208d5cdca0fc164 (do not
edit this line) */
- the old one in the code base (Token.java):
/* JavaCC - OriginalChecksum=d9b4c8c9332fa3054a004615fdb22b89 (do not
edit this line) */

I have no idea what the checksum is a checksum of!

If the line endings are different, the checksums might be affected.

The log from grammar script seems OK:

$ ./grammar
---- Process grammar -- sparql_11.jj
Java Compiler Compiler Version 5.0 (Parser Generator)

Ok - version 5.0.

(type "javacc" with no arguments for help)
Reading from file sparql_11.jj . . .
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "JavaCharStream.java" does not exist.  Will create one.
Parser generated successfully.
---- Create text form
Java Compiler Compiler Version 5.0 (Documentation Generator Version 0.1.4)
(type "jjdoc" with no arguments for help)
Reading from file sparql_11.jj . . .
Grammar documentation generated successfully in sparql_11.txt
---- Fixing Java warnings in TokenManager ...
---- Fixing Java warnings in Token ...
---- Fixing Java warnings in TokenMgrError ...
---- Fixing Java warnings in SPARQLParser11 ...
---- Done
---- Process grammar -- arq.jj
Java Compiler Compiler Version 5.0 (Parser Generator)
(type "javacc" with no arguments for help)
Reading from file arq.jj . . .
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "JavaCharStream.java" does not exist.  Will create one.

"does not exist" is to be expected. The script deletes old files before it runs javacc to ensure everything is clean.

Parser generated successfully.
---- Create text form
Java Compiler Compiler Version 5.0 (Documentation Generator Version 0.1.4)
(type "jjdoc" with no arguments for help)
Reading from file arq.jj . . .
Grammar documentation generated successfully in arq.txt
---- Fixing Java warnings in TokenManager ...
---- Fixing Java warnings in Token ...
---- Fixing Java warnings in TokenMgrError ...
---- Fixing Java warnings in ARQParser ...
---- Done

Is that the expected behavior for the grammar script? Anything wrong?

looks good.

If the ARQ test suite runs, it should be good.

cd jena-arq ; mvn clean test


regard,
Qihong


On Sat, Jun 6, 2015 at 11:05 AM, Ying Jiang <[email protected]> wrote:
Hi,

The grammar needs revisions in some way. For example, in your
proposal, the GRAPH token can be optional. Another problem for default
graph: both  { ?s :p ?o } and  ?s :p ?o are valid, so QuadsNotTriples
should be re-defined.

On the other hand, you can start playing with the code of master.jj.
There's no need to wait until the grammar is ready. Your code is
supposed to be delivered as soon as possible. We can have early
feedback from the end users. Merging early will also reduce any
problems with several people changing the same file.

Best regards,
Ying Jiang

On Fri, Jun 5, 2015 at 6:25 PM, Qihong Lin <[email protected]> wrote:
Hi,

I added the grammar draft at the end of [1]. There're actually minor
changes on the grammar of ConstructQuery, which are marked red. Much
of the grammar from SPARQL INSERT can be reused, related to Quads. Any
comments?


regards,
Qihong

[1] 
https://docs.google.com/document/d/1KiDlfxMq5ZsU7vj7ZDm10yC96OZgdltwmZAZl56sTw0

Reply via email to