Github user afs commented on a diff in the pull request:

    https://github.com/apache/jena/pull/114#discussion_r49002105
  
    --- Diff: jena-arq/Grammar/master.jj ---
    @@ -327,6 +359,35 @@ void AskQuery() : {}
       SolutionModifier()
     }
     
    +void JsonQuery() : {}
    +{
    +  JsonClause()
    +  ( DatasetClause() )*
    +  WhereClause()
    +  SolutionModifier()
    +}
    +
    +void JsonClause() : { Object o ; String s ; }
    +{
    +  <JSON> { getQuery().setQueryJsonType() ; }
    +  <LBRACE>
    +  s = String() < PNAME_NS >
    +  (
    --- End diff --
    
    Yes - javacc will tokenize to PNAME_NS.  These is no COLON and if there 
were, theer would be other problems.
    
    I have a devious idea!
    
    Use the  PNAME_NS and follow with a java fragment that does additional 
checking:
    ```
       t = <PNAME_NS>
       { 
           if ( t.image is not exactly a ":" )
              throwParseException("message",  t.beginLine, t.beginColumn)
       }
    ```
    This then restricts the legal token and means you won't to have to play 
complicated games with javacc to switch to a different token set (if that is 
even possible due to lookahead of characters).



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to