You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2020/06/19 16:13:26 UTC
[jena] branch master updated: JENA-1921: SHACL Compact Syntax parser
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jena.git
The following commit(s) were added to refs/heads/master by this push:
new da153a4 JENA-1921: SHACL Compact Syntax parser
new af6e0c5 Merge pull request #760 from afs/shaclc
da153a4 is described below
commit da153a4bbf5759ef94fbf2699bc8e8389fb03e9c
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Wed Jun 17 22:45:53 2020 +0100
JENA-1921: SHACL Compact Syntax parser
---
.../src/main/java/org/apache/jena/riot/Lang.java | 2 -
.../java/org/apache/jena/riot/RDFLanguages.java | 37 +-
.../org/apache/jena/riot/RDFParserRegistry.java | 4 +-
jena-shacl/shaclc/README | 17 +
jena-shacl/shaclc/shaclc-parser | 39 +
jena-shacl/shaclc/shaclc.jj | 626 +++++
.../ReaderRIOTShaclc.java} | 22 +-
.../java/org/apache/jena/shacl/compact/SHACLC.java | 61 +
.../jena/shacl/compact/ShaclCompactParser.java | 528 ++++
.../apache/jena/shacl/compact/ShaclcParser.java | 131 +
.../jena/shacl/compact/parser/ParseException.java | 205 ++
.../shacl/compact/parser/ShaclCompactParserJJ.java | 1579 +++++++++++
.../parser/ShaclCompactParserJJConstants.java | 259 ++
.../parser/ShaclCompactParserJJTokenManager.java | 2947 ++++++++++++++++++++
.../shacl/compact/parser/SimpleCharStream.java | 492 ++++
.../apache/jena/shacl/compact/parser/Token.java | 149 +
.../jena/shacl/compact/parser/TokenMgrError.java | 165 ++
.../org/apache/jena/shacl/engine/ShaclPaths.java | 9 +-
.../main/java/org/apache/jena/shacl/lib/ShLib.java | 1 +
.../java/org/apache/jena/shacl/parser/Shape.java | 7 +-
.../org/apache/jena/shacl/parser/ShapesParser.java | 3 +-
.../java/org/apache/jena/shacl/sys/InitShacl.java | 5 +-
.../test/java/org/apache/jena/shacl/TC_SHACL.java | 2 +
.../jena/shacl/compact/TestShaclCompact.java | 95 +
jena-shacl/testing/shaclc-valid/array-in.shaclc | 7 +
jena-shacl/testing/shaclc-valid/array-in.ttl | 19 +
.../testing/shaclc-valid/basic-shape-iri.shaclc | 4 +
.../testing/shaclc-valid/basic-shape-iri.ttl | 14 +
.../shaclc-valid/basic-shape-with-target.shaclc | 6 +
.../shaclc-valid/basic-shape-with-target.ttl | 16 +
.../shaclc-valid/basic-shape-with-targets.shaclc | 7 +
.../shaclc-valid/basic-shape-with-targets.ttl | 19 +
jena-shacl/testing/shaclc-valid/basic-shape.shaclc | 6 +
jena-shacl/testing/shaclc-valid/basic-shape.ttl | 15 +
jena-shacl/testing/shaclc-valid/class.shaclc | 7 +
jena-shacl/testing/shaclc-valid/class.ttl | 19 +
jena-shacl/testing/shaclc-valid/comment.shaclc | 8 +
jena-shacl/testing/shaclc-valid/comment.ttl | 15 +
jena-shacl/testing/shaclc-valid/complex1.shaclc | 15 +
jena-shacl/testing/shaclc-valid/complex1.ttl | 48 +
jena-shacl/testing/shaclc-valid/complex2.shaclc | 15 +
jena-shacl/testing/shaclc-valid/complex2.ttl | 47 +
jena-shacl/testing/shaclc-valid/count-0-1.shaclc | 7 +
jena-shacl/testing/shaclc-valid/count-0-1.ttl | 19 +
.../testing/shaclc-valid/count-0-unlimited.shaclc | 7 +
.../testing/shaclc-valid/count-0-unlimited.ttl | 18 +
jena-shacl/testing/shaclc-valid/count-1-2.shaclc | 7 +
jena-shacl/testing/shaclc-valid/count-1-2.ttl | 20 +
.../testing/shaclc-valid/count-1-unlimited.shaclc | 7 +
.../testing/shaclc-valid/count-1-unlimited.ttl | 19 +
jena-shacl/testing/shaclc-valid/datatype.shaclc | 8 +
jena-shacl/testing/shaclc-valid/datatype.ttl | 23 +
jena-shacl/testing/shaclc-valid/directives.shaclc | 6 +
jena-shacl/testing/shaclc-valid/directives.ttl | 13 +
jena-shacl/testing/shaclc-valid/empty.shaclc | 0
jena-shacl/testing/shaclc-valid/empty.ttl | 9 +
jena-shacl/testing/shaclc-valid/nestedShape.shaclc | 9 +
jena-shacl/testing/shaclc-valid/nestedShape.ttl | 26 +
jena-shacl/testing/shaclc-valid/node-or-2.shaclc | 7 +
jena-shacl/testing/shaclc-valid/node-or-2.ttl | 16 +
.../testing/shaclc-valid/node-or-3-not.shaclc | 7 +
jena-shacl/testing/shaclc-valid/node-or-3-not.ttl | 20 +
jena-shacl/testing/shaclc-valid/nodeKind.shaclc | 8 +
jena-shacl/testing/shaclc-valid/nodeKind.ttl | 23 +
.../testing/shaclc-valid/path-alternative.shaclc | 7 +
.../testing/shaclc-valid/path-alternative.ttl | 18 +
.../testing/shaclc-valid/path-complex.shaclc | 7 +
jena-shacl/testing/shaclc-valid/path-complex.ttl | 18 +
.../testing/shaclc-valid/path-inverse.shaclc | 7 +
jena-shacl/testing/shaclc-valid/path-inverse.ttl | 18 +
.../testing/shaclc-valid/path-oneOrMore.shaclc | 7 +
jena-shacl/testing/shaclc-valid/path-oneOrMore.ttl | 18 +
.../testing/shaclc-valid/path-sequence.shaclc | 7 +
jena-shacl/testing/shaclc-valid/path-sequence.ttl | 18 +
.../testing/shaclc-valid/path-zeroOrMore.shaclc | 7 +
.../testing/shaclc-valid/path-zeroOrMore.ttl | 18 +
.../testing/shaclc-valid/path-zeroOrOne.shaclc | 7 +
jena-shacl/testing/shaclc-valid/path-zeroOrOne.ttl | 18 +
.../testing/shaclc-valid/property-empty.shaclc | 7 +
jena-shacl/testing/shaclc-valid/property-empty.ttl | 18 +
.../testing/shaclc-valid/property-not.shaclc | 7 +
jena-shacl/testing/shaclc-valid/property-not.ttl | 19 +
.../testing/shaclc-valid/property-or-2.shaclc | 8 +
jena-shacl/testing/shaclc-valid/property-or-2.ttl | 23 +
.../testing/shaclc-valid/property-or-3.shaclc | 7 +
jena-shacl/testing/shaclc-valid/property-or-3.ttl | 19 +
jena-shacl/testing/shaclc-valid/shapeRef.shaclc | 7 +
jena-shacl/testing/shaclc-valid/shapeRef.ttl | 19 +
88 files changed, 8233 insertions(+), 27 deletions(-)
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/Lang.java b/jena-arq/src/main/java/org/apache/jena/riot/Lang.java
index 6ffe04e..625e970 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/Lang.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/Lang.java
@@ -144,13 +144,11 @@ public class Lang
return false ;
Lang otherLang = (Lang)other ;
- // Just label should be enough.
return
this.label == otherLang.label &&
this.contentType.equals(otherLang.contentType) &&
this.altContentTypes.equals(otherLang.altContentTypes) &&
this.fileExtensions.equals(otherLang.fileExtensions) ;
- // File extensions and alt
}
public String getName() { return label ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java b/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java
index 295158a..c33d9de 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java
@@ -255,6 +255,10 @@ public class RDFLanguages
{
if ( lang == null )
throw new IllegalArgumentException("null for language") ;
+ // Expel previous registration.
+ if ( isMimeTypeRegistered(lang) )
+ unregister(lang);
+
checkRegistration(lang) ;
mapLabelToLang.put(canonicalKey(lang.getLabel()), lang) ;
@@ -273,23 +277,35 @@ public class RDFLanguages
}
}
+ private static boolean isMimeTypeRegistered(Lang lang) {
+ if ( lang == null )
+ return false;
+ String mimeType = canonicalKey(lang.getHeaderString());
+ return mapContentTypeToLang.containsKey(mimeType);
+ }
+
+ /** Make sure the registration does not overlap or interfere with an existing registration. */
private static void checkRegistration(Lang lang)
{
if ( lang == null )
return ;
String label = canonicalKey(lang.getLabel()) ;
- Lang lang2 = mapLabelToLang.get(label) ;
- if ( lang2 == null )
+ Lang existingRegistration = mapLabelToLang.get(label) ;
+ if ( existingRegistration == null )
return ;
- if ( lang.equals(lang2) )
+ if ( lang.equals(existingRegistration) )
return ;
- // Content type.
- if ( mapContentTypeToLang.containsKey(lang.getContentType().getContentTypeStr()))
+
+ // Is the content type already registered?
+ if ( isMimeTypeRegistered(lang) )
{
- String k = lang.getContentType().getContentTypeStr() ;
- error("Language overlap: " +lang+" and "+mapContentTypeToLang.get(k)+" on content type "+k) ;
+ String contentType = lang.getContentType().getContentTypeStr();
+ error("Language overlap: " +lang+" and "+mapContentTypeToLang.get(contentType)+" on content type "+contentType) ;
+ return;
}
+
+ // Check for clashes.
for (String altName : lang.getAltNames() )
if ( mapLabelToLang.containsKey(altName) )
error("Language overlap: " +lang+" and "+mapLabelToLang.get(altName)+" on name "+altName) ;
@@ -301,15 +317,14 @@ public class RDFLanguages
error("Language overlap: " +lang+" and "+mapFileExtToLang.get(ext)+" on file extension type "+ext) ;
}
- /** Remove a registration of a language - this also removes all recorded mapping
+ /**
+ * Remove a registration of a language - this also removes all recorded mapping
* of content types and file extensions.
*/
-
public static void unregister(Lang lang)
{
if ( lang == null )
throw new IllegalArgumentException("null for language") ;
- checkRegistration(lang) ;
mapLabelToLang.remove(canonicalKey(lang.getLabel())) ;
mapContentTypeToLang.remove(canonicalKey(lang.getContentType().getContentTypeStr())) ;
@@ -319,6 +334,7 @@ public class RDFLanguages
mapFileExtToLang.remove(canonicalKey(ext)) ;
}
+ /** Is this language registered? */
public static boolean isRegistered(Lang lang)
{
if ( lang == null )
@@ -327,7 +343,6 @@ public class RDFLanguages
Lang lang2 = mapLabelToLang.get(label) ;
if ( lang2 == null )
return false ;
- checkRegistration(lang) ;
return true ;
}
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/RDFParserRegistry.java b/jena-arq/src/main/java/org/apache/jena/riot/RDFParserRegistry.java
index 612d506..1fc6710 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/RDFParserRegistry.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/RDFParserRegistry.java
@@ -117,7 +117,7 @@ public class RDFParserRegistry
langToParserFactory.put(lang, factory) ;
}
- /** Register a language and it's parser factory.
+ /** Register a language and its parser factory.
* To create a {@link Lang} object use {@link LangBuilder}.
*/
public static void registerLangTriples(Lang lang, ReaderRIOTFactory factory)
@@ -126,7 +126,7 @@ public class RDFParserRegistry
registerLang(lang, factory) ;
}
- /** Register a language and it's parser factory.
+ /** Register a language and its parser factory.
* To create a {@link Lang} object use {@link LangBuilder}.
*/
public static void registerLangQuads(Lang lang, ReaderRIOTFactory factory)
diff --git a/jena-shacl/shaclc/README b/jena-shacl/shaclc/README
new file mode 100644
index 0000000..fa10b11
--- /dev/null
+++ b/jena-shacl/shaclc/README
@@ -0,0 +1,17 @@
+== SHACLC parser
+
+The SHACLC parser tarnslates shaclc synatx into an RDF graph (rather than
+creating the shapes tree directly).
+
+To make the SHACLC parser:
+
+Run the script
+
+ shaclc-parser
+
+which runs javacc to create the parser in
+../src/main/java/org/apache/jena/shacl/compact/parser
+
+and cleans up the output files to remove or surpress Java warnings.
+
+
diff --git a/jena-shacl/shaclc/shaclc-parser b/jena-shacl/shaclc/shaclc-parser
new file mode 100755
index 0000000..d78d623
--- /dev/null
+++ b/jena-shacl/shaclc/shaclc-parser
@@ -0,0 +1,39 @@
+#!/bin/bash
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+if [ $# -gt 1 ]
+then
+ echo "Usage: $0 FILE" 1>&2
+ exit 1
+ fi
+
+
+FILE="${1:-shaclc.jj}"
+DIR=../src/main/java/org/apache/jena/shacl/compact/parser
+
+rm -f "$DIR"/*
+
+javacc -OUTPUT_DIRECTORY=$DIR -JDK_VERSION=1.8 "${FILE}"
+RC=$?
+if [ "$RC" -ne 0 ]
+then
+ exit
+fi
+
+## Fixup.
+#Token.java : public String toString()
+#TokenMgrError.java : public String getMessage()
+
+echo "---- Fixing Java warnings in Token ..."
+F="$DIR/Token.java"
+sed -e 's/@Override //' \
+ -e 's/public String toString/@Override public String toString/' < $F > F
+mv F $F
+
+echo "---- Fixing Java warnings in TokenMgrError ..."
+# Override:
+# public String getMessage()
+F="$DIR/TokenMgrError.java"
+sed -e 's/@Override //' \
+ -e 's/public String getMessage/@Override public String getMessage/' < $F > F
+mv F $F
diff --git a/jena-shacl/shaclc/shaclc.jj b/jena-shacl/shaclc/shaclc.jj
new file mode 100644
index 0000000..c4de808
--- /dev/null
+++ b/jena-shacl/shaclc/shaclc.jj
@@ -0,0 +1,626 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+options
+{
+ // \ u processed in the input stream
+// JAVA_UNICODE_ESCAPE = true ;
+// UNICODE_INPUT = false ;
+
+ // \ u processed after parsing.
+ // strings, prefix names, IRIs
+ JAVA_UNICODE_ESCAPE = false ;
+ // ???
+ UNICODE_INPUT = true ;
+
+ STATIC = false ;
+// DEBUG_PARSER = true ;
+// DEBUG_TOKEN_MANAGER = true ;
+}
+
+PARSER_BEGIN(ShaclCompactParserJJ)
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact.parser;
+
+import java.util.List;
+import java.util.ArrayList;
+import org.apache.jena.graph.*;
+import org.apache.jena.sparql.path.*;
+import org.apache.jena.shacl.compact.*;
+
+public class ShaclCompactParserJJ extends ShaclCompactParser
+{}
+PARSER_END(ShaclCompactParserJJ)
+
+void Unit(): { }
+{
+ ByteOrderMark()
+ shaclDoc()
+ <EOF>
+}
+
+void ByteOrderMark() : {}
+{
+ (<BOM>)?
+}
+
+void shaclDoc() : {}
+{
+ (directive())*
+ (nodeShape()|shapeClass())*
+}
+
+void directive() : {}
+{
+ ( baseDecl() | prefixDecl() | importDecl() )
+}
+
+void baseDecl() : { String iri ; }
+{
+ <BASE> iri = IRIREF()
+ { getPrologue().setBaseURI(iri) ; }
+}
+
+void prefixDecl() : { Token t ; String iri ; }
+{
+ <PREFIX> t = <PNAME_NS> iri = IRIREF()
+ { String s = fixupPrefix(t.image, t.beginLine, t.beginColumn) ;
+ getPrologue().setPrefix(s, iri) ; }
+}
+
+void importDecl() : { String iri ; }
+{
+ <IMPORTS> iri = iri()
+ { rImports(iri); }
+}
+
+void nodeShape() : { String iri; }
+{
+ { startNodeShape(); }
+ <SHAPE> iri = iri()
+ { rNodeShape(iri); }
+ (targetClass())? nodeShapeBody()
+ { finishNodeShape(); }
+}
+
+void shapeClass() : { String iri; }
+{
+ { startShapeClass(); }
+ <SHAPE_CLASS> iri = iri()
+ { rShapeClass(iri); }
+ nodeShapeBody()
+ { finishShapeClass(); }
+}
+
+void targetClass() : { String iri; }
+{
+ "->" (iri = iri() { rTargetClass(iri); } )+
+}
+
+void nodeShapeBody() : {}
+{
+ { startNodeShapeBody() ; }
+ <LBRACE> (constraint())* <RBRACE>
+ { finishNodeShapeBody() ; }
+}
+
+void constraint() : { }
+{
+ { startConstraint(); }
+ ( (nodeOr())+ | propertyShape() )
+ { finishConstraint() ; }
+ <DOT>
+}
+
+void nodeOr() : { }
+{
+ { startNodeOr(); }
+ { rNodeOr_pre(); } nodeNot() { rNodeOr_post(); }
+ (
+ <VBAR>
+ { rNodeOr_pre(); } nodeNot() { rNodeOr_post(); }
+ )*
+ { finishNodeOr(); }
+}
+
+void nodeNot() : { boolean b = false; }
+{
+ { startNodeNot(); }
+ ( negation() { b = true; } )?
+ { beginNodeNot(b); }
+ nodeValue()
+ { finishNodeNot(b); }
+}
+
+void negation():{}
+{
+ <BANG>
+}
+
+void nodeValue() : { String s; Node n; List<Node> x; }
+{
+ s = nodeParam()
+ <EQUALS>
+ //value = iriOrLiteralOrArray()
+ (
+ n = iriOrLiteral() { rNodeValue(s, n); }
+ |
+ x = array() { rNodeValue(s, x); }
+ )
+}
+
+void propertyShape() : { Path p ; }
+{
+ { startPropertyShape(); }
+ p = path()
+ { rPropertyShape(p); }
+ ( propertyCount() | propertyOr() )*
+ { finishPropertyShape(); }
+}
+
+void propertyOr() : { }
+{
+ { startPropertyOr(); }
+
+ { rPropertyOr_pre(); }
+ propertyNot()
+ { rPropertyOr_post(); }
+
+ ( <VBAR>
+ { rPropertyOr_pre(); } propertyNot() { rPropertyOr_post(); }
+ )*
+ { finishPropertyOr(); }
+}
+
+void propertyNot() : { boolean b = false; }
+{
+ { startPropertyNot(); }
+ (negation() { b = true; } )?
+ { beginPropertyNot(b); }
+ propertyAtom()
+ { finishPropertyNot(b); }
+}
+
+void propertyAtom() : { }
+{
+ // Work on currentPropertyShape()
+ propertyType() | nodeKind() | shapeRef() | propertyValue() |
+ ( { startNestedPropertyAtom(); } nodeShapeBody() { finishNestedPropertyAtom(); })
+}
+
+void propertyCount() : { String s1, s2; }
+{
+ <LBRACKET> s1 = propertyMinCount() ".." s2 = propertyMaxCount() <RBRACKET>
+ { rPropertyCount(s1, s2); }
+}
+
+String propertyMinCount() : { Token t; } { t = <INTEGER> { return t.image; } }
+String propertyMaxCount() : { Token t; } { ( t = <INTEGER> | t = <STAR> ) { return t.image; } }
+
+void propertyType() : { String iriStr; }
+{
+ iriStr = iri()
+ { rPropertyType(iriStr); }
+}
+
+void nodeKind() : { Token t; }
+{
+ (
+ t = "BlankNode" |
+ t = "IRI" |
+ t = "Literal" |
+ t = "BlankNodeOrIRI" |
+ t = "BlankNodeOrLiteral" |
+ t = "IRIOrLiteral"
+ )
+ { rNodeKind(t.image); }
+}
+
+void shapeRef() : { Token t; String iriStr; }
+{
+ // consistent WS handling.?
+ ( t = <ATPNAME_LN>
+ { iriStr = resolvePName(t.image.substring(1), t.beginLine, t.beginColumn) ; }
+ | t = <ATPNAME_NS>
+ { iriStr = resolvePName(t.image.substring(1), t.beginLine, t.beginColumn) ; }
+ | <AT> iriStr= IRIREF()
+ )
+ //<AT> iriStr = iri()
+ { rShapeRef(iriStr); }
+}
+
+void propertyValue() : { String s; Node n; List<Node> x; }
+{
+ s = nodeParam()
+ <EQUALS>
+ //value = iriOrLiteralOrArray()
+ (
+ n = iriOrLiteral() { rParamValue(s, n); }
+ |
+ x = array() { rParamValue(s, x); }
+ )
+}
+
+// Assemble items to build with from hereon down.
+// Return Java objects.
+
+String nodeParam() : { Token t ;}
+{
+ (
+ t = "targetNode" | t = "targetObjectsOf" | t = "targetSubjectsOf" |
+ t = "deactivated" | t = "severity" | t = "message" |
+ t = "class" | t = "datatype" | t = "nodeKind" |
+ t = "minExclusive" | t = "minInclusive" | t = "maxExclusive" | t = "maxInclusive" |
+ t = "minLength" | t = "maxLength" | t = "pattern" | t = "flags" | t = "languageIn" |
+ t = "equals" | t = "disjoint" |
+ t = "closed" | t = "ignoredProperties" | t = "hasValue" | t = "in"
+ )
+ { return t.image ; }
+}
+
+String propertyParam() : { Token t; }
+{
+ (
+ t = "deactivated" | t = "severity" | t = "message" |
+ t = "class" | t = "datatype" | t = "nodeKind" |
+ t = "minExclusive" | t = "minInclusive" | t = "maxExclusive" | t = "maxInclusive" |
+ t = "minLength" | t = "maxLength" | t = "pattern" | t = "flags" | t = "languageIn" | t = "uniqueLang" |
+ t = "equals" | t = "disjoint" | t = "lessThan" | t = "lessThanOrEquals" |
+ t = "qualifiedValueShape" | t = "qualifiedMinCount" | t = "qualifiedMaxCount" | t = "qualifiedValueShapesDisjoint" |
+ t = "closed" | t = "ignoredProperties" | t = "hasValue" | t = "in"
+ )
+ { return t.image; }
+}
+
+// Paths - subset of SPARQL Paths - no negation, no path property sets.
+
+Path PathUnit() : { Path p ; }
+{
+ ByteOrderMark()
+ p = path()
+ <EOF>
+ { return p ; }
+}
+
+// Weakest outermost
+Path path() : { Path p ; }
+{
+ p = pathAlternative() { return p ; }
+}
+
+Path pathAlternative() : { Path p1 , p2 ; }
+{
+ p1 = pathSequence()
+ (
+ <VBAR> p2 = pathSequence()
+ { p1 = PathFactory.pathAlt(p1, p2) ; }
+ )*
+ { return p1 ; }
+}
+
+Path pathSequence() : { Path p1 , p2 ; }
+{
+ p1 = pathEltOrInverse()
+ ( <SLASH> p2 = pathEltOrInverse()
+ { p1 = PathFactory.pathSeq(p1, p2) ; }
+ )*
+ { return p1; }
+}
+
+// Path unit element, no inverse
+Path pathElt() : { String str ; Node n ; Path p ; }
+{
+ p = pathPrimary()
+ ( p = pathMod(p) )?
+ { return p ; }
+}
+
+// Path unit element, including inverse.
+Path pathEltOrInverse() : { String str ; Node n ; Path p ; }
+{
+ ( p = pathElt()
+ | <CARAT>
+ p = pathElt()
+ { p = PathFactory.pathInverse(p) ; }
+ )
+ { return p ; }
+}
+
+Path pathMod(Path p) : { long i1 ; long i2 ; }
+{
+ ( <QMARK> { return PathFactory.pathZeroOrOne(p) ; }
+ | <STAR> { return PathFactory.pathZeroOrMore1(p) ; }
+ | <PLUS> { return PathFactory.pathOneOrMore1(p) ; }
+ )
+}
+
+Path pathPrimary() : { String str ; Path p ; Node n ; }
+{
+ (
+ str = iri()
+ { n = createNode(str) ; p = PathFactory.pathLink(n) ; }
+ | <LPAREN> p = path() <RPAREN>
+ )
+ { return p ; }
+}
+
+// To preserve types, use ( iriOrLiteral() | array() ) directly
+// void iriOrLiteralOrArray() : {}
+// {
+// (
+// { Node n = null; }
+// n = iriOrLiteral()
+// { iriOrLiteralOrArray(n); }
+// |
+// { List<Node> x = null; }
+// x = array()
+// { iriOrLiteralOrArray(x); }
+// )
+// }
+
+List<Node> array() : { List<Node> x = new ArrayList<Node>(); Node n = null; }
+{
+ <LBRACKET>
+ ( n = iriOrLiteral()
+ { x.add(n); }
+ )*
+ <RBRACKET>
+ { return x; }
+}
+
+// Term generation
+
+Node iriOrLiteral() : { Node n; String uriStr; }
+{
+ ( uriStr = iri() { n = createNode(uriStr); } | n = literal() )
+ { return n ; }
+}
+
+Node literal() : { Node n ; }
+{
+ ( n = rdfLiteral() | n = numericLiteral() | n = booleanLiteral() )
+ { return n; }
+}
+
+Node booleanLiteral() : {}
+{
+ <TRUE> { return XSD_TRUE ; }
+ |
+ <FALSE> { return XSD_FALSE ; }
+}
+
+Node numericLiteral() : { Token t ;}
+{
+ t = <INTEGER> { return createLiteralInteger(t.image) ; }
+ | t = <DECIMAL> { return createLiteralDecimal(t.image) ; }
+ | t = <DOUBLE> { return createLiteralDouble(t.image) ; }
+}
+
+Node rdfLiteral() : { Token t ; String lex = null ; }
+{
+ lex = string()
+ // Optional lang tag and datatype.
+ { String lang = null ; String dt = null ; }
+ (
+ ( t = <LANGTAG> { lang = stripChars(t.image, 1) ; } )
+ |
+ ( "^^" dt = datatype() )
+ )?
+ { return createLiteral(lex, lang, dt) ; }
+}
+
+String datatype() : { String s; }
+{
+ s = iri()
+ { return s; }
+}
+
+String string() : { Token t ; String lex ; }
+{
+ ( t = <STRING_LITERAL1> { lex = stripQuotes(t.image) ; }
+ | t = <STRING_LITERAL2> { lex = stripQuotes(t.image) ; }
+ | t = <STRING_LITERAL_LONG1> { lex = stripQuotes3(t.image) ; }
+ | t = <STRING_LITERAL_LONG2> { lex = stripQuotes3(t.image) ; }
+ )
+ {
+ lex = unescapeStr(lex, t.beginLine, t.beginColumn) ;
+ return lex ;
+ }
+}
+
+String iri() : { String iri = null; }
+{
+ iri = IRIREF() { return iri ; }
+|
+ iri = PrefixedName() { return iri ; }
+}
+
+String PrefixedName() : { Token t ; }
+{
+ ( t = <PNAME_LN>
+ { return resolvePName(t.image, t.beginLine, t.beginColumn) ; }
+ |
+ t = <PNAME_NS>
+ { return resolvePName(t.image, t.beginLine, t.beginColumn) ; }
+ )
+}
+
+String IRIREF() : { Token t ; }
+{
+ t = <IRIref>
+ { return resolveQuotedIRI(t.image, t.beginLine, t.beginColumn) ; }
+}
+
+
+SKIP : { " " | "\t" | "\n" | "\r" | "\f" }
+
+SPECIAL_TOKEN :
+{ <SINGLE_LINE_COMMENT: "#" (~["\n","\r"])* ("\n"|"\r"|"\r\n")? > }
+
+TOKEN: {
+ <BOM: "\uFEFF">
+}
+
+TOKEN [IGNORE_CASE] :
+{
+ // Keywords
+ <BASE : "BASE" >
+| <IMPORTS : "IMPORTS">
+| <PREFIX : "PREFIX">
+
+| <SHAPE_CLASS : "shapeClass">
+| <SHAPE : "shape">
+| <TRUE : "true">
+| <FALSE : "false">
+}
+
+TOKEN:
+{
+ <#HEX : ["0"-"9"] | ["A"-"F"] | ["a"-"f"] >
+| <PLUS : "+" >
+| <MINUS : "-" >
+| <VBAR : "|" >
+| <AT : "@">
+| <CARAT : "^">
+| <DOT : ".">
+| <BANG : "!">
+| <QMARK : "?">
+| <SLASH : "/">
+| <STAR : "*">
+| <EQUALS : "=">
+| <LPAREN : "(" >
+| <RPAREN : ")" >
+| <LBRACE : "{" >
+| <RBRACE : "}" >
+| <LBRACKET : "[" >
+| <RBRACKET : "]" >
+
+| <#UCHAR : "\\" ( "u" <HEX> <HEX> <HEX> <HEX> | "U" <HEX> <HEX> <HEX> <HEX> <HEX> <HEX> <HEX> <HEX> ) >
+| <IRIref : "<"
+ (~[ ">","<", "\"", "{", "}", "^", "\\", "|", "`","\u0000"-"\u0020"] | <UCHAR>)*
+ ">" >
+| <PNAME_NS : (<PN_PREFIX>)? ":" >
+| <PNAME_LN : <PNAME_NS> <PN_LOCAL> >
+
+// Better shapeRef - consistent WS.
+| <ATPNAME_NS : "@"<PNAME_NS> >
+| <ATPNAME_LN : "@"<PNAME_LN> >
+
+| <#QUOTE_3D: "\"\"\"">
+| <#QUOTE_3S: "'''">
+| <ECHAR : "\\" ( "t"|"b"|"n"|"r"|"f"|"\\"|"\""|"'") >
+
+| <STRING_LITERAL1:
+ // Single quoted string
+ "'" ( (~["'","\\","\n","\r"]) | <ECHAR> | <UCHAR> )* "'" >
+| <STRING_LITERAL2:
+ // Double quoted string
+ "\"" ( (~["\"","\\","\n","\r"]) | <ECHAR> | <UCHAR> )* "\"" >
+| <STRING_LITERAL_LONG1:
+ <QUOTE_3S>
+ ( ("'" | "''")? (~["'","\\"] | <ECHAR> | <UCHAR> ))*
+ <QUOTE_3S> >
+| <STRING_LITERAL_LONG2:
+ <QUOTE_3D>
+ ( ("\"" | "\"\"")? (~["\"","\\"] | <ECHAR> | <UCHAR>))*
+ <QUOTE_3D> >
+
+| <#DIGITS : (["0"-"9"])+>
+| <INTEGER : (<PLUS>|<MINUS>)? <DIGITS> >
+| <DECIMAL : (<PLUS>|<MINUS>)? (<DIGITS>)? "." <DIGITS> >
+| <DOUBLE : (<PLUS>|<MINUS>)?
+ ( (["0"-"9"])+ "." (["0"-"9"])* <EXPONENT>
+ | "." (["0"-"9"])+ (<EXPONENT>)
+ | (["0"-"9"])+ <EXPONENT>
+ ) >
+
+| <#EXPONENT : ["e","E"] (["+","-"])? (["0"-"9"])+ >
+
+| <LANGTAG: <AT> (<A2Z>)+("-" (<A2ZN>)+)* >
+| <#A2Z: ["a"-"z","A"-"Z"]>
+| <#A2ZN: ["a"-"z","A"-"Z","0"-"9"]>
+| <#PN_CHARS_BASE:
+ ["A"-"Z"] | ["a"-"z"] |
+ ["\u00C0"-"\u00D6"] | ["\u00D8"-"\u00F6"] | ["\u00F8"-"\u02FF"] |
+ ["\u0370"-"\u037D"] | ["\u037F"-"\u1FFF"] |
+ ["\u200C"-"\u200D"] | ["\u2070"-"\u218F"] | ["\u2C00"-"\u2FEF"] |
+ ["\u3001"-"\uD7FF"] | ["\uF900"-"\uFFFD"]
+ >
+ // [#x10000-#xEFFFF]
+|
+ // With underscore
+ <#PN_CHARS_U: <PN_CHARS_BASE> | "_" >
+|
+ <#PN_CHARS: (<PN_CHARS_U> | "-" | ["0"-"9"] | "\u00B7" |
+ ["\u0300"-"\u036F"] | ["\u203F"-"\u2040"] ) >
+|
+ // No leading "_", no trailing ".", can have dot inside prefix name.
+ <#PN_PREFIX: <PN_CHARS_BASE> ((<PN_CHARS>|".")* <PN_CHARS>)? >
+|
+ <#PN_LOCAL: (<PN_CHARS_U> | ":" | ["0"-"9"] | <PLX> )
+ ( (<PN_CHARS> | "." |":" | <PLX> )*
+ (<PN_CHARS> | ":" | <PLX>) )? >
+|
+ <#VARNAME: ( <PN_CHARS_U> | ["0"-"9"] )
+ ( <PN_CHARS_U> | ["0"-"9"] | "\u00B7" |
+ ["\u0300"-"\u036F"] | ["\u203F"-"\u2040"] )* >
+|
+ < #PN_LOCAL_ESC: "\\"
+ ( "_" |
+ "~" | "." | "-" | "!" | "$" | "&" | "'" |
+ "(" | ")" | "*" | "+" | "," | ";" | "=" |
+ "/" | "?" | "#" | "@" | "%" ) >
+|
+ <#PLX: <PERCENT> | <PN_LOCAL_ESC> >
+|
+ <#PERCENT : "%" <HEX> <HEX> >
+}
+
+// Catch-all tokens. Must be last.
+// Any non-whitespace. Causes a parser exception, rather than a
+// token manager error (which hides the line numbers).
+TOKEN:
+{
+ <#UNKNOWN: (~[" ","\t","\n","\r","\f" ])+ >
+}
+
+
+/*
+# Local Variables:
+# tab-width: 4
+# indent-tabs-mode: nil
+# comment-default-style: "//"
+# End:
+*/
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/sys/InitShacl.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/ReaderRIOTShaclc.java
similarity index 56%
copy from jena-shacl/src/main/java/org/apache/jena/shacl/sys/InitShacl.java
copy to jena-shacl/src/main/java/org/apache/jena/shacl/compact/ReaderRIOTShaclc.java
index 15c4d0e..ffbdb39 100644
--- a/jena-shacl/src/main/java/org/apache/jena/shacl/sys/InitShacl.java
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/ReaderRIOTShaclc.java
@@ -16,19 +16,27 @@
* limitations under the License.
*/
-package org.apache.jena.shacl.sys;
+package org.apache.jena.shacl.compact;
-import org.apache.jena.sys.JenaSubsystemLifecycle;
+import java.io.InputStream;
+import java.io.Reader;
-public class InitShacl implements JenaSubsystemLifecycle {
+import org.apache.jena.atlas.web.ContentType;
+import org.apache.jena.riot.ReaderRIOT;
+import org.apache.jena.riot.system.StreamRDF;
+import org.apache.jena.sparql.util.Context;
- public InitShacl() {}
+/**
+ * RIOT Reader for
+ * <a href="https://w3c.github.io/shacl/shacl-compact-syntax/">SHACL Compact Syntax</a>
+ */
+public class ReaderRIOTShaclc implements ReaderRIOT {
@Override
- public void start() {}
+ public void read(InputStream in, String baseURI, ContentType ct, StreamRDF output, Context context) {}
@Override
- public void stop() {}
+ public void read(Reader reader, String baseURI, ContentType ct, StreamRDF output, Context context) {}
- @Override public int level() { return 99; }
}
+
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/compact/SHACLC.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/SHACLC.java
new file mode 100644
index 0000000..ee4a865
--- /dev/null
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/SHACLC.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact;
+
+import java.io.InputStream;
+import java.io.Reader;
+
+import org.apache.jena.atlas.web.ContentType;
+import org.apache.jena.graph.Graph;
+import org.apache.jena.riot.*;
+import org.apache.jena.riot.system.ParserProfile;
+import org.apache.jena.riot.system.StreamRDF;
+import org.apache.jena.riot.system.StreamRDFOps;
+import org.apache.jena.sparql.util.Context;
+
+/** SHACL Compact Syntax setup */
+public class SHACLC {
+
+ public static Lang langShacl = LangBuilder.create("SHACLC", "text/shaclc")
+ .addAltNames("shaclc")
+ .addFileExtensions("shaclc", "shc")
+ .build();
+
+ public static void init() {
+ RDFLanguages.register(langShacl);
+ ReaderRIOTFactory factory = (Lang language, ParserProfile profile)->new ReaderRIOTShaclc();
+ RDFParserRegistry.registerLangTriples(langShacl, factory);
+ }
+
+ static class ReaderRIOTShaclc implements ReaderRIOT {
+ @Override
+ public void read(Reader reader, String baseURI, ContentType ct, StreamRDF output, Context context) {
+ Graph g = ShaclcParser.parseSHACLC(reader, baseURI);
+ StreamRDFOps.sendGraphToStream(g, output);
+ }
+
+ @Override
+ public void read(InputStream in, String baseURI, ContentType ct, StreamRDF output, Context context) {
+ Graph g = ShaclcParser.parseSHACLC(in, baseURI);
+ StreamRDFOps.sendGraphToStream(g, output);
+ }
+ }
+
+}
+
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/compact/ShaclCompactParser.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/ShaclCompactParser.java
new file mode 100644
index 0000000..7603d22
--- /dev/null
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/ShaclCompactParser.java
@@ -0,0 +1,528 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact;
+
+import java.util.*;
+
+import org.apache.jena.atlas.lib.InternalErrorException;
+import org.apache.jena.datatypes.xsd.XSDDatatype;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.riot.system.PrefixMap;
+import org.apache.jena.riot.system.PrefixMapFactory;
+import org.apache.jena.riot.system.StreamRDF;
+import org.apache.jena.riot.tokens.TokenizerFactory;
+import org.apache.jena.shacl.ShaclException;
+import org.apache.jena.shacl.engine.ShaclPaths;
+import org.apache.jena.shacl.vocabulary.SHACL;
+import org.apache.jena.sparql.core.Prologue;
+import org.apache.jena.sparql.lang.ParserBase;
+import org.apache.jena.sparql.path.Path;
+import org.apache.jena.vocabulary.OWL;
+import org.apache.jena.vocabulary.RDF;
+import org.apache.jena.vocabulary.RDFS;
+import org.apache.jena.vocabulary.XSD;
+
+/**
+ * The engine for translating SHACL Compact Syntax into a SHACL graph of triples.
+ */
+public class ShaclCompactParser extends ParserBase {
+
+ private StreamRDF outputStream;
+
+ protected ShaclCompactParser() {
+ setPrologue(new Prologue());
+ }
+
+ public void start(StreamRDF output) {
+ if ( this.outputStream != null )
+ throw new ShaclException("Output graph already set");
+ this.outputStream = output;
+ }
+
+ // Once the whole document has been completed, produce a triple ?baseURI rdf:type
+ // owl:Ontology using the final value of baseURI. Report an error if baseURI has
+ // no value but imports is not empty. For each iri in imports, produce a triple
+ // ?baseURI owl:imports ?iri.
+ public void finish() {
+ String base = getPrologue().getBaseURI();
+ if ( base == null )
+ base = "http://example/base#";
+ outputStream.base(base);
+
+ Node s = iri(base);
+ triple(outputStream, s, nRDFtype, OWL.Ontology.asNode());
+
+ imports.forEach(iri -> triple(outputStream, s, OWL.imports.asNode(), iri(iri)));
+ // Include PREFIXes in output graph
+ getPrologue().getPrefixMapping().getNsPrefixMap().forEach((p, u) -> outputStream.prefix(p, u));
+
+ if ( !currentNodeShape.isEmpty() )
+ throw new InternalErrorException("Internal error: Node shape stack is not empty at end of parsing");
+ if ( !currentPropertyShape.isEmpty() )
+ throw new InternalErrorException("Internal error: Property shape stack is not empty at end of parsing");
+ }
+
+ // Stacks for node shape and property shape.
+
+ // The node shape and property shape stacks.
+ private Deque<Node> currentNodeShape = new ArrayDeque<>();
+ private Deque<Node> currentPropertyShape = new ArrayDeque<>();
+
+ // Collectors (node and property), gather up the elements of an "or"
+ private Deque<List<Node>> nodeShapeCollectors = new ArrayDeque<>();
+ private Deque<List<Node>> propertyShapeCollectors = new ArrayDeque<>();
+
+ // Accumulators for triples of a constraint
+ private Deque<List<Triple>> currentConstraintTriples = new ArrayDeque<>();
+
+ protected void startNodeShape() {}
+
+ protected void beginNodeShape(Node node) {
+ currentNodeShape.push(node);
+ }
+
+ protected void finishNodeShape() {
+ currentNodeShape.pop();
+ }
+
+ private Node currentNodeShape() {
+ if ( currentNodeShape.isEmpty() )
+ throw new InternalErrorException("Internal error: no current node shape");
+ return currentNodeShape.peek();
+ }
+
+ protected void startShapeClass() {
+ startNodeShape();
+ }
+
+ protected void beginShapeClass(Node node) {
+ beginNodeShape(node);
+ }
+
+ protected void finishShapeClass() {
+ finishNodeShape();
+ }
+
+ protected void startPropertyShape() {}
+
+ protected void beginPropertyShape(Node node) {
+ currentPropertyShape.push(node);
+ }
+
+ protected void finishPropertyShape() {
+ currentPropertyShape.pop();
+ }
+
+ private Node currentPropertyShape() {
+ if ( currentPropertyShape.isEmpty() )
+ throw new InternalErrorException("Internal error: no current property shape");
+ return currentPropertyShape.peek();
+ }
+
+ // nodeShapeBody: Handle each constraint using the context shape ?shape.
+ protected void startNodeShapeBody() {}
+
+ protected void finishNodeShapeBody() {}
+
+ protected void beginTripleAcc(List<Triple> acc) {
+ currentConstraintTriples.push(acc);
+ }
+
+ protected void finishTripleAcc() {
+ currentConstraintTriples.pop();
+ }
+
+ private List<Triple> currentTripleAcc() {
+ if ( currentConstraintTriples.isEmpty() )
+ throw new InternalErrorException("Internal error: no current tripel accumulator");
+ return currentConstraintTriples.peek();
+ }
+
+ protected void startConstraint() {
+ List<Triple> acc = new ArrayList<>();
+ beginTripleAcc(acc);
+ }
+
+ protected void finishConstraint() {
+ List<Triple> acc = currentTripleAcc();
+ acc.forEach(outputStream::triple);
+ finishTripleAcc();
+ }
+
+ // ---- Start grammar.
+
+ private List<String> imports = new ArrayList<>();
+ protected void rImports(String iri) {
+ imports.add(iri);
+ }
+
+ // nodeShape: Produce a triple ?shape rdf:type sh:NodeShape where ?shape is
+ // derived from the iri using iri. Use ?shape as context shape for the
+ // targetClass and nodeShapeBody.
+ protected void rNodeShape(String iri) {
+ Node shape = iri(iri);
+ triple(outputStream, shape, nRDFtype, SHACL.NodeShape);
+ beginNodeShape(shape);
+ }
+
+ // shapeClass: Produce the triples ?shape rdf:type sh:NodeShape and ?shape
+ // rdf:type rdfs:Class where ?shape is derived from the iri using iri. Use
+ // ?shape as context shape for the nodeShapeBody.
+ protected void rShapeClass(String iri) {
+ Node s = iri(iri);
+ beginShapeClass(s);
+ triple(outputStream, s, nRDFtype, SHACL.NodeShape);
+ triple(outputStream, s, nRDFtype, RDFS.Nodes.Class);
+ }
+
+ // targetClass: For each iri, produce a triple ?shape sh:targetClass ?iri where
+ // ?iri is derived from iri.
+ protected void rTargetClass(String iri) {
+ Node s = currentNodeShape();
+ Node n = iri(iri);
+ triple(outputStream, s, SHACL.targetClass, n);
+ }
+
+ // nodeOr: If there is more than one nodeNot, then produce an RDF list ?or where
+ // for each nodeNot, there is a new blank node, and that blank node is used as
+ // context shape for the nodeNot. Then produce a triple ?shape sh:or ?or. If
+ // there is only one nodeNot, handle the nodeNot using the context shape ?shape.
+
+ protected void startNodeOr() {
+ nodeShapeCollectors.add(new ArrayList<>());
+ }
+
+ protected void rNodeOr_pre() {
+ Node blank = newBlankNode("nodeOr-elt");
+ beginNodeShape(blank);
+ }
+
+ protected void rNodeOr_post() {
+ Node n = currentNodeShape();
+ nodeShapeCollectors.peek().add(n);
+ finishNodeShape();
+ }
+
+ protected void finishNodeOr() {
+ List<Node> elts = nodeShapeCollectors.pop();
+ if ( elts.isEmpty() )
+ throw new InternalErrorException("No elements in nodeOr");
+ if ( elts.size() == 1 ) {
+ // Pull up one level.
+ rewrite(currentTripleAcc(), elts.get(0), currentNodeShape());
+ return;
+ }
+ Node list = listToTriples(elts);
+ triple(currentTripleAcc(), currentNodeShape(), SHACL.or, list);
+ }
+
+ // nodeNot: If there is a negation, produce a new blank node ?not and produce a
+ // triple ?shape sh:not ?not. Then handle the nodeValue using ?not as context
+ // shape. If there is no negation, handle the nodeValue using the context shape
+ // ?shape.
+
+ protected void startNodeNot() {}
+
+ protected void beginNodeNot(boolean negation) {
+ if ( !negation )
+ return;
+ Node blank = newBlankNode("nodeNot");
+ beginNodeShape(blank);
+ }
+
+ protected void finishNodeNot(boolean negation) {
+ if ( !negation )
+ return;
+ Node n = currentNodeShape();
+ finishNodeShape();
+ Node nodeShape = currentNodeShape();
+ triple(currentTripleAcc(), nodeShape, SHACL.not, n);
+ }
+
+ // nodeValue: Produce a triple ?shape ?predicate ?object where ?predicate is the
+ // IRI produced by concatenating the sh namespace with string value of nodeParam
+ // (for example "minLength" becomes sh:minLength), and ?object is derived from
+ // the iriOrLiteralOrArray.
+
+ protected void rNodeValue(String s, Node n) {
+ Node p = NodeFactory.createURI(SHACL.getURI() + s);
+ triple(currentTripleAcc(), currentNodeShape(), p, n);
+ }
+
+ protected void rNodeValue(String s, List<Node> x) {
+ Node n = nodeArrayToTriples(x);
+ Node p = NodeFactory.createURI(SHACL.getURI() + s);
+ triple(currentTripleAcc(), currentNodeShape(), p, n);
+ }
+
+ // propertyShape: Using a new blank node ?property, produce a triple ?shape
+ // sh:property ?property. Produce a triple ?property sh:path ?path where
+ // ?path is the result of path. Use ?property as context shape for
+ // propertyCount and propertyOr.
+
+ protected void rPropertyShape(Path parsedPath) {
+ Node path = pathToNode(parsedPath);
+ Node b = newBlankNode("propertyShape");
+ beginPropertyShape(b);
+ triple(currentTripleAcc(), currentNodeShape(), SHACL.property, currentPropertyShape());
+ if ( path == null )
+ throw new ShaclException("Internal error: no path");
+ triple(currentTripleAcc(), currentPropertyShape(), SHACL.path, path);
+ }
+
+ // propertyCount: If propertyMinCount is not "0", produce a triple ?property
+ // sh:minCount ?minCount using the xsd:integer derived from propertyMinCount
+ // as ?minCount. If propertyMaxCount is not "*", produce a triple ?property
+ // sh:maxCount ?maxCount using the xsd:integer derived from propertyMaxCount
+ // as ?maxCount.
+ protected void rPropertyCount(String minStr, String maxStr) {
+ int min = integer(minStr, 0);
+ int max = integer(maxStr, -1);
+ if ( min > 0 )
+ triple(currentTripleAcc(), currentPropertyShape(), SHACL.minCount, NodeFactory.createLiteral(minStr, XSDDatatype.XSDinteger));
+ if ( max > 0 )
+ triple(currentTripleAcc(), currentPropertyShape(), SHACL.maxCount, NodeFactory.createLiteral(maxStr, XSDDatatype.XSDinteger));
+ }
+
+ // propertyOr: If there is more than one propertyNot, then produce an RDF list
+ // ?or where
+ // for each propertyNot, there is a new blank node, and that blank node is
+ // used as context shape for the propertyNot. Then produce a triple ?property
+ // sh:or ?or. If there is only one propertyNot, handle the propertyNot using
+ // the context shape ?property.
+
+ // We do this by assuming there will be multiple elements, then if (common case)
+ // there is one, modifying the graph using "rewrite" - typically one triple to
+ // remove, one to add. The root issue is that we either buffer and decide later
+ // or alter the graph.
+
+ protected void startPropertyOr() {
+ propertyShapeCollectors.add(new ArrayList<>());
+ }
+
+ protected void rPropertyOr_pre() {
+ Node blank = newBlankNode("propertyOr-elt");
+ beginPropertyShape(blank);
+ }
+
+ protected void rPropertyOr_post() {
+ Node n = currentPropertyShape();
+ propertyShapeCollectors.peek().add(n);
+ finishPropertyShape();
+ }
+
+ protected void finishPropertyOr() {
+ List<Node> elts = propertyShapeCollectors.pop();
+ if ( elts.isEmpty() )
+ throw new InternalErrorException("No elements in propertyOr");
+ if ( elts.size() == 1 ) {
+ // Pull up one level.
+ rewrite(currentTripleAcc(), elts.get(0), currentPropertyShape());
+ return;
+ }
+ Node list = listToTriples(elts);
+ triple(currentTripleAcc(), currentPropertyShape(), SHACL.or, list);
+ }
+
+ // propertyNot: If there is a negation, produce a new blank node ?not and produce
+ // a triple ?property sh:not ?not. Then handle the propertyAtom using ?not as
+ // context shape. If there is no negation, handle the propertyAtom using the
+ // context shape ?property.
+ protected void startPropertyNot() {}
+
+ protected void beginPropertyNot(boolean negation) {
+ if ( !negation )
+ return;
+ Node blank = newBlankNode("propertyNot");
+ beginPropertyShape(blank);
+ }
+
+ protected void finishPropertyNot(boolean negation) {
+ if ( !negation )
+ return;
+ Node n = currentPropertyShape();
+ finishPropertyShape();
+ Node propertyShape = currentPropertyShape();
+ triple(currentTripleAcc(), propertyShape, SHACL.not, n);
+ }
+
+ // propertyAtom: Use ?property as context shape for any of the child elements.
+ // For a nested nodeShapeBody, produce a new blank node ?node and use that as the
+ // context shape ?shape. Then produce a triple ?property sh:node ?node.
+ public void startNestedPropertyAtom() {
+ // For a nested nodeShapeBody (in a propertyAtom), produce a new blank node
+ // ?node and use that as the context shape ?shape.
+ Node b = newBlankNode("nested-shape");
+ startNodeShape();
+ triple(currentTripleAcc(), currentPropertyShape(), SHACL.node, b);
+ beginNodeShape(b);
+ }
+
+ public void finishNestedPropertyAtom() {
+ finishNodeShape();
+ }
+
+ // propertyType: Let ?iri be the IRI derived from the propertyType using iri. If
+ // ?iri is one of the RDF datatypes supported by SPARQL 1.1 (such as xsd:string)
+ // then produce a triple ?property sh:datatype ?iri, otherwise ?property sh:class
+ // ?iri.
+
+ static Set<String> rdfDatatypes = new HashSet<>();
+ static {
+ rdfDatatypes.add(RDF.dtLangString.getURI());
+ rdfDatatypes.add(RDF.dtRDFHTML.getURI());
+ rdfDatatypes.add(RDF.dtRDFJSON.getURI());
+ rdfDatatypes.add(RDF.dtXMLLiteral.getURI());
+ }
+
+ protected void rPropertyType(String iri) {
+ Node p =
+ iri.startsWith(XSD.getURI()) || rdfDatatypes.contains(iri)
+ ? SHACL.datatype
+ : SHACL.class_;
+ triple(currentTripleAcc(), currentPropertyShape(), p, iri(iri));
+ }
+
+ // nodeKind: Produce a triple ?property sh:nodeKind ?nodeKind where ?nodeKind is
+ // the IRI produced by concatenating the sh namespace with the text value of
+ // nodeKind (e.g., sh:Literal).
+ protected void rNodeKind(String nodeKindName) {
+ // Parser only produce legal values.
+ Node nodeKind = iri(SHACL.getURI()+nodeKindName);
+ triple(currentTripleAcc(), currentPropertyShape(), SHACL.nodeKind, nodeKind);
+ }
+
+ private Node pathToNode(Path parsedPath) {
+ return ShaclPaths.pathToRDF(parsedPath, outputStream);
+ }
+
+ // shapeRef: Produce a triple ?property sh:node ?node where ?node is the IRI
+ // derived from the substring of shapeRef after the '@' character using iri.
+ protected void rShapeRef(String iriStr) {
+ Node x = iri(iriStr);
+ triple(currentTripleAcc(), currentPropertyShape(), SHACL.node, x);
+ }
+
+ // propertyValue: Produce a triple ?property ?predicate ?object where ?predicate
+ // is the IRI produced by concatenating the sh namespace with the string value of
+ // propertyParam, and ?object is derived from the iriOrLiteralOrArray.
+ protected void rParamValue(String s, Node n) {
+ Node p = NodeFactory.createURI(SHACL.getURI()+s);
+ triple(currentTripleAcc(), currentPropertyShape(), p, n);
+ }
+
+ protected void rParamValue(String s, List<Node> x) {
+ Node n = nodeArrayToTriples(x);
+ Node p = NodeFactory.createURI(SHACL.getURI() + s);
+ triple(currentTripleAcc(), currentPropertyShape(), p, n);
+ }
+
+ // iriOrLiteralOrArray: If there is an array, produce and return an RDF list
+ // where each iriOrLiteral is a member. Otherwise, return iriOrLiteral for
+ // iriOrLiteral.
+
+ // With iriOrLiteral
+ private Node nodeArrayToTriples(List<Node> x) {
+ Node list = nRDFnil;
+
+ ListIterator<Node> iter = x.listIterator(x.size());
+ while (iter.hasPrevious()) {
+ Node elt = iter.previous();
+ // elt = iriOrLiteral(elt);
+ Node z = newBlankNode("array");
+ triple(currentTripleAcc(), z, nRDFfirst, elt);
+ triple(currentTripleAcc(), z, nRDFrest, list);
+ list = z;
+ }
+ return list;
+ }
+
+ // iriOrLiteral: If there is an iri, return the node derived from iri. Otherwise,
+ // apply Turtle's parsing rules to turn the string literal into an RDF literal.
+ // (from the test cases, this does not mean parse the node string again)
+
+ private Node iriOrLiteral(Node x) {
+ if ( x.isURI() )
+ return x;
+ String s = x.getLiteralLexicalForm();
+ PrefixMap pmap = PrefixMapFactory.create(getPrologue().getPrefixMapping());
+ Node n = TokenizerFactory.makeTokenizerString(s).next().asNode(pmap);
+ return n;
+ }
+
+ // ------------------------------
+
+ private int integer(String str, int i) {
+ if ( str == null || str.equals("*") )
+ return i;
+ try {
+ return Integer.parseInt(str);
+ } catch (NumberFormatException ex) {
+ System.err.println("Number format exception");
+ return i;
+ }
+ }
+
+ // Java List<Node> to RDF list.
+ private Node listToTriples(List<Node> x) {
+ Node list = nRDFnil;
+ ListIterator<Node> iter = x.listIterator(x.size());
+ while (iter.hasPrevious()) {
+ Node elt = iter.previous();
+ Node z = newBlankNode("list");
+ triple(currentTripleAcc(), z, nRDFfirst, elt);
+ triple(currentTripleAcc(), z, nRDFrest, list);
+ list = z;
+ }
+ return list;
+ }
+
+ private Node iri(String iriStr) {
+ return NodeFactory.createURI(iriStr);
+ }
+
+ // private static int counter = 0;
+ private Node newBlankNode(String label) {
+ // Label is a debugging aid.
+ // return iri("x:"+label+"-"+(++counter));
+ return NodeFactory.createBlankNode();
+ }
+
+ private void rewrite(List<Triple> accumulator, Node node1, Node node2) {
+ for ( int i = 0 ; i < accumulator.size() ; i++ ) {
+ Triple t = accumulator.get(i);
+ if ( t.getSubject().equals(node1) ) {
+ Triple t2 = Triple.create(node2, t.getPredicate(), t.getObject());
+ accumulator.set(i, t2);
+ }
+ }
+ }
+
+ private void triple(Collection<Triple> acc, Node s, Node p, Node o) {
+ Triple triple = Triple.create(s, p, o);
+ acc.add(triple);
+ }
+
+ private static void triple(StreamRDF out, Node s, Node p, Node o) {
+ Triple triple = Triple.create(s, p, o);
+ out.triple(triple);
+ }
+}
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/compact/ShaclcParser.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/ShaclcParser.java
new file mode 100644
index 0000000..b4933d3
--- /dev/null
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/ShaclcParser.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.jena.atlas.io.IO;
+import org.apache.jena.graph.Graph;
+import org.apache.jena.riot.system.StreamRDF;
+import org.apache.jena.riot.system.StreamRDFLib;
+import org.apache.jena.shacl.Shapes;
+import org.apache.jena.shacl.vocabulary.SHACL;
+import org.apache.jena.sparql.core.Prologue;
+import org.apache.jena.sparql.graph.GraphFactory;
+import org.apache.jena.vocabulary.OWL;
+import org.apache.jena.vocabulary.RDF;
+import org.apache.jena.vocabulary.RDFS;
+import org.apache.jena.vocabulary.XSD;
+import org.apache.jena.shacl.compact.parser.ParseException;
+import org.apache.jena.shacl.compact.parser.ShaclCompactParserJJ;
+
+public class ShaclcParser {
+
+ /**
+ * Parse the file to get SHACL shapes.
+ * @param filename
+ * @return Shapes
+ */
+ public static Shapes parse(String filename) {
+ return parse(filename, null);
+ }
+ /**
+ * Parse the file to get SHACL shapes.
+ * @param filename
+ * @param baseURI
+ * @return Shapes
+ */
+ public static Shapes parse(String filename, String baseURI) {
+ InputStream input = IO.openFile(filename);
+ Graph graph = parseSHACLC(input, baseURI);
+ return Shapes.parse(graph);
+ }
+
+ /** Parse from an {@code InputStream} to get the SHACL graph. */
+ public static Graph parseSHACLC(InputStream input) {
+ return parseSHACLC(input, (String)null);
+ }
+
+ /** Parse from an {@code InputStream} to get the SHACL graph. */
+ public static Graph parseSHACLC(InputStream input, String baseURI) {
+ ShaclCompactParserJJ parser = new ShaclCompactParserJJ(input, StandardCharsets.UTF_8.name());
+ return parseIntoGraph$(parser, baseURI);
+ }
+
+ /** Parse from an {@code InputStream} sending the triples to a {@link StreamRDF}. */
+ public static void parseSHACLC(InputStream input, StreamRDF stream) {
+ parseSHACLC(input, null, stream);
+ }
+
+ /** Parse from an {@code InputStream} sending the triples to a {@link StreamRDF}. */
+ public static void parseSHACLC(InputStream input, String baseURI, StreamRDF stream) {
+ ShaclCompactParserJJ parser = new ShaclCompactParserJJ(input, StandardCharsets.UTF_8.name());
+ parse$(parser, stream, baseURI);
+ }
+
+ /**
+ * Parse from an {@code Reader} to get the SHACL graph.
+ * The reader should be UTF-8
+ */
+ /*package*/ static Graph parseSHACLC(Reader reader, String baseURI) {
+ ShaclCompactParserJJ parser = new ShaclCompactParserJJ(reader);
+ return parseIntoGraph$(parser, baseURI);
+ }
+
+ private static Graph parseIntoGraph$(ShaclCompactParserJJ parser, String baseURI) {
+ Graph graph = GraphFactory.createDefaultGraph();
+ StreamRDF stream = StreamRDFLib.graph(graph);
+ parse$(parser, stream, baseURI);
+ return graph;
+ }
+
+ private static void parse$(ShaclCompactParserJJ parser, StreamRDF stream, String baseURI) {
+ Prologue prologue = parser.getPrologue();
+ stream.start();
+ if ( true ) {
+ // Always add these prefixes to the output stream.
+ // These are required by the test suite.
+ // Do before parsing in case the SHACLC file overrides them.
+ prefix(stream, prologue, "rdf", RDF.getURI());
+ prefix(stream, prologue, "rdfs", RDFS.getURI());
+ prefix(stream, prologue, "sh", SHACL.getURI());
+ prefix(stream, prologue, "xsd", XSD.getURI());
+ prefix(stream, prologue, "owl", OWL.getURI());
+ }
+
+ parser.start(stream);
+ try {
+ if ( baseURI != null )
+ parser.getPrologue().setBaseURI(baseURI);
+ parser.Unit();
+ } catch (ParseException e) {
+ e.printStackTrace();
+ }
+ parser.finish();
+ stream.finish();
+ }
+
+ private static void prefix(StreamRDF stream, Prologue prologue, String prefix, String uri) {
+ stream.prefix(prefix, uri);
+ prologue.getPrefixMapping().setNsPrefix(prefix, uri);
+ }
+}
+
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ParseException.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ParseException.java
new file mode 100644
index 0000000..46ae1f7
--- /dev/null
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ParseException.java
@@ -0,0 +1,205 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 6.0 */
+/* JavaCCOptions:KEEP_LINE_COL=null */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact.parser;
+
+/**
+ * This exception is thrown when parse errors are encountered.
+ * You can explicitly create objects of this exception type by
+ * calling the method generateParseException in the generated
+ * parser.
+ *
+ * You can modify this class to customize your error reporting
+ * mechanisms so long as you retain the public fields.
+ */
+public class ParseException extends Exception {
+
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * This constructor is used by the method "generateParseException"
+ * in the generated parser. Calling this constructor generates
+ * a new object of this type with the fields "currentToken",
+ * "expectedTokenSequences", and "tokenImage" set.
+ */
+ public ParseException(Token currentTokenVal,
+ int[][] expectedTokenSequencesVal,
+ String[] tokenImageVal
+ )
+ {
+ super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));
+ currentToken = currentTokenVal;
+ expectedTokenSequences = expectedTokenSequencesVal;
+ tokenImage = tokenImageVal;
+ }
+
+ /**
+ * The following constructors are for use by you for whatever
+ * purpose you can think of. Constructing the exception in this
+ * manner makes the exception behave in the normal way - i.e., as
+ * documented in the class "Throwable". The fields "errorToken",
+ * "expectedTokenSequences", and "tokenImage" do not contain
+ * relevant information. The JavaCC generated code does not use
+ * these constructors.
+ */
+
+ public ParseException() {
+ super();
+ }
+
+ /** Constructor with message. */
+ public ParseException(String message) {
+ super(message);
+ }
+
+
+ /**
+ * This is the last token that has been consumed successfully. If
+ * this object has been created due to a parse error, the token
+ * followng this token will (therefore) be the first error token.
+ */
+ public Token currentToken;
+
+ /**
+ * Each entry in this array is an array of integers. Each array
+ * of integers represents a sequence of tokens (by their ordinal
+ * values) that is expected at this point of the parse.
+ */
+ public int[][] expectedTokenSequences;
+
+ /**
+ * This is a reference to the "tokenImage" array of the generated
+ * parser within which the parse error occurred. This array is
+ * defined in the generated ...Constants interface.
+ */
+ public String[] tokenImage;
+
+ /**
+ * It uses "currentToken" and "expectedTokenSequences" to generate a parse
+ * error message and returns it. If this object has been created
+ * due to a parse error, and you do not catch it (it gets thrown
+ * from the parser) the correct error message
+ * gets displayed.
+ */
+ private static String initialise(Token currentToken,
+ int[][] expectedTokenSequences,
+ String[] tokenImage) {
+ String eol = System.getProperty("line.separator", "\n");
+ StringBuffer expected = new StringBuffer();
+ int maxSize = 0;
+ for (int i = 0; i < expectedTokenSequences.length; i++) {
+ if (maxSize < expectedTokenSequences[i].length) {
+ maxSize = expectedTokenSequences[i].length;
+ }
+ for (int j = 0; j < expectedTokenSequences[i].length; j++) {
+ expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');
+ }
+ if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
+ expected.append("...");
+ }
+ expected.append(eol).append(" ");
+ }
+ String retval = "Encountered \"";
+ Token tok = currentToken.next;
+ for (int i = 0; i < maxSize; i++) {
+ if (i != 0) retval += " ";
+ if (tok.kind == 0) {
+ retval += tokenImage[0];
+ break;
+ }
+ retval += " " + tokenImage[tok.kind];
+ retval += " \"";
+ retval += add_escapes(tok.image);
+ retval += " \"";
+ tok = tok.next;
+ }
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+ retval += "." + eol;
+ if (expectedTokenSequences.length == 1) {
+ retval += "Was expecting:" + eol + " ";
+ } else {
+ retval += "Was expecting one of:" + eol + " ";
+ }
+ retval += expected.toString();
+ return retval;
+ }
+
+ /**
+ * The end of line string for this machine.
+ */
+ protected String eol = System.getProperty("line.separator", "\n");
+
+ /**
+ * Used to convert raw characters to their escaped version
+ * when these raw version cannot be used as part of an ASCII
+ * string literal.
+ */
+ static String add_escapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+}
+/* JavaCC - OriginalChecksum=2d673050c5239191477a72f725163133 (do not edit this line) */
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ShaclCompactParserJJ.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ShaclCompactParserJJ.java
new file mode 100644
index 0000000..3f1b176
--- /dev/null
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ShaclCompactParserJJ.java
@@ -0,0 +1,1579 @@
+/* ShaclCompactParserJJ.java */
+/* Generated By:JavaCC: Do not edit this line. ShaclCompactParserJJ.java */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact.parser;
+
+import java.util.List;
+import java.util.ArrayList;
+import org.apache.jena.graph.*;
+import org.apache.jena.sparql.path.*;
+import org.apache.jena.shacl.compact.*;
+
+public class ShaclCompactParserJJ extends ShaclCompactParser implements ShaclCompactParserJJConstants {
+
+ final public void Unit() throws ParseException {
+ ByteOrderMark();
+ shaclDoc();
+ jj_consume_token(0);
+ }
+
+ final public void ByteOrderMark() throws ParseException {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case BOM:{
+ jj_consume_token(BOM);
+ break;
+ }
+ default:
+ jj_la1[0] = jj_gen;
+ ;
+ }
+ }
+
+ final public void shaclDoc() throws ParseException {
+ label_1:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case BASE:
+ case IMPORTS:
+ case PREFIX:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[1] = jj_gen;
+ break label_1;
+ }
+ directive();
+ }
+ label_2:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SHAPE_CLASS:
+ case SHAPE:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[2] = jj_gen;
+ break label_2;
+ }
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SHAPE:{
+ nodeShape();
+ break;
+ }
+ case SHAPE_CLASS:{
+ shapeClass();
+ break;
+ }
+ default:
+ jj_la1[3] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+ }
+
+ final public void directive() throws ParseException {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case BASE:{
+ baseDecl();
+ break;
+ }
+ case PREFIX:{
+ prefixDecl();
+ break;
+ }
+ case IMPORTS:{
+ importDecl();
+ break;
+ }
+ default:
+ jj_la1[4] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+
+ final public void baseDecl() throws ParseException {String iri ;
+ jj_consume_token(BASE);
+ iri = IRIREF();
+getPrologue().setBaseURI(iri) ;
+ }
+
+ final public void prefixDecl() throws ParseException {Token t ; String iri ;
+ jj_consume_token(PREFIX);
+ t = jj_consume_token(PNAME_NS);
+ iri = IRIREF();
+String s = fixupPrefix(t.image, t.beginLine, t.beginColumn) ;
+ getPrologue().setPrefix(s, iri) ;
+ }
+
+ final public void importDecl() throws ParseException {String iri ;
+ jj_consume_token(IMPORTS);
+ iri = iri();
+rImports(iri);
+ }
+
+ final public void nodeShape() throws ParseException {String iri;
+startNodeShape();
+ jj_consume_token(SHAPE);
+ iri = iri();
+rNodeShape(iri);
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case 1:{
+ targetClass();
+ break;
+ }
+ default:
+ jj_la1[5] = jj_gen;
+ ;
+ }
+ nodeShapeBody();
+finishNodeShape();
+ }
+
+ final public void shapeClass() throws ParseException {String iri;
+startShapeClass();
+ jj_consume_token(SHAPE_CLASS);
+ iri = iri();
+rShapeClass(iri);
+ nodeShapeBody();
+finishShapeClass();
+ }
+
+ final public void targetClass() throws ParseException {String iri;
+ jj_consume_token(1);
+ label_3:
+ while (true) {
+ iri = iri();
+rTargetClass(iri);
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[6] = jj_gen;
+ break label_3;
+ }
+ }
+ }
+
+ final public void nodeShapeBody() throws ParseException {
+startNodeShapeBody() ;
+ jj_consume_token(LBRACE);
+ label_4:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ case 20:
+ case 21:
+ case 22:
+ case 23:
+ case 24:
+ case 25:
+ case 26:
+ case 27:
+ case 28:
+ case 29:
+ case 30:
+ case 31:
+ case 32:
+ case CARAT:
+ case BANG:
+ case LPAREN:
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[7] = jj_gen;
+ break label_4;
+ }
+ constraint();
+ }
+ jj_consume_token(RBRACE);
+finishNodeShapeBody() ;
+ }
+
+ final public void constraint() throws ParseException {
+startConstraint();
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ case 20:
+ case 21:
+ case 22:
+ case 23:
+ case 24:
+ case 25:
+ case 26:
+ case 27:
+ case 28:
+ case 29:
+ case 30:
+ case 31:
+ case 32:
+ case BANG:{
+ label_5:
+ while (true) {
+ nodeOr();
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ case 20:
+ case 21:
+ case 22:
+ case 23:
+ case 24:
+ case 25:
+ case 26:
+ case 27:
+ case 28:
+ case 29:
+ case 30:
+ case 31:
+ case 32:
+ case BANG:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[8] = jj_gen;
+ break label_5;
+ }
+ }
+ break;
+ }
+ case CARAT:
+ case LPAREN:
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:{
+ propertyShape();
+ break;
+ }
+ default:
+ jj_la1[9] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+finishConstraint() ;
+ jj_consume_token(DOT);
+ }
+
+ final public void nodeOr() throws ParseException {
+startNodeOr();
+rNodeOr_pre();
+ nodeNot();
+rNodeOr_post();
+ label_6:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case VBAR:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[10] = jj_gen;
+ break label_6;
+ }
+ jj_consume_token(VBAR);
+rNodeOr_pre();
+ nodeNot();
+rNodeOr_post();
+ }
+finishNodeOr();
+ }
+
+ final public void nodeNot() throws ParseException {boolean b = false;
+startNodeNot();
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case BANG:{
+ negation();
+b = true;
+ break;
+ }
+ default:
+ jj_la1[11] = jj_gen;
+ ;
+ }
+beginNodeNot(b);
+ nodeValue();
+finishNodeNot(b);
+ }
+
+ final public void negation() throws ParseException {
+ jj_consume_token(BANG);
+ }
+
+ final public void nodeValue() throws ParseException {String s; Node n; List<Node> x;
+ s = nodeParam();
+ jj_consume_token(EQUALS);
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case TRUE:
+ case FALSE:
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:
+ case STRING_LITERAL1:
+ case STRING_LITERAL2:
+ case STRING_LITERAL_LONG1:
+ case STRING_LITERAL_LONG2:
+ case INTEGER:
+ case DECIMAL:
+ case DOUBLE:{
+ n = iriOrLiteral();
+rNodeValue(s, n);
+ break;
+ }
+ case LBRACKET:{
+ x = array();
+rNodeValue(s, x);
+ break;
+ }
+ default:
+ jj_la1[12] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+
+ final public void propertyShape() throws ParseException {Path p ;
+startPropertyShape();
+ p = path();
+rPropertyShape(p);
+ label_7:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ case 20:
+ case 21:
+ case 22:
+ case 23:
+ case 24:
+ case 25:
+ case 26:
+ case 27:
+ case 28:
+ case 29:
+ case 30:
+ case 31:
+ case 32:
+ case AT:
+ case BANG:
+ case LBRACE:
+ case LBRACKET:
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:
+ case ATPNAME_NS:
+ case ATPNAME_LN:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[13] = jj_gen;
+ break label_7;
+ }
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LBRACKET:{
+ propertyCount();
+ break;
+ }
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ case 20:
+ case 21:
+ case 22:
+ case 23:
+ case 24:
+ case 25:
+ case 26:
+ case 27:
+ case 28:
+ case 29:
+ case 30:
+ case 31:
+ case 32:
+ case AT:
+ case BANG:
+ case LBRACE:
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:
+ case ATPNAME_NS:
+ case ATPNAME_LN:{
+ propertyOr();
+ break;
+ }
+ default:
+ jj_la1[14] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+finishPropertyShape();
+ }
+
+ final public void propertyOr() throws ParseException {
+startPropertyOr();
+rPropertyOr_pre();
+ propertyNot();
+rPropertyOr_post();
+ label_8:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case VBAR:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[15] = jj_gen;
+ break label_8;
+ }
+ jj_consume_token(VBAR);
+rPropertyOr_pre();
+ propertyNot();
+rPropertyOr_post();
+ }
+finishPropertyOr();
+ }
+
+ final public void propertyNot() throws ParseException {boolean b = false;
+startPropertyNot();
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case BANG:{
+ negation();
+b = true;
+ break;
+ }
+ default:
+ jj_la1[16] = jj_gen;
+ ;
+ }
+beginPropertyNot(b);
+ propertyAtom();
+finishPropertyNot(b);
+ }
+
+ final public void propertyAtom() throws ParseException {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:{
+ propertyType();
+ break;
+ }
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:{
+ nodeKind();
+ break;
+ }
+ case AT:
+ case ATPNAME_NS:
+ case ATPNAME_LN:{
+ shapeRef();
+ break;
+ }
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ case 20:
+ case 21:
+ case 22:
+ case 23:
+ case 24:
+ case 25:
+ case 26:
+ case 27:
+ case 28:
+ case 29:
+ case 30:
+ case 31:
+ case 32:{
+ propertyValue();
+ break;
+ }
+ case LBRACE:{
+startNestedPropertyAtom();
+ nodeShapeBody();
+finishNestedPropertyAtom();
+ break;
+ }
+ default:
+ jj_la1[17] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+
+ final public void propertyCount() throws ParseException {String s1, s2;
+ jj_consume_token(LBRACKET);
+ s1 = propertyMinCount();
+ jj_consume_token(2);
+ s2 = propertyMaxCount();
+ jj_consume_token(RBRACKET);
+rPropertyCount(s1, s2);
+ }
+
+ final public String propertyMinCount() throws ParseException {Token t;
+ t = jj_consume_token(INTEGER);
+{if ("" != null) return t.image;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public String propertyMaxCount() throws ParseException {Token t;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case INTEGER:{
+ t = jj_consume_token(INTEGER);
+ break;
+ }
+ case STAR:{
+ t = jj_consume_token(STAR);
+ break;
+ }
+ default:
+ jj_la1[18] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+{if ("" != null) return t.image;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public void propertyType() throws ParseException {String iriStr;
+ iriStr = iri();
+rPropertyType(iriStr);
+ }
+
+ final public void nodeKind() throws ParseException {Token t;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case 3:{
+ t = jj_consume_token(3);
+ break;
+ }
+ case 4:{
+ t = jj_consume_token(4);
+ break;
+ }
+ case 5:{
+ t = jj_consume_token(5);
+ break;
+ }
+ case 6:{
+ t = jj_consume_token(6);
+ break;
+ }
+ case 7:{
+ t = jj_consume_token(7);
+ break;
+ }
+ case 8:{
+ t = jj_consume_token(8);
+ break;
+ }
+ default:
+ jj_la1[19] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+rNodeKind(t.image);
+ }
+
+ final public void shapeRef() throws ParseException {Token t; String iriStr;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case ATPNAME_LN:{
+ t = jj_consume_token(ATPNAME_LN);
+iriStr = resolvePName(t.image.substring(1), t.beginLine, t.beginColumn) ;
+ break;
+ }
+ case ATPNAME_NS:{
+ t = jj_consume_token(ATPNAME_NS);
+iriStr = resolvePName(t.image.substring(1), t.beginLine, t.beginColumn) ;
+ break;
+ }
+ case AT:{
+ jj_consume_token(AT);
+ iriStr = IRIREF();
+ break;
+ }
+ default:
+ jj_la1[20] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+rShapeRef(iriStr);
+ }
+
+ final public void propertyValue() throws ParseException {String s; Node n; List<Node> x;
+ s = nodeParam();
+ jj_consume_token(EQUALS);
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case TRUE:
+ case FALSE:
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:
+ case STRING_LITERAL1:
+ case STRING_LITERAL2:
+ case STRING_LITERAL_LONG1:
+ case STRING_LITERAL_LONG2:
+ case INTEGER:
+ case DECIMAL:
+ case DOUBLE:{
+ n = iriOrLiteral();
+rParamValue(s, n);
+ break;
+ }
+ case LBRACKET:{
+ x = array();
+rParamValue(s, x);
+ break;
+ }
+ default:
+ jj_la1[21] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+
+// Assemble items to build with from hereon down.
+// Return Java objects.
+ final public
+String nodeParam() throws ParseException {Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case 9:{
+ t = jj_consume_token(9);
+ break;
+ }
+ case 10:{
+ t = jj_consume_token(10);
+ break;
+ }
+ case 11:{
+ t = jj_consume_token(11);
+ break;
+ }
+ case 12:{
+ t = jj_consume_token(12);
+ break;
+ }
+ case 13:{
+ t = jj_consume_token(13);
+ break;
+ }
+ case 14:{
+ t = jj_consume_token(14);
+ break;
+ }
+ case 15:{
+ t = jj_consume_token(15);
+ break;
+ }
+ case 16:{
+ t = jj_consume_token(16);
+ break;
+ }
+ case 17:{
+ t = jj_consume_token(17);
+ break;
+ }
+ case 18:{
+ t = jj_consume_token(18);
+ break;
+ }
+ case 19:{
+ t = jj_consume_token(19);
+ break;
+ }
+ case 20:{
+ t = jj_consume_token(20);
+ break;
+ }
+ case 21:{
+ t = jj_consume_token(21);
+ break;
+ }
+ case 22:{
+ t = jj_consume_token(22);
+ break;
+ }
+ case 23:{
+ t = jj_consume_token(23);
+ break;
+ }
+ case 24:{
+ t = jj_consume_token(24);
+ break;
+ }
+ case 25:{
+ t = jj_consume_token(25);
+ break;
+ }
+ case 26:{
+ t = jj_consume_token(26);
+ break;
+ }
+ case 27:{
+ t = jj_consume_token(27);
+ break;
+ }
+ case 28:{
+ t = jj_consume_token(28);
+ break;
+ }
+ case 29:{
+ t = jj_consume_token(29);
+ break;
+ }
+ case 30:{
+ t = jj_consume_token(30);
+ break;
+ }
+ case 31:{
+ t = jj_consume_token(31);
+ break;
+ }
+ case 32:{
+ t = jj_consume_token(32);
+ break;
+ }
+ default:
+ jj_la1[22] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+{if ("" != null) return t.image ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public String propertyParam() throws ParseException {Token t;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case 12:{
+ t = jj_consume_token(12);
+ break;
+ }
+ case 13:{
+ t = jj_consume_token(13);
+ break;
+ }
+ case 14:{
+ t = jj_consume_token(14);
+ break;
+ }
+ case 15:{
+ t = jj_consume_token(15);
+ break;
+ }
+ case 16:{
+ t = jj_consume_token(16);
+ break;
+ }
+ case 17:{
+ t = jj_consume_token(17);
+ break;
+ }
+ case 18:{
+ t = jj_consume_token(18);
+ break;
+ }
+ case 19:{
+ t = jj_consume_token(19);
+ break;
+ }
+ case 20:{
+ t = jj_consume_token(20);
+ break;
+ }
+ case 21:{
+ t = jj_consume_token(21);
+ break;
+ }
+ case 22:{
+ t = jj_consume_token(22);
+ break;
+ }
+ case 23:{
+ t = jj_consume_token(23);
+ break;
+ }
+ case 24:{
+ t = jj_consume_token(24);
+ break;
+ }
+ case 25:{
+ t = jj_consume_token(25);
+ break;
+ }
+ case 26:{
+ t = jj_consume_token(26);
+ break;
+ }
+ case 33:{
+ t = jj_consume_token(33);
+ break;
+ }
+ case 27:{
+ t = jj_consume_token(27);
+ break;
+ }
+ case 28:{
+ t = jj_consume_token(28);
+ break;
+ }
+ case 34:{
+ t = jj_consume_token(34);
+ break;
+ }
+ case 35:{
+ t = jj_consume_token(35);
+ break;
+ }
+ case 36:{
+ t = jj_consume_token(36);
+ break;
+ }
+ case 37:{
+ t = jj_consume_token(37);
+ break;
+ }
+ case 38:{
+ t = jj_consume_token(38);
+ break;
+ }
+ case 39:{
+ t = jj_consume_token(39);
+ break;
+ }
+ case 29:{
+ t = jj_consume_token(29);
+ break;
+ }
+ case 30:{
+ t = jj_consume_token(30);
+ break;
+ }
+ case 31:{
+ t = jj_consume_token(31);
+ break;
+ }
+ case 32:{
+ t = jj_consume_token(32);
+ break;
+ }
+ default:
+ jj_la1[23] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+{if ("" != null) return t.image;}
+ throw new Error("Missing return statement in function");
+ }
+
+// Paths - subset of SPARQL Paths - no negation, no path property sets.
+ final public
+Path PathUnit() throws ParseException {Path p ;
+ ByteOrderMark();
+ p = path();
+ jj_consume_token(0);
+{if ("" != null) return p ;}
+ throw new Error("Missing return statement in function");
+ }
+
+// Weakest outermost
+ final public Path path() throws ParseException {Path p ;
+ p = pathAlternative();
+{if ("" != null) return p ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Path pathAlternative() throws ParseException {Path p1 , p2 ;
+ p1 = pathSequence();
+ label_9:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case VBAR:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[24] = jj_gen;
+ break label_9;
+ }
+ jj_consume_token(VBAR);
+ p2 = pathSequence();
+p1 = PathFactory.pathAlt(p1, p2) ;
+ }
+{if ("" != null) return p1 ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Path pathSequence() throws ParseException {Path p1 , p2 ;
+ p1 = pathEltOrInverse();
+ label_10:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SLASH:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[25] = jj_gen;
+ break label_10;
+ }
+ jj_consume_token(SLASH);
+ p2 = pathEltOrInverse();
+p1 = PathFactory.pathSeq(p1, p2) ;
+ }
+{if ("" != null) return p1;}
+ throw new Error("Missing return statement in function");
+ }
+
+// Path unit element, no inverse
+ final public Path pathElt() throws ParseException {String str ; Node n ; Path p ;
+ p = pathPrimary();
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case PLUS:
+ case QMARK:
+ case STAR:{
+ p = pathMod(p);
+ break;
+ }
+ default:
+ jj_la1[26] = jj_gen;
+ ;
+ }
+{if ("" != null) return p ;}
+ throw new Error("Missing return statement in function");
+ }
+
+// Path unit element, including inverse.
+ final public Path pathEltOrInverse() throws ParseException {String str ; Node n ; Path p ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LPAREN:
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:{
+ p = pathElt();
+ break;
+ }
+ case CARAT:{
+ jj_consume_token(CARAT);
+ p = pathElt();
+p = PathFactory.pathInverse(p) ;
+ break;
+ }
+ default:
+ jj_la1[27] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+{if ("" != null) return p ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Path pathMod(Path p) throws ParseException {long i1 ; long i2 ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case QMARK:{
+ jj_consume_token(QMARK);
+{if ("" != null) return PathFactory.pathZeroOrOne(p) ;}
+ break;
+ }
+ case STAR:{
+ jj_consume_token(STAR);
+{if ("" != null) return PathFactory.pathZeroOrMore1(p) ;}
+ break;
+ }
+ case PLUS:{
+ jj_consume_token(PLUS);
+{if ("" != null) return PathFactory.pathOneOrMore1(p) ;}
+ break;
+ }
+ default:
+ jj_la1[28] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Path pathPrimary() throws ParseException {String str ; Path p ; Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:{
+ str = iri();
+n = createNode(str) ; p = PathFactory.pathLink(n) ;
+ break;
+ }
+ case LPAREN:{
+ jj_consume_token(LPAREN);
+ p = path();
+ jj_consume_token(RPAREN);
+ break;
+ }
+ default:
+ jj_la1[29] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+{if ("" != null) return p ;}
+ throw new Error("Missing return statement in function");
+ }
+
+// To preserve types, use ( iriOrLiteral() | array() ) directly
+// void iriOrLiteralOrArray() : {}
+// {
+// (
+// { Node n = null; }
+// n = iriOrLiteral()
+// { iriOrLiteralOrArray(n); }
+// |
+// { List<Node> x = null; }
+// x = array()
+// { iriOrLiteralOrArray(x); }
+// )
+// }
+ final public
+List<Node> array() throws ParseException {List<Node> x = new ArrayList<Node>(); Node n = null;
+ jj_consume_token(LBRACKET);
+ label_11:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case TRUE:
+ case FALSE:
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:
+ case STRING_LITERAL1:
+ case STRING_LITERAL2:
+ case STRING_LITERAL_LONG1:
+ case STRING_LITERAL_LONG2:
+ case INTEGER:
+ case DECIMAL:
+ case DOUBLE:{
+ ;
+ break;
+ }
+ default:
+ jj_la1[30] = jj_gen;
+ break label_11;
+ }
+ n = iriOrLiteral();
+x.add(n);
+ }
+ jj_consume_token(RBRACKET);
+{if ("" != null) return x;}
+ throw new Error("Missing return statement in function");
+ }
+
+// Term generation
+ final public
+Node iriOrLiteral() throws ParseException {Node n; String uriStr;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case IRIref:
+ case PNAME_NS:
+ case PNAME_LN:{
+ uriStr = iri();
+n = createNode(uriStr);
+ break;
+ }
+ case TRUE:
+ case FALSE:
+ case STRING_LITERAL1:
+ case STRING_LITERAL2:
+ case STRING_LITERAL_LONG1:
+ case STRING_LITERAL_LONG2:
+ case INTEGER:
+ case DECIMAL:
+ case DOUBLE:{
+ n = literal();
+ break;
+ }
+ default:
+ jj_la1[31] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+{if ("" != null) return n ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Node literal() throws ParseException {Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case STRING_LITERAL1:
+ case STRING_LITERAL2:
+ case STRING_LITERAL_LONG1:
+ case STRING_LITERAL_LONG2:{
+ n = rdfLiteral();
+ break;
+ }
+ case INTEGER:
+ case DECIMAL:
+ case DOUBLE:{
+ n = numericLiteral();
+ break;
+ }
+ case TRUE:
+ case FALSE:{
+ n = booleanLiteral();
+ break;
+ }
+ default:
+ jj_la1[32] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+{if ("" != null) return n;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Node booleanLiteral() throws ParseException {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case TRUE:{
+ jj_consume_token(TRUE);
+{if ("" != null) return XSD_TRUE ;}
+ break;
+ }
+ case FALSE:{
+ jj_consume_token(FALSE);
+{if ("" != null) return XSD_FALSE ;}
+ break;
+ }
+ default:
+ jj_la1[33] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Node numericLiteral() throws ParseException {Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case INTEGER:{
+ t = jj_consume_token(INTEGER);
+{if ("" != null) return createLiteralInteger(t.image) ;}
+ break;
+ }
+ case DECIMAL:{
+ t = jj_consume_token(DECIMAL);
+{if ("" != null) return createLiteralDecimal(t.image) ;}
+ break;
+ }
+ case DOUBLE:{
+ t = jj_consume_token(DOUBLE);
+{if ("" != null) return createLiteralDouble(t.image) ;}
+ break;
+ }
+ default:
+ jj_la1[34] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Node rdfLiteral() throws ParseException {Token t ; String lex = null ;
+ lex = string();
+String lang = null ; String dt = null ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case 40:
+ case LANGTAG:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LANGTAG:{
+ t = jj_consume_token(LANGTAG);
+lang = stripChars(t.image, 1) ;
+ break;
+ }
+ case 40:{
+ jj_consume_token(40);
+ dt = datatype();
+ break;
+ }
+ default:
+ jj_la1[35] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ break;
+ }
+ default:
+ jj_la1[36] = jj_gen;
+ ;
+ }
+{if ("" != null) return createLiteral(lex, lang, dt) ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public String datatype() throws ParseException {String s;
+ s = iri();
+{if ("" != null) return s;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public String string() throws ParseException {Token t ; String lex ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case STRING_LITERAL1:{
+ t = jj_consume_token(STRING_LITERAL1);
+lex = stripQuotes(t.image) ;
+ break;
+ }
+ case STRING_LITERAL2:{
+ t = jj_consume_token(STRING_LITERAL2);
+lex = stripQuotes(t.image) ;
+ break;
+ }
+ case STRING_LITERAL_LONG1:{
+ t = jj_consume_token(STRING_LITERAL_LONG1);
+lex = stripQuotes3(t.image) ;
+ break;
+ }
+ case STRING_LITERAL_LONG2:{
+ t = jj_consume_token(STRING_LITERAL_LONG2);
+lex = stripQuotes3(t.image) ;
+ break;
+ }
+ default:
+ jj_la1[37] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+lex = unescapeStr(lex, t.beginLine, t.beginColumn) ;
+ {if ("" != null) return lex ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public String iri() throws ParseException {String iri = null;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case IRIref:{
+ iri = IRIREF();
+{if ("" != null) return iri ;}
+ break;
+ }
+ case PNAME_NS:
+ case PNAME_LN:{
+ iri = PrefixedName();
+{if ("" != null) return iri ;}
+ break;
+ }
+ default:
+ jj_la1[38] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public String PrefixedName() throws ParseException {Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case PNAME_LN:{
+ t = jj_consume_token(PNAME_LN);
+{if ("" != null) return resolvePName(t.image, t.beginLine, t.beginColumn) ;}
+ break;
+ }
+ case PNAME_NS:{
+ t = jj_consume_token(PNAME_NS);
+{if ("" != null) return resolvePName(t.image, t.beginLine, t.beginColumn) ;}
+ break;
+ }
+ default:
+ jj_la1[39] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public String IRIREF() throws ParseException {Token t ;
+ t = jj_consume_token(IRIref);
+{if ("" != null) return resolveQuotedIRI(t.image, t.beginLine, t.beginColumn) ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ /** Generated Token Manager. */
+ public ShaclCompactParserJJTokenManager token_source;
+ SimpleCharStream jj_input_stream;
+ /** Current token. */
+ public Token token;
+ /** Next token. */
+ public Token jj_nt;
+ private int jj_ntk;
+ private int jj_gen;
+ final private int[] jj_la1 = new int[40];
+ static private int[] jj_la1_0;
+ static private int[] jj_la1_1;
+ static private int[] jj_la1_2;
+ static private int[] jj_la1_3;
+ static {
+ jj_la1_init_0();
+ jj_la1_init_1();
+ jj_la1_init_2();
+ jj_la1_init_3();
+ }
+ private static void jj_la1_init_0() {
+ jj_la1_0 = new int[] {0x0,0x0,0x0,0x0,0x0,0x2,0x0,0xfffffe00,0xfffffe00,0xfffffe00,0x0,0x0,0x0,0xfffffff8,0xfffffff8,0x0,0x0,0xfffffff8,0x0,0x1f8,0x0,0x0,0xfffffe00,0xfffff000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
+ }
+ private static void jj_la1_init_1() {
+ jj_la1_1 = new int[] {0x8000,0x70000,0x180000,0x180000,0x70000,0x0,0x0,0x50000001,0x40000001,0x50000001,0x4000000,0x40000000,0x600000,0x48000001,0x48000001,0x4000000,0x40000000,0x8000001,0x0,0x0,0x8000000,0x600000,0x1,0xff,0x4000000,0x0,0x81000000,0x10000000,0x81000000,0x0,0x600000,0x600000,0x600000,0x600000,0x0,0x100,0x100,0x0,0x0,0x0,};
+ }
+ private static void jj_la1_init_2() {
+ jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x1c00,0x1c08,0x0,0x1c08,0x0,0x0,0x3bc1c80,0x7ca0,0x7ca0,0x0,0x0,0x7c20,0x800002,0x0,0x6000,0x3bc1c80,0x0,0x0,0x0,0x1,0x2,0x1c08,0x2,0x1c08,0x3bc1c00,0x3bc1c00,0x3bc0000,0x0,0x3800000,0x8000000,0x8000000,0x3c0000,0x1c00,0x1800,};
+ }
+ private static void jj_la1_init_3() {
+ jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
+ }
+
+ /** Constructor with InputStream. */
+ public ShaclCompactParserJJ(java.io.InputStream stream) {
+ this(stream, null);
+ }
+ /** Constructor with InputStream and supplied encoding */
+ public ShaclCompactParserJJ(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source = new ShaclCompactParserJJTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 40; i++) jj_la1[i] = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream stream) {
+ ReInit(stream, null);
+ }
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 40; i++) jj_la1[i] = -1;
+ }
+
+ /** Constructor. */
+ public ShaclCompactParserJJ(java.io.Reader stream) {
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);
+ token_source = new ShaclCompactParserJJTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 40; i++) jj_la1[i] = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader stream) {
+ jj_input_stream.ReInit(stream, 1, 1);
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 40; i++) jj_la1[i] = -1;
+ }
+
+ /** Constructor with generated Token Manager. */
+ public ShaclCompactParserJJ(ShaclCompactParserJJTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 40; i++) jj_la1[i] = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(ShaclCompactParserJJTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 40; i++) jj_la1[i] = -1;
+ }
+
+ private Token jj_consume_token(int kind) throws ParseException {
+ Token oldToken;
+ if ((oldToken = token).next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ if (token.kind == kind) {
+ jj_gen++;
+ return token;
+ }
+ token = oldToken;
+ jj_kind = kind;
+ throw generateParseException();
+ }
+
+
+/** Get the next Token. */
+ final public Token getNextToken() {
+ if (token.next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ jj_gen++;
+ return token;
+ }
+
+/** Get the specific Token. */
+ final public Token getToken(int index) {
+ Token t = token;
+ for (int i = 0; i < index; i++) {
+ if (t.next != null) t = t.next;
+ else t = t.next = token_source.getNextToken();
+ }
+ return t;
+ }
+
+ private int jj_ntk_f() {
+ if ((jj_nt=token.next) == null)
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+ else
+ return (jj_ntk = jj_nt.kind);
+ }
+
+ private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
+ private int[] jj_expentry;
+ private int jj_kind = -1;
+
+ /** Generate ParseException. */
+ public ParseException generateParseException() {
+ jj_expentries.clear();
+ boolean[] la1tokens = new boolean[104];
+ if (jj_kind >= 0) {
+ la1tokens[jj_kind] = true;
+ jj_kind = -1;
+ }
+ for (int i = 0; i < 40; i++) {
+ if (jj_la1[i] == jj_gen) {
+ for (int j = 0; j < 32; j++) {
+ if ((jj_la1_0[i] & (1<<j)) != 0) {
+ la1tokens[j] = true;
+ }
+ if ((jj_la1_1[i] & (1<<j)) != 0) {
+ la1tokens[32+j] = true;
+ }
+ if ((jj_la1_2[i] & (1<<j)) != 0) {
+ la1tokens[64+j] = true;
+ }
+ if ((jj_la1_3[i] & (1<<j)) != 0) {
+ la1tokens[96+j] = true;
+ }
+ }
+ }
+ }
+ for (int i = 0; i < 104; i++) {
+ if (la1tokens[i]) {
+ jj_expentry = new int[1];
+ jj_expentry[0] = i;
+ jj_expentries.add(jj_expentry);
+ }
+ }
+ int[][] exptokseq = new int[jj_expentries.size()][];
+ for (int i = 0; i < jj_expentries.size(); i++) {
+ exptokseq[i] = jj_expentries.get(i);
+ }
+ return new ParseException(token, exptokseq, tokenImage);
+ }
+
+ /** Enable tracing. */
+ final public void enable_tracing() {
+ }
+
+ /** Disable tracing. */
+ final public void disable_tracing() {
+ }
+
+ }
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ShaclCompactParserJJConstants.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ShaclCompactParserJJConstants.java
new file mode 100644
index 0000000..9900d31
--- /dev/null
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ShaclCompactParserJJConstants.java
@@ -0,0 +1,259 @@
+/* Generated By:JavaCC: Do not edit this line. ShaclCompactParserJJConstants.java */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact.parser;
+
+
+/**
+ * Token literal values and constants.
+ * Generated by org.javacc.parser.OtherFilesGen#start()
+ */
+public interface ShaclCompactParserJJConstants {
+
+ /** End of File. */
+ int EOF = 0;
+ /** RegularExpression Id. */
+ int SINGLE_LINE_COMMENT = 46;
+ /** RegularExpression Id. */
+ int BOM = 47;
+ /** RegularExpression Id. */
+ int BASE = 48;
+ /** RegularExpression Id. */
+ int IMPORTS = 49;
+ /** RegularExpression Id. */
+ int PREFIX = 50;
+ /** RegularExpression Id. */
+ int SHAPE_CLASS = 51;
+ /** RegularExpression Id. */
+ int SHAPE = 52;
+ /** RegularExpression Id. */
+ int TRUE = 53;
+ /** RegularExpression Id. */
+ int FALSE = 54;
+ /** RegularExpression Id. */
+ int HEX = 55;
+ /** RegularExpression Id. */
+ int PLUS = 56;
+ /** RegularExpression Id. */
+ int MINUS = 57;
+ /** RegularExpression Id. */
+ int VBAR = 58;
+ /** RegularExpression Id. */
+ int AT = 59;
+ /** RegularExpression Id. */
+ int CARAT = 60;
+ /** RegularExpression Id. */
+ int DOT = 61;
+ /** RegularExpression Id. */
+ int BANG = 62;
+ /** RegularExpression Id. */
+ int QMARK = 63;
+ /** RegularExpression Id. */
+ int SLASH = 64;
+ /** RegularExpression Id. */
+ int STAR = 65;
+ /** RegularExpression Id. */
+ int EQUALS = 66;
+ /** RegularExpression Id. */
+ int LPAREN = 67;
+ /** RegularExpression Id. */
+ int RPAREN = 68;
+ /** RegularExpression Id. */
+ int LBRACE = 69;
+ /** RegularExpression Id. */
+ int RBRACE = 70;
+ /** RegularExpression Id. */
+ int LBRACKET = 71;
+ /** RegularExpression Id. */
+ int RBRACKET = 72;
+ /** RegularExpression Id. */
+ int UCHAR = 73;
+ /** RegularExpression Id. */
+ int IRIref = 74;
+ /** RegularExpression Id. */
+ int PNAME_NS = 75;
+ /** RegularExpression Id. */
+ int PNAME_LN = 76;
+ /** RegularExpression Id. */
+ int ATPNAME_NS = 77;
+ /** RegularExpression Id. */
+ int ATPNAME_LN = 78;
+ /** RegularExpression Id. */
+ int QUOTE_3D = 79;
+ /** RegularExpression Id. */
+ int QUOTE_3S = 80;
+ /** RegularExpression Id. */
+ int ECHAR = 81;
+ /** RegularExpression Id. */
+ int STRING_LITERAL1 = 82;
+ /** RegularExpression Id. */
+ int STRING_LITERAL2 = 83;
+ /** RegularExpression Id. */
+ int STRING_LITERAL_LONG1 = 84;
+ /** RegularExpression Id. */
+ int STRING_LITERAL_LONG2 = 85;
+ /** RegularExpression Id. */
+ int DIGITS = 86;
+ /** RegularExpression Id. */
+ int INTEGER = 87;
+ /** RegularExpression Id. */
+ int DECIMAL = 88;
+ /** RegularExpression Id. */
+ int DOUBLE = 89;
+ /** RegularExpression Id. */
+ int EXPONENT = 90;
+ /** RegularExpression Id. */
+ int LANGTAG = 91;
+ /** RegularExpression Id. */
+ int A2Z = 92;
+ /** RegularExpression Id. */
+ int A2ZN = 93;
+ /** RegularExpression Id. */
+ int PN_CHARS_BASE = 94;
+ /** RegularExpression Id. */
+ int PN_CHARS_U = 95;
+ /** RegularExpression Id. */
+ int PN_CHARS = 96;
+ /** RegularExpression Id. */
+ int PN_PREFIX = 97;
+ /** RegularExpression Id. */
+ int PN_LOCAL = 98;
+ /** RegularExpression Id. */
+ int VARNAME = 99;
+ /** RegularExpression Id. */
+ int PN_LOCAL_ESC = 100;
+ /** RegularExpression Id. */
+ int PLX = 101;
+ /** RegularExpression Id. */
+ int PERCENT = 102;
+ /** RegularExpression Id. */
+ int UNKNOWN = 103;
+
+ /** Lexical state. */
+ int DEFAULT = 0;
+
+ /** Literal token values. */
+ String[] tokenImage = {
+ "<EOF>",
+ "\"->\"",
+ "\"..\"",
+ "\"BlankNode\"",
+ "\"IRI\"",
+ "\"Literal\"",
+ "\"BlankNodeOrIRI\"",
+ "\"BlankNodeOrLiteral\"",
+ "\"IRIOrLiteral\"",
+ "\"targetNode\"",
+ "\"targetObjectsOf\"",
+ "\"targetSubjectsOf\"",
+ "\"deactivated\"",
+ "\"severity\"",
+ "\"message\"",
+ "\"class\"",
+ "\"datatype\"",
+ "\"nodeKind\"",
+ "\"minExclusive\"",
+ "\"minInclusive\"",
+ "\"maxExclusive\"",
+ "\"maxInclusive\"",
+ "\"minLength\"",
+ "\"maxLength\"",
+ "\"pattern\"",
+ "\"flags\"",
+ "\"languageIn\"",
+ "\"equals\"",
+ "\"disjoint\"",
+ "\"closed\"",
+ "\"ignoredProperties\"",
+ "\"hasValue\"",
+ "\"in\"",
+ "\"uniqueLang\"",
+ "\"lessThan\"",
+ "\"lessThanOrEquals\"",
+ "\"qualifiedValueShape\"",
+ "\"qualifiedMinCount\"",
+ "\"qualifiedMaxCount\"",
+ "\"qualifiedValueShapesDisjoint\"",
+ "\"^^\"",
+ "\" \"",
+ "\"\\t\"",
+ "\"\\n\"",
+ "\"\\r\"",
+ "\"\\f\"",
+ "<SINGLE_LINE_COMMENT>",
+ "\"\\ufeff\"",
+ "\"BASE\"",
+ "\"IMPORTS\"",
+ "\"PREFIX\"",
+ "\"shapeClass\"",
+ "\"shape\"",
+ "\"true\"",
+ "\"false\"",
+ "<HEX>",
+ "\"+\"",
+ "\"-\"",
+ "\"|\"",
+ "\"@\"",
+ "\"^\"",
+ "\".\"",
+ "\"!\"",
+ "\"?\"",
+ "\"/\"",
+ "\"*\"",
+ "\"=\"",
+ "\"(\"",
+ "\")\"",
+ "\"{\"",
+ "\"}\"",
+ "\"[\"",
+ "\"]\"",
+ "<UCHAR>",
+ "<IRIref>",
+ "<PNAME_NS>",
+ "<PNAME_LN>",
+ "<ATPNAME_NS>",
+ "<ATPNAME_LN>",
+ "\"\\\"\\\"\\\"\"",
+ "\"\\\'\\\'\\\'\"",
+ "<ECHAR>",
+ "<STRING_LITERAL1>",
+ "<STRING_LITERAL2>",
+ "<STRING_LITERAL_LONG1>",
+ "<STRING_LITERAL_LONG2>",
+ "<DIGITS>",
+ "<INTEGER>",
+ "<DECIMAL>",
+ "<DOUBLE>",
+ "<EXPONENT>",
+ "<LANGTAG>",
+ "<A2Z>",
+ "<A2ZN>",
+ "<PN_CHARS_BASE>",
+ "<PN_CHARS_U>",
+ "<PN_CHARS>",
+ "<PN_PREFIX>",
+ "<PN_LOCAL>",
+ "<VARNAME>",
+ "<PN_LOCAL_ESC>",
+ "<PLX>",
+ "<PERCENT>",
+ "<UNKNOWN>",
+ };
+
+}
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ShaclCompactParserJJTokenManager.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ShaclCompactParserJJTokenManager.java
new file mode 100644
index 0000000..8f22f85
--- /dev/null
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/ShaclCompactParserJJTokenManager.java
@@ -0,0 +1,2947 @@
+/* ShaclCompactParserJJTokenManager.java */
+/* Generated By:JavaCC: Do not edit this line. ShaclCompactParserJJTokenManager.java */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact.parser;
+import java.util.List;
+import java.util.ArrayList;
+import org.apache.jena.graph.*;
+import org.apache.jena.sparql.path.*;
+import org.apache.jena.shacl.compact.*;
+
+/** Token Manager. */
+@SuppressWarnings("unused")public class ShaclCompactParserJJTokenManager implements ShaclCompactParserJJConstants {
+
+ /** Debug output. */
+ public java.io.PrintStream debugStream = System.out;
+ /** Set debug output. */
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private int jjStopAtPos(int pos, int kind)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ return pos + 1;
+}
+private int jjMoveStringLiteralDfa0_0(){
+ switch(curChar)
+ {
+ case 9:
+ jjmatchedKind = 42;
+ return jjMoveNfa_0(0, 0);
+ case 10:
+ jjmatchedKind = 43;
+ return jjMoveNfa_0(0, 0);
+ case 12:
+ jjmatchedKind = 45;
+ return jjMoveNfa_0(0, 0);
+ case 13:
+ jjmatchedKind = 44;
+ return jjMoveNfa_0(0, 0);
+ case 32:
+ jjmatchedKind = 41;
+ return jjMoveNfa_0(0, 0);
+ case 33:
+ jjmatchedKind = 62;
+ return jjMoveNfa_0(0, 0);
+ case 40:
+ jjmatchedKind = 67;
+ return jjMoveNfa_0(0, 0);
+ case 41:
+ jjmatchedKind = 68;
+ return jjMoveNfa_0(0, 0);
+ case 42:
+ jjmatchedKind = 65;
+ return jjMoveNfa_0(0, 0);
+ case 43:
+ jjmatchedKind = 56;
+ return jjMoveNfa_0(0, 0);
+ case 45:
+ jjmatchedKind = 57;
+ return jjMoveStringLiteralDfa1_0(0x2L);
+ case 46:
+ jjmatchedKind = 61;
+ return jjMoveStringLiteralDfa1_0(0x4L);
+ case 47:
+ jjmatchedKind = 64;
+ return jjMoveNfa_0(0, 0);
+ case 61:
+ jjmatchedKind = 66;
+ return jjMoveNfa_0(0, 0);
+ case 63:
+ jjmatchedKind = 63;
+ return jjMoveNfa_0(0, 0);
+ case 64:
+ jjmatchedKind = 59;
+ return jjMoveNfa_0(0, 0);
+ case 66:
+ return jjMoveStringLiteralDfa1_0(0x10000000000c8L);
+ case 70:
+ return jjMoveStringLiteralDfa1_0(0x40000000000000L);
+ case 73:
+ return jjMoveStringLiteralDfa1_0(0x2000000000110L);
+ case 76:
+ return jjMoveStringLiteralDfa1_0(0x20L);
+ case 80:
+ return jjMoveStringLiteralDfa1_0(0x4000000000000L);
+ case 83:
+ return jjMoveStringLiteralDfa1_0(0x18000000000000L);
+ case 84:
+ return jjMoveStringLiteralDfa1_0(0x20000000000000L);
+ case 91:
+ jjmatchedKind = 71;
+ return jjMoveNfa_0(0, 0);
+ case 93:
+ jjmatchedKind = 72;
+ return jjMoveNfa_0(0, 0);
+ case 94:
+ jjmatchedKind = 60;
+ return jjMoveStringLiteralDfa1_0(0x10000000000L);
+ case 98:
+ return jjMoveStringLiteralDfa1_0(0x1000000000000L);
+ case 99:
+ return jjMoveStringLiteralDfa1_0(0x20008000L);
+ case 100:
+ return jjMoveStringLiteralDfa1_0(0x10011000L);
+ case 101:
+ return jjMoveStringLiteralDfa1_0(0x8000000L);
+ case 102:
+ return jjMoveStringLiteralDfa1_0(0x40000002000000L);
+ case 104:
+ return jjMoveStringLiteralDfa1_0(0x80000000L);
+ case 105:
+ return jjMoveStringLiteralDfa1_0(0x2000140000000L);
+ case 108:
+ return jjMoveStringLiteralDfa1_0(0xc04000000L);
+ case 109:
+ return jjMoveStringLiteralDfa1_0(0xfc4000L);
+ case 110:
+ return jjMoveStringLiteralDfa1_0(0x20000L);
+ case 112:
+ return jjMoveStringLiteralDfa1_0(0x4000001000000L);
+ case 113:
+ return jjMoveStringLiteralDfa1_0(0xf000000000L);
+ case 115:
+ return jjMoveStringLiteralDfa1_0(0x18000000002000L);
+ case 116:
+ return jjMoveStringLiteralDfa1_0(0x20000000000e00L);
+ case 117:
+ return jjMoveStringLiteralDfa1_0(0x200000000L);
+ case 123:
+ jjmatchedKind = 69;
+ return jjMoveNfa_0(0, 0);
+ case 124:
+ jjmatchedKind = 58;
+ return jjMoveNfa_0(0, 0);
+ case 125:
+ jjmatchedKind = 70;
+ return jjMoveNfa_0(0, 0);
+ case 65279:
+ jjmatchedKind = 47;
+ return jjMoveNfa_0(0, 0);
+ default :
+ return jjMoveNfa_0(0, 0);
+ }
+}
+private int jjMoveStringLiteralDfa1_0(long active0){
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 0);
+ }
+ switch(curChar)
+ {
+ case 46:
+ if ((active0 & 0x4L) != 0L)
+ {
+ jjmatchedKind = 2;
+ jjmatchedPos = 1;
+ }
+ break;
+ case 62:
+ if ((active0 & 0x2L) != 0L)
+ {
+ jjmatchedKind = 1;
+ jjmatchedPos = 1;
+ }
+ break;
+ case 65:
+ return jjMoveStringLiteralDfa2_0(active0, 0x41000000000000L);
+ case 72:
+ return jjMoveStringLiteralDfa2_0(active0, 0x18000000000000L);
+ case 77:
+ return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L);
+ case 82:
+ return jjMoveStringLiteralDfa2_0(active0, 0x24000000000110L);
+ case 94:
+ if ((active0 & 0x10000000000L) != 0L)
+ {
+ jjmatchedKind = 40;
+ jjmatchedPos = 1;
+ }
+ break;
+ case 97:
+ return jjMoveStringLiteralDfa2_0(active0, 0x41000085b10e00L);
+ case 101:
+ return jjMoveStringLiteralDfa2_0(active0, 0xc00007000L);
+ case 103:
+ return jjMoveStringLiteralDfa2_0(active0, 0x40000000L);
+ case 104:
+ return jjMoveStringLiteralDfa2_0(active0, 0x18000000000000L);
+ case 105:
+ return jjMoveStringLiteralDfa2_0(active0, 0x104c0020L);
+ case 108:
+ return jjMoveStringLiteralDfa2_0(active0, 0x220080c8L);
+ case 109:
+ return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L);
+ case 110:
+ if ((active0 & 0x100000000L) != 0L)
+ {
+ jjmatchedKind = 32;
+ jjmatchedPos = 1;
+ }
+ return jjMoveStringLiteralDfa2_0(active0, 0x200000000L);
+ case 111:
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000L);
+ case 113:
+ return jjMoveStringLiteralDfa2_0(active0, 0x8000000L);
+ case 114:
+ return jjMoveStringLiteralDfa2_0(active0, 0x24000000000000L);
+ case 117:
+ return jjMoveStringLiteralDfa2_0(active0, 0xf000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 1);
+}
+private int jjMoveStringLiteralDfa2_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 1);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 1);
+ }
+ switch(curChar)
+ {
+ case 65:
+ return jjMoveStringLiteralDfa3_0(active0, 0x18000000000000L);
+ case 69:
+ return jjMoveStringLiteralDfa3_0(active0, 0x4000000000000L);
+ case 73:
+ if ((active0 & 0x10L) != 0L)
+ {
+ jjmatchedKind = 4;
+ jjmatchedPos = 2;
+ }
+ return jjMoveStringLiteralDfa3_0(active0, 0x100L);
+ case 76:
+ return jjMoveStringLiteralDfa3_0(active0, 0x40000000000000L);
+ case 80:
+ return jjMoveStringLiteralDfa3_0(active0, 0x2000000000000L);
+ case 83:
+ return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L);
+ case 85:
+ return jjMoveStringLiteralDfa3_0(active0, 0x20000000000000L);
+ case 97:
+ return jjMoveStringLiteralDfa3_0(active0, 0x1800f0020090c8L);
+ case 100:
+ return jjMoveStringLiteralDfa3_0(active0, 0x20000L);
+ case 101:
+ return jjMoveStringLiteralDfa3_0(active0, 0x4000000000000L);
+ case 105:
+ return jjMoveStringLiteralDfa3_0(active0, 0x200000000L);
+ case 108:
+ return jjMoveStringLiteralDfa3_0(active0, 0x40000000000000L);
+ case 110:
+ return jjMoveStringLiteralDfa3_0(active0, 0x444c0000L);
+ case 111:
+ return jjMoveStringLiteralDfa3_0(active0, 0x20000000L);
+ case 112:
+ return jjMoveStringLiteralDfa3_0(active0, 0x2000000000000L);
+ case 114:
+ return jjMoveStringLiteralDfa3_0(active0, 0xe00L);
+ case 115:
+ return jjMoveStringLiteralDfa3_0(active0, 0x1000c90004000L);
+ case 116:
+ return jjMoveStringLiteralDfa3_0(active0, 0x1010020L);
+ case 117:
+ return jjMoveStringLiteralDfa3_0(active0, 0x20000008000000L);
+ case 118:
+ return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
+ case 120:
+ return jjMoveStringLiteralDfa3_0(active0, 0xb00000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 2);
+}
+private int jjMoveStringLiteralDfa3_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 2);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 2);
+ }
+ switch(curChar)
+ {
+ case 69:
+ if ((active0 & 0x1000000000000L) != 0L)
+ {
+ jjmatchedKind = 48;
+ jjmatchedPos = 3;
+ }
+ else if ((active0 & 0x20000000000000L) != 0L)
+ {
+ jjmatchedKind = 53;
+ jjmatchedPos = 3;
+ }
+ return jjMoveStringLiteralDfa4_0(active0, 0x140000L);
+ case 70:
+ return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L);
+ case 73:
+ return jjMoveStringLiteralDfa4_0(active0, 0x280000L);
+ case 76:
+ return jjMoveStringLiteralDfa4_0(active0, 0xc00000L);
+ case 79:
+ return jjMoveStringLiteralDfa4_0(active0, 0x2000000000100L);
+ case 80:
+ return jjMoveStringLiteralDfa4_0(active0, 0x18000000000000L);
+ case 83:
+ return jjMoveStringLiteralDfa4_0(active0, 0x40000000000000L);
+ case 86:
+ return jjMoveStringLiteralDfa4_0(active0, 0x80000000L);
+ case 97:
+ return jjMoveStringLiteralDfa4_0(active0, 0x8010000L);
+ case 99:
+ return jjMoveStringLiteralDfa4_0(active0, 0x1000L);
+ case 101:
+ if ((active0 & 0x1000000000000L) != 0L)
+ {
+ jjmatchedKind = 48;
+ jjmatchedPos = 3;
+ }
+ else if ((active0 & 0x20000000000000L) != 0L)
+ {
+ jjmatchedKind = 53;
+ jjmatchedPos = 3;
+ }
+ return jjMoveStringLiteralDfa4_0(active0, 0x22020L);
+ case 102:
+ return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L);
+ case 103:
+ return jjMoveStringLiteralDfa4_0(active0, 0x6000e00L);
+ case 106:
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000000L);
+ case 108:
+ return jjMoveStringLiteralDfa4_0(active0, 0xf000000000L);
+ case 110:
+ return jjMoveStringLiteralDfa4_0(active0, 0xc8L);
+ case 111:
+ return jjMoveStringLiteralDfa4_0(active0, 0x2000040000000L);
+ case 112:
+ return jjMoveStringLiteralDfa4_0(active0, 0x18000000000000L);
+ case 113:
+ return jjMoveStringLiteralDfa4_0(active0, 0x200000000L);
+ case 115:
+ return jjMoveStringLiteralDfa4_0(active0, 0x40000c2000c000L);
+ case 116:
+ return jjMoveStringLiteralDfa4_0(active0, 0x1000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 3);
+}
+private int jjMoveStringLiteralDfa4_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 3);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 3);
+ }
+ switch(curChar)
+ {
+ case 69:
+ if ((active0 & 0x10000000000000L) != 0L)
+ {
+ jjmatchedKind = 52;
+ jjmatchedPos = 4;
+ }
+ else if ((active0 & 0x40000000000000L) != 0L)
+ {
+ jjmatchedKind = 54;
+ jjmatchedPos = 4;
+ }
+ return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000L);
+ case 73:
+ return jjMoveStringLiteralDfa5_0(active0, 0x4000000000000L);
+ case 75:
+ return jjMoveStringLiteralDfa5_0(active0, 0x20000L);
+ case 82:
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000000000000L);
+ case 84:
+ return jjMoveStringLiteralDfa5_0(active0, 0xc00000000L);
+ case 97:
+ return jjMoveStringLiteralDfa5_0(active0, 0x80004000L);
+ case 101:
+ if ((active0 & 0x10000000000000L) != 0L)
+ {
+ jjmatchedKind = 52;
+ jjmatchedPos = 4;
+ }
+ else if ((active0 & 0x40000000000000L) != 0L)
+ {
+ jjmatchedKind = 54;
+ jjmatchedPos = 4;
+ }
+ return jjMoveStringLiteralDfa5_0(active0, 0x8000021c00e00L);
+ case 105:
+ return jjMoveStringLiteralDfa5_0(active0, 0x400f000000000L);
+ case 107:
+ return jjMoveStringLiteralDfa5_0(active0, 0xc8L);
+ case 108:
+ return jjMoveStringLiteralDfa5_0(active0, 0x8000000L);
+ case 110:
+ return jjMoveStringLiteralDfa5_0(active0, 0x280000L);
+ case 111:
+ return jjMoveStringLiteralDfa5_0(active0, 0x10000000L);
+ case 114:
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000040002120L);
+ case 115:
+ if ((active0 & 0x8000L) != 0L)
+ {
+ jjmatchedKind = 15;
+ jjmatchedPos = 4;
+ }
+ else if ((active0 & 0x2000000L) != 0L)
+ {
+ jjmatchedKind = 25;
+ jjmatchedPos = 4;
+ }
+ break;
+ case 116:
+ return jjMoveStringLiteralDfa5_0(active0, 0x11000L);
+ case 117:
+ return jjMoveStringLiteralDfa5_0(active0, 0x204000000L);
+ case 120:
+ return jjMoveStringLiteralDfa5_0(active0, 0x140000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 4);
+}
+private int jjMoveStringLiteralDfa5_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 4);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 4);
+ }
+ switch(curChar)
+ {
+ case 67:
+ return jjMoveStringLiteralDfa6_0(active0, 0x8000000000000L);
+ case 76:
+ return jjMoveStringLiteralDfa6_0(active0, 0x100L);
+ case 78:
+ return jjMoveStringLiteralDfa6_0(active0, 0xc8L);
+ case 84:
+ return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000L);
+ case 88:
+ if ((active0 & 0x4000000000000L) != 0L)
+ {
+ jjmatchedKind = 50;
+ jjmatchedPos = 5;
+ }
+ break;
+ case 97:
+ return jjMoveStringLiteralDfa6_0(active0, 0x4000020L);
+ case 99:
+ return jjMoveStringLiteralDfa6_0(active0, 0x80000003c0000L);
+ case 100:
+ if ((active0 & 0x20000000L) != 0L)
+ {
+ jjmatchedKind = 29;
+ jjmatchedPos = 5;
+ }
+ break;
+ case 101:
+ return jjMoveStringLiteralDfa6_0(active0, 0x240000000L);
+ case 102:
+ return jjMoveStringLiteralDfa6_0(active0, 0xf000000000L);
+ case 103:
+ return jjMoveStringLiteralDfa6_0(active0, 0x4000L);
+ case 104:
+ return jjMoveStringLiteralDfa6_0(active0, 0xc00000000L);
+ case 105:
+ return jjMoveStringLiteralDfa6_0(active0, 0x10023000L);
+ case 108:
+ return jjMoveStringLiteralDfa6_0(active0, 0x80000000L);
+ case 110:
+ return jjMoveStringLiteralDfa6_0(active0, 0xc00000L);
+ case 114:
+ return jjMoveStringLiteralDfa6_0(active0, 0x1000000L);
+ case 115:
+ if ((active0 & 0x8000000L) != 0L)
+ {
+ jjmatchedKind = 27;
+ jjmatchedPos = 5;
+ }
+ break;
+ case 116:
+ return jjMoveStringLiteralDfa6_0(active0, 0x2000000000e00L);
+ case 120:
+ if ((active0 & 0x4000000000000L) != 0L)
+ {
+ jjmatchedKind = 50;
+ jjmatchedPos = 5;
+ }
+ break;
+ case 121:
+ return jjMoveStringLiteralDfa6_0(active0, 0x10000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 5);
+}
+private int jjMoveStringLiteralDfa6_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 5);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 5);
+ }
+ switch(curChar)
+ {
+ case 76:
+ return jjMoveStringLiteralDfa7_0(active0, 0x8000200000000L);
+ case 78:
+ return jjMoveStringLiteralDfa7_0(active0, 0x200L);
+ case 79:
+ return jjMoveStringLiteralDfa7_0(active0, 0x400L);
+ case 83:
+ if ((active0 & 0x2000000000000L) != 0L)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 6;
+ }
+ return jjMoveStringLiteralDfa7_0(active0, 0x800L);
+ case 97:
+ return jjMoveStringLiteralDfa7_0(active0, 0xc00000000L);
+ case 100:
+ return jjMoveStringLiteralDfa7_0(active0, 0x40000000L);
+ case 101:
+ if ((active0 & 0x4000L) != 0L)
+ {
+ jjmatchedKind = 14;
+ jjmatchedPos = 6;
+ }
+ break;
+ case 103:
+ return jjMoveStringLiteralDfa7_0(active0, 0x4c00000L);
+ case 105:
+ return jjMoveStringLiteralDfa7_0(active0, 0xf000000100L);
+ case 108:
+ if ((active0 & 0x20L) != 0L)
+ {
+ jjmatchedKind = 5;
+ jjmatchedPos = 6;
+ }
+ return jjMoveStringLiteralDfa7_0(active0, 0x80000003c0000L);
+ case 110:
+ if ((active0 & 0x1000000L) != 0L)
+ {
+ jjmatchedKind = 24;
+ jjmatchedPos = 6;
+ }
+ return jjMoveStringLiteralDfa7_0(active0, 0x10020000L);
+ case 111:
+ return jjMoveStringLiteralDfa7_0(active0, 0xc8L);
+ case 112:
+ return jjMoveStringLiteralDfa7_0(active0, 0x10000L);
+ case 115:
+ if ((active0 & 0x2000000000000L) != 0L)
+ {
+ jjmatchedKind = 49;
+ jjmatchedPos = 6;
+ }
+ break;
+ case 116:
+ return jjMoveStringLiteralDfa7_0(active0, 0x2000L);
+ case 117:
+ return jjMoveStringLiteralDfa7_0(active0, 0x80000000L);
+ case 118:
+ return jjMoveStringLiteralDfa7_0(active0, 0x1000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 6);
+}
+private int jjMoveStringLiteralDfa7_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 6);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 6);
+ }
+ switch(curChar)
+ {
+ case 65:
+ return jjMoveStringLiteralDfa8_0(active0, 0x8000000000000L);
+ case 80:
+ return jjMoveStringLiteralDfa8_0(active0, 0x40000000L);
+ case 97:
+ return jjMoveStringLiteralDfa8_0(active0, 0x8000200001000L);
+ case 98:
+ return jjMoveStringLiteralDfa8_0(active0, 0x400L);
+ case 100:
+ if ((active0 & 0x20000L) != 0L)
+ {
+ jjmatchedKind = 17;
+ jjmatchedPos = 7;
+ }
+ return jjMoveStringLiteralDfa8_0(active0, 0xc8L);
+ case 101:
+ if ((active0 & 0x10000L) != 0L)
+ {
+ jjmatchedKind = 16;
+ jjmatchedPos = 7;
+ }
+ else if ((active0 & 0x80000000L) != 0L)
+ {
+ jjmatchedKind = 31;
+ jjmatchedPos = 7;
+ }
+ return jjMoveStringLiteralDfa8_0(active0, 0xf004000000L);
+ case 110:
+ if ((active0 & 0x400000000L) != 0L)
+ {
+ jjmatchedKind = 34;
+ jjmatchedPos = 7;
+ }
+ return jjMoveStringLiteralDfa8_0(active0, 0x800000000L);
+ case 111:
+ return jjMoveStringLiteralDfa8_0(active0, 0x200L);
+ case 116:
+ if ((active0 & 0x10000000L) != 0L)
+ {
+ jjmatchedKind = 28;
+ jjmatchedPos = 7;
+ }
+ return jjMoveStringLiteralDfa8_0(active0, 0xc00100L);
+ case 117:
+ return jjMoveStringLiteralDfa8_0(active0, 0x3c0800L);
+ case 121:
+ if ((active0 & 0x2000L) != 0L)
+ {
+ jjmatchedKind = 13;
+ jjmatchedPos = 7;
+ }
+ break;
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 7);
+}
+private int jjMoveStringLiteralDfa8_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 7);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 7);
+ }
+ switch(curChar)
+ {
+ case 73:
+ return jjMoveStringLiteralDfa9_0(active0, 0x4000000L);
+ case 79:
+ return jjMoveStringLiteralDfa9_0(active0, 0x800000000L);
+ case 83:
+ return jjMoveStringLiteralDfa9_0(active0, 0x8000000000000L);
+ case 98:
+ return jjMoveStringLiteralDfa9_0(active0, 0x800L);
+ case 100:
+ return jjMoveStringLiteralDfa9_0(active0, 0xf000000200L);
+ case 101:
+ if ((active0 & 0x8L) != 0L)
+ {
+ jjmatchedKind = 3;
+ jjmatchedPos = 8;
+ }
+ return jjMoveStringLiteralDfa9_0(active0, 0x1c0L);
+ case 104:
+ if ((active0 & 0x400000L) != 0L)
+ {
+ jjmatchedKind = 22;
+ jjmatchedPos = 8;
+ }
+ else if ((active0 & 0x800000L) != 0L)
+ {
+ jjmatchedKind = 23;
+ jjmatchedPos = 8;
+ }
+ break;
+ case 106:
+ return jjMoveStringLiteralDfa9_0(active0, 0x400L);
+ case 110:
+ return jjMoveStringLiteralDfa9_0(active0, 0x200000000L);
+ case 114:
+ return jjMoveStringLiteralDfa9_0(active0, 0x40000000L);
+ case 115:
+ return jjMoveStringLiteralDfa9_0(active0, 0x80000003c0000L);
+ case 116:
+ return jjMoveStringLiteralDfa9_0(active0, 0x1000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 8);
+}
+private int jjMoveStringLiteralDfa9_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 8);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 8);
+ }
+ switch(curChar)
+ {
+ case 77:
+ return jjMoveStringLiteralDfa10_0(active0, 0x6000000000L);
+ case 79:
+ return jjMoveStringLiteralDfa10_0(active0, 0xc0L);
+ case 83:
+ if ((active0 & 0x8000000000000L) != 0L)
+ {
+ jjmatchedKind = 51;
+ jjmatchedPos = 9;
+ }
+ break;
+ case 86:
+ return jjMoveStringLiteralDfa10_0(active0, 0x9000000000L);
+ case 101:
+ if ((active0 & 0x200L) != 0L)
+ {
+ jjmatchedKind = 9;
+ jjmatchedPos = 9;
+ }
+ return jjMoveStringLiteralDfa10_0(active0, 0x1400L);
+ case 103:
+ if ((active0 & 0x200000000L) != 0L)
+ {
+ jjmatchedKind = 33;
+ jjmatchedPos = 9;
+ }
+ break;
+ case 105:
+ return jjMoveStringLiteralDfa10_0(active0, 0x3c0000L);
+ case 106:
+ return jjMoveStringLiteralDfa10_0(active0, 0x800L);
+ case 110:
+ if ((active0 & 0x4000000L) != 0L)
+ {
+ jjmatchedKind = 26;
+ jjmatchedPos = 9;
+ }
+ break;
+ case 111:
+ return jjMoveStringLiteralDfa10_0(active0, 0x40000000L);
+ case 114:
+ return jjMoveStringLiteralDfa10_0(active0, 0x800000100L);
+ case 115:
+ if ((active0 & 0x8000000000000L) != 0L)
+ {
+ jjmatchedKind = 51;
+ jjmatchedPos = 9;
+ }
+ break;
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 9);
+}
+private int jjMoveStringLiteralDfa10_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 9);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 9);
+ }
+ switch(curChar)
+ {
+ case 69:
+ return jjMoveStringLiteralDfa11_0(active0, 0x800000000L);
+ case 97:
+ return jjMoveStringLiteralDfa11_0(active0, 0xd000000100L);
+ case 99:
+ return jjMoveStringLiteralDfa11_0(active0, 0x400L);
+ case 100:
+ if ((active0 & 0x1000L) != 0L)
+ {
+ jjmatchedKind = 12;
+ jjmatchedPos = 10;
+ }
+ break;
+ case 101:
+ return jjMoveStringLiteralDfa11_0(active0, 0x800L);
+ case 105:
+ return jjMoveStringLiteralDfa11_0(active0, 0x2000000000L);
+ case 112:
+ return jjMoveStringLiteralDfa11_0(active0, 0x40000000L);
+ case 114:
+ return jjMoveStringLiteralDfa11_0(active0, 0xc0L);
+ case 118:
+ return jjMoveStringLiteralDfa11_0(active0, 0x3c0000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 10);
+}
+private int jjMoveStringLiteralDfa11_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 10);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 10);
+ }
+ switch(curChar)
+ {
+ case 73:
+ return jjMoveStringLiteralDfa12_0(active0, 0x40L);
+ case 76:
+ return jjMoveStringLiteralDfa12_0(active0, 0x80L);
+ case 99:
+ return jjMoveStringLiteralDfa12_0(active0, 0x800L);
+ case 101:
+ if ((active0 & 0x40000L) != 0L)
+ {
+ jjmatchedKind = 18;
+ jjmatchedPos = 11;
+ }
+ else if ((active0 & 0x80000L) != 0L)
+ {
+ jjmatchedKind = 19;
+ jjmatchedPos = 11;
+ }
+ else if ((active0 & 0x100000L) != 0L)
+ {
+ jjmatchedKind = 20;
+ jjmatchedPos = 11;
+ }
+ else if ((active0 & 0x200000L) != 0L)
+ {
+ jjmatchedKind = 21;
+ jjmatchedPos = 11;
+ }
+ return jjMoveStringLiteralDfa12_0(active0, 0x40000000L);
+ case 108:
+ if ((active0 & 0x100L) != 0L)
+ {
+ jjmatchedKind = 8;
+ jjmatchedPos = 11;
+ }
+ return jjMoveStringLiteralDfa12_0(active0, 0x9000000000L);
+ case 110:
+ return jjMoveStringLiteralDfa12_0(active0, 0x2000000000L);
+ case 113:
+ return jjMoveStringLiteralDfa12_0(active0, 0x800000000L);
+ case 116:
+ return jjMoveStringLiteralDfa12_0(active0, 0x400L);
+ case 120:
+ return jjMoveStringLiteralDfa12_0(active0, 0x4000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 11);
+}
+private int jjMoveStringLiteralDfa12_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 11);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 11);
+ }
+ switch(curChar)
+ {
+ case 67:
+ return jjMoveStringLiteralDfa13_0(active0, 0x6000000000L);
+ case 82:
+ return jjMoveStringLiteralDfa13_0(active0, 0x40L);
+ case 105:
+ return jjMoveStringLiteralDfa13_0(active0, 0x80L);
+ case 114:
+ return jjMoveStringLiteralDfa13_0(active0, 0x40000000L);
+ case 115:
+ return jjMoveStringLiteralDfa13_0(active0, 0x400L);
+ case 116:
+ return jjMoveStringLiteralDfa13_0(active0, 0x800L);
+ case 117:
+ return jjMoveStringLiteralDfa13_0(active0, 0x9800000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 12);
+}
+private int jjMoveStringLiteralDfa13_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 12);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 12);
+ }
+ switch(curChar)
+ {
+ case 73:
+ if ((active0 & 0x40L) != 0L)
+ {
+ jjmatchedKind = 6;
+ jjmatchedPos = 13;
+ }
+ break;
+ case 79:
+ return jjMoveStringLiteralDfa14_0(active0, 0x400L);
+ case 97:
+ return jjMoveStringLiteralDfa14_0(active0, 0x800000000L);
+ case 101:
+ return jjMoveStringLiteralDfa14_0(active0, 0x9000000000L);
+ case 111:
+ return jjMoveStringLiteralDfa14_0(active0, 0x6000000000L);
+ case 115:
+ return jjMoveStringLiteralDfa14_0(active0, 0x800L);
+ case 116:
+ return jjMoveStringLiteralDfa14_0(active0, 0x40000080L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 13);
+}
+private int jjMoveStringLiteralDfa14_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 13);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 13);
+ }
+ switch(curChar)
+ {
+ case 79:
+ return jjMoveStringLiteralDfa15_0(active0, 0x800L);
+ case 83:
+ return jjMoveStringLiteralDfa15_0(active0, 0x9000000000L);
+ case 101:
+ return jjMoveStringLiteralDfa15_0(active0, 0x80L);
+ case 102:
+ if ((active0 & 0x400L) != 0L)
+ {
+ jjmatchedKind = 10;
+ jjmatchedPos = 14;
+ }
+ break;
+ case 105:
+ return jjMoveStringLiteralDfa15_0(active0, 0x40000000L);
+ case 108:
+ return jjMoveStringLiteralDfa15_0(active0, 0x800000000L);
+ case 117:
+ return jjMoveStringLiteralDfa15_0(active0, 0x6000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 14);
+}
+private int jjMoveStringLiteralDfa15_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 14);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 14);
+ }
+ switch(curChar)
+ {
+ case 101:
+ return jjMoveStringLiteralDfa16_0(active0, 0x40000000L);
+ case 102:
+ if ((active0 & 0x800L) != 0L)
+ {
+ jjmatchedKind = 11;
+ jjmatchedPos = 15;
+ }
+ break;
+ case 104:
+ return jjMoveStringLiteralDfa16_0(active0, 0x9000000000L);
+ case 110:
+ return jjMoveStringLiteralDfa16_0(active0, 0x6000000000L);
+ case 114:
+ return jjMoveStringLiteralDfa16_0(active0, 0x80L);
+ case 115:
+ if ((active0 & 0x800000000L) != 0L)
+ {
+ jjmatchedKind = 35;
+ jjmatchedPos = 15;
+ }
+ break;
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 15);
+}
+private int jjMoveStringLiteralDfa16_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 15);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 15);
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa17_0(active0, 0x9000000080L);
+ case 115:
+ if ((active0 & 0x40000000L) != 0L)
+ {
+ jjmatchedKind = 30;
+ jjmatchedPos = 16;
+ }
+ break;
+ case 116:
+ if ((active0 & 0x2000000000L) != 0L)
+ {
+ jjmatchedKind = 37;
+ jjmatchedPos = 16;
+ }
+ else if ((active0 & 0x4000000000L) != 0L)
+ {
+ jjmatchedKind = 38;
+ jjmatchedPos = 16;
+ }
+ break;
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 16);
+}
+private int jjMoveStringLiteralDfa17_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 16);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 16);
+ }
+ switch(curChar)
+ {
+ case 108:
+ if ((active0 & 0x80L) != 0L)
+ {
+ jjmatchedKind = 7;
+ jjmatchedPos = 17;
+ }
+ break;
+ case 112:
+ return jjMoveStringLiteralDfa18_0(active0, 0x9000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 17);
+}
+private int jjMoveStringLiteralDfa18_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 17);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 17);
+ }
+ switch(curChar)
+ {
+ case 101:
+ if ((active0 & 0x1000000000L) != 0L)
+ {
+ jjmatchedKind = 36;
+ jjmatchedPos = 18;
+ }
+ return jjMoveStringLiteralDfa19_0(active0, 0x8000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 18);
+}
+private int jjMoveStringLiteralDfa19_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 18);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 18);
+ }
+ switch(curChar)
+ {
+ case 115:
+ return jjMoveStringLiteralDfa20_0(active0, 0x8000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 19);
+}
+private int jjMoveStringLiteralDfa20_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 19);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 19);
+ }
+ switch(curChar)
+ {
+ case 68:
+ return jjMoveStringLiteralDfa21_0(active0, 0x8000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 20);
+}
+private int jjMoveStringLiteralDfa21_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 20);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 20);
+ }
+ switch(curChar)
+ {
+ case 105:
+ return jjMoveStringLiteralDfa22_0(active0, 0x8000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 21);
+}
+private int jjMoveStringLiteralDfa22_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 21);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 21);
+ }
+ switch(curChar)
+ {
+ case 115:
+ return jjMoveStringLiteralDfa23_0(active0, 0x8000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 22);
+}
+private int jjMoveStringLiteralDfa23_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 22);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 22);
+ }
+ switch(curChar)
+ {
+ case 106:
+ return jjMoveStringLiteralDfa24_0(active0, 0x8000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 23);
+}
+private int jjMoveStringLiteralDfa24_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 23);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 23);
+ }
+ switch(curChar)
+ {
+ case 111:
+ return jjMoveStringLiteralDfa25_0(active0, 0x8000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 24);
+}
+private int jjMoveStringLiteralDfa25_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 24);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 24);
+ }
+ switch(curChar)
+ {
+ case 105:
+ return jjMoveStringLiteralDfa26_0(active0, 0x8000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 25);
+}
+private int jjMoveStringLiteralDfa26_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 25);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 25);
+ }
+ switch(curChar)
+ {
+ case 110:
+ return jjMoveStringLiteralDfa27_0(active0, 0x8000000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 26);
+}
+private int jjMoveStringLiteralDfa27_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 26);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 26);
+ }
+ switch(curChar)
+ {
+ case 116:
+ if ((active0 & 0x8000000000L) != 0L)
+ {
+ jjmatchedKind = 39;
+ jjmatchedPos = 27;
+ }
+ break;
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 27);
+}
+static final long[] jjbitVec0 = {
+ 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec2 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec3 = {
+ 0xfffe7000fffffff6L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0x7e00000000ffffffL
+};
+static final long[] jjbitVec4 = {
+ 0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
+};
+static final long[] jjbitVec5 = {
+ 0x0L, 0xbfff000000000000L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec6 = {
+ 0x3000L, 0xffff000000000000L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec7 = {
+ 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
+};
+static final long[] jjbitVec8 = {
+ 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffL
+};
+static final long[] jjbitVec9 = {
+ 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffffffffL
+};
+static final long[] jjbitVec10 = {
+ 0x0L, 0x0L, 0x80000000000000L, 0xff7fffffff7fffffL
+};
+static final long[] jjbitVec11 = {
+ 0xffffffffffffffffL, 0xbfffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec12 = {
+ 0x8000000000003000L, 0xffff000000000001L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+private int jjMoveNfa_0(int startState, int curPos)
+{
+ int strKind = jjmatchedKind;
+ int strPos = jjmatchedPos;
+ int seenUpto;
+ input_stream.backup(seenUpto = curPos + 1);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { throw new Error("Internal Error"); }
+ curPos = 0;
+ int startsAt = 0;
+ jjnewStateCnt = 183;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int kind = 0x7fffffff;
+ for (;;)
+ {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64)
+ {
+ long l = 1L << curChar;
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if ((0x3ff000000000000L & l) != 0L)
+ {
+ if (kind > 87)
+ kind = 87;
+ { jjCheckNAddStates(0, 6); }
+ }
+ else if ((0x280000000000L & l) != 0L)
+ { jjCheckNAddStates(7, 11); }
+ else if (curChar == 46)
+ { jjCheckNAddTwoStates(164, 166); }
+ else if (curChar == 58)
+ {
+ if (kind > 75)
+ kind = 75;
+ { jjCheckNAddStates(12, 14); }
+ }
+ else if (curChar == 34)
+ jjstateSet[jjnewStateCnt++] = 106;
+ else if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 82;
+ else if (curChar == 60)
+ { jjCheckNAddStates(15, 17); }
+ else if (curChar == 35)
+ {
+ if (kind > 46)
+ kind = 46;
+ { jjCheckNAddStates(18, 20); }
+ }
+ if (curChar == 34)
+ { jjCheckNAddStates(21, 23); }
+ else if (curChar == 39)
+ { jjCheckNAddStates(24, 26); }
+ break;
+ case 1:
+ if ((0xffffffffffffdbffL & l) == 0L)
+ break;
+ if (kind > 46)
+ kind = 46;
+ { jjCheckNAddStates(18, 20); }
+ break;
+ case 2:
+ if ((0x2400L & l) != 0L && kind > 46)
+ kind = 46;
+ break;
+ case 3:
+ if (curChar == 10 && kind > 46)
+ kind = 46;
+ break;
+ case 4:
+ if (curChar == 13)
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 5:
+ if (curChar == 60)
+ { jjCheckNAddStates(15, 17); }
+ break;
+ case 6:
+ if ((0xaffffffa00000000L & l) != 0L)
+ { jjCheckNAddStates(15, 17); }
+ break;
+ case 9:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 10;
+ break;
+ case 10:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 11;
+ break;
+ case 11:
+ case 21:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAdd(12); }
+ break;
+ case 12:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddStates(15, 17); }
+ break;
+ case 13:
+ if (curChar == 62 && kind > 74)
+ kind = 74;
+ break;
+ case 15:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 16;
+ break;
+ case 16:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 17;
+ break;
+ case 17:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 18;
+ break;
+ case 18:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 19;
+ break;
+ case 19:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 20;
+ break;
+ case 20:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 21;
+ break;
+ case 23:
+ if ((0x8400000000L & l) != 0L && kind > 81)
+ kind = 81;
+ break;
+ case 24:
+ if (curChar == 39)
+ { jjCheckNAddStates(24, 26); }
+ break;
+ case 25:
+ if ((0xffffff7fffffdbffL & l) != 0L)
+ { jjCheckNAddStates(24, 26); }
+ break;
+ case 26:
+ if (curChar == 39 && kind > 82)
+ kind = 82;
+ break;
+ case 28:
+ if ((0x8400000000L & l) != 0L)
+ { jjCheckNAddStates(24, 26); }
+ break;
+ case 30:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 31;
+ break;
+ case 31:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 32;
+ break;
+ case 32:
+ case 41:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAdd(33); }
+ break;
+ case 33:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddStates(24, 26); }
+ break;
+ case 35:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 36;
+ break;
+ case 36:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 37;
+ break;
+ case 37:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 38;
+ break;
+ case 38:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 39;
+ break;
+ case 39:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 40;
+ break;
+ case 40:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 41;
+ break;
+ case 42:
+ if (curChar == 34)
+ { jjCheckNAddStates(21, 23); }
+ break;
+ case 43:
+ if ((0xfffffffbffffdbffL & l) != 0L)
+ { jjCheckNAddStates(21, 23); }
+ break;
+ case 44:
+ if (curChar == 34 && kind > 83)
+ kind = 83;
+ break;
+ case 46:
+ if ((0x8400000000L & l) != 0L)
+ { jjCheckNAddStates(21, 23); }
+ break;
+ case 48:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 49;
+ break;
+ case 49:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 50;
+ break;
+ case 50:
+ case 59:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAdd(51); }
+ break;
+ case 51:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddStates(21, 23); }
+ break;
+ case 53:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 54;
+ break;
+ case 54:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 55;
+ break;
+ case 55:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 56;
+ break;
+ case 56:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 57;
+ break;
+ case 57:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 58;
+ break;
+ case 58:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 59;
+ break;
+ case 60:
+ if (curChar == 39)
+ { jjCheckNAddStates(27, 30); }
+ break;
+ case 61:
+ case 64:
+ if (curChar == 39)
+ { jjCheckNAddTwoStates(62, 65); }
+ break;
+ case 62:
+ if ((0xffffff7fffffffffL & l) != 0L)
+ { jjCheckNAddStates(27, 30); }
+ break;
+ case 63:
+ if (curChar == 39)
+ { jjAddStates(31, 32); }
+ break;
+ case 66:
+ if ((0x8400000000L & l) != 0L)
+ { jjCheckNAddStates(27, 30); }
+ break;
+ case 68:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 69;
+ break;
+ case 69:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 70;
+ break;
+ case 70:
+ case 79:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAdd(71); }
+ break;
+ case 71:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddStates(27, 30); }
+ break;
+ case 73:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 74;
+ break;
+ case 74:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 75;
+ break;
+ case 75:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 76;
+ break;
+ case 76:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 77;
+ break;
+ case 77:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 78;
+ break;
+ case 78:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 79;
+ break;
+ case 80:
+ if (curChar == 39 && kind > 84)
+ kind = 84;
+ break;
+ case 81:
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 80;
+ break;
+ case 82:
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 60;
+ break;
+ case 83:
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 82;
+ break;
+ case 84:
+ if (curChar == 34)
+ { jjCheckNAddStates(33, 36); }
+ break;
+ case 85:
+ case 88:
+ if (curChar == 34)
+ { jjCheckNAddTwoStates(86, 89); }
+ break;
+ case 86:
+ if ((0xfffffffbffffffffL & l) != 0L)
+ { jjCheckNAddStates(33, 36); }
+ break;
+ case 87:
+ if (curChar == 34)
+ { jjAddStates(37, 38); }
+ break;
+ case 90:
+ if ((0x8400000000L & l) != 0L)
+ { jjCheckNAddStates(33, 36); }
+ break;
+ case 92:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 93;
+ break;
+ case 93:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 94;
+ break;
+ case 94:
+ case 103:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAdd(95); }
+ break;
+ case 95:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddStates(33, 36); }
+ break;
+ case 97:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 98;
+ break;
+ case 98:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 99;
+ break;
+ case 99:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 100;
+ break;
+ case 100:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 101;
+ break;
+ case 101:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 102;
+ break;
+ case 102:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 103;
+ break;
+ case 104:
+ if (curChar == 34 && kind > 85)
+ kind = 85;
+ break;
+ case 105:
+ if (curChar == 34)
+ jjstateSet[jjnewStateCnt++] = 104;
+ break;
+ case 106:
+ if (curChar == 34)
+ jjstateSet[jjnewStateCnt++] = 84;
+ break;
+ case 107:
+ if (curChar == 34)
+ jjstateSet[jjnewStateCnt++] = 106;
+ break;
+ case 109:
+ if ((0x3ff600000000000L & l) != 0L)
+ { jjAddStates(39, 40); }
+ break;
+ case 110:
+ if ((0x3ff200000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 111;
+ break;
+ case 111:
+ if (curChar == 58 && kind > 75)
+ kind = 75;
+ break;
+ case 112:
+ if ((0x3ff600000000000L & l) != 0L)
+ { jjAddStates(41, 42); }
+ break;
+ case 113:
+ if ((0x3ff200000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 114;
+ break;
+ case 114:
+ if (curChar == 58)
+ { jjCheckNAddStates(12, 14); }
+ break;
+ case 115:
+ if ((0x7ff000000000000L & l) == 0L)
+ break;
+ if (kind > 76)
+ kind = 76;
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 116:
+ if ((0x7ff600000000000L & l) != 0L)
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 117:
+ if ((0x7ff200000000000L & l) != 0L && kind > 76)
+ kind = 76;
+ break;
+ case 119:
+ if ((0xa800fffa00000000L & l) != 0L)
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 120:
+ if (curChar == 37)
+ { jjAddStates(47, 48); }
+ break;
+ case 121:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 122;
+ break;
+ case 122:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 123:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 124;
+ break;
+ case 124:
+ if ((0x3ff000000000000L & l) != 0L && kind > 76)
+ kind = 76;
+ break;
+ case 125:
+ if ((0xa800fffa00000000L & l) != 0L && kind > 76)
+ kind = 76;
+ break;
+ case 127:
+ if ((0xa800fffa00000000L & l) == 0L)
+ break;
+ if (kind > 76)
+ kind = 76;
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 128:
+ if (curChar == 37)
+ jjstateSet[jjnewStateCnt++] = 129;
+ break;
+ case 129:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 130;
+ break;
+ case 130:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 76)
+ kind = 76;
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 131:
+ if (curChar != 58)
+ break;
+ if (kind > 75)
+ kind = 75;
+ { jjCheckNAddStates(12, 14); }
+ break;
+ case 134:
+ if ((0x3ff600000000000L & l) != 0L)
+ { jjAddStates(49, 50); }
+ break;
+ case 135:
+ if ((0x3ff200000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 136;
+ break;
+ case 136:
+ if (curChar == 58 && kind > 77)
+ kind = 77;
+ break;
+ case 138:
+ if ((0x3ff600000000000L & l) != 0L)
+ { jjAddStates(51, 52); }
+ break;
+ case 139:
+ if ((0x3ff200000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 140;
+ break;
+ case 140:
+ if (curChar == 58)
+ { jjAddStates(53, 55); }
+ break;
+ case 141:
+ if ((0x7ff000000000000L & l) == 0L)
+ break;
+ if (kind > 78)
+ kind = 78;
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 142:
+ if ((0x7ff600000000000L & l) != 0L)
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 143:
+ if ((0x7ff200000000000L & l) != 0L && kind > 78)
+ kind = 78;
+ break;
+ case 145:
+ if ((0xa800fffa00000000L & l) != 0L)
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 146:
+ if (curChar == 37)
+ { jjAddStates(60, 61); }
+ break;
+ case 147:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 148;
+ break;
+ case 148:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 149:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 150;
+ break;
+ case 150:
+ if ((0x3ff000000000000L & l) != 0L && kind > 78)
+ kind = 78;
+ break;
+ case 151:
+ if ((0xa800fffa00000000L & l) != 0L && kind > 78)
+ kind = 78;
+ break;
+ case 153:
+ if ((0xa800fffa00000000L & l) == 0L)
+ break;
+ if (kind > 78)
+ kind = 78;
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 154:
+ if (curChar == 37)
+ jjstateSet[jjnewStateCnt++] = 155;
+ break;
+ case 155:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 156;
+ break;
+ case 156:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 78)
+ kind = 78;
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 158:
+ if (curChar == 45)
+ { jjCheckNAdd(159); }
+ break;
+ case 159:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 91)
+ kind = 91;
+ { jjCheckNAddTwoStates(158, 159); }
+ break;
+ case 160:
+ if ((0x280000000000L & l) != 0L)
+ { jjCheckNAddStates(7, 11); }
+ break;
+ case 161:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 87)
+ kind = 87;
+ { jjCheckNAdd(161); }
+ break;
+ case 162:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddTwoStates(162, 163); }
+ break;
+ case 163:
+ if (curChar == 46)
+ { jjCheckNAdd(164); }
+ break;
+ case 164:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 88)
+ kind = 88;
+ { jjCheckNAdd(164); }
+ break;
+ case 165:
+ if (curChar == 46)
+ { jjCheckNAdd(166); }
+ break;
+ case 166:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddTwoStates(166, 167); }
+ break;
+ case 168:
+ if ((0x280000000000L & l) != 0L)
+ { jjCheckNAdd(169); }
+ break;
+ case 169:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 89)
+ kind = 89;
+ { jjCheckNAdd(169); }
+ break;
+ case 170:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddStates(62, 65); }
+ break;
+ case 171:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddTwoStates(171, 172); }
+ break;
+ case 172:
+ if (curChar == 46)
+ { jjCheckNAddTwoStates(173, 174); }
+ break;
+ case 173:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddTwoStates(173, 174); }
+ break;
+ case 175:
+ if ((0x280000000000L & l) != 0L)
+ { jjCheckNAdd(176); }
+ break;
+ case 176:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 89)
+ kind = 89;
+ { jjCheckNAdd(176); }
+ break;
+ case 177:
+ if ((0x3ff000000000000L & l) != 0L)
+ { jjCheckNAddTwoStates(177, 178); }
+ break;
+ case 179:
+ if ((0x280000000000L & l) != 0L)
+ { jjCheckNAdd(180); }
+ break;
+ case 180:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 89)
+ kind = 89;
+ { jjCheckNAdd(180); }
+ break;
+ case 181:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 87)
+ kind = 87;
+ { jjCheckNAddStates(0, 6); }
+ break;
+ case 182:
+ if (curChar == 46)
+ { jjCheckNAddTwoStates(164, 166); }
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else if (curChar < 128)
+ {
+ long l = 1L << (curChar & 077);
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if ((0x7fffffe07fffffeL & l) != 0L)
+ { jjCheckNAddStates(66, 71); }
+ else if (curChar == 64)
+ { jjCheckNAddStates(72, 76); }
+ else if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 23;
+ break;
+ case 1:
+ if (kind > 46)
+ kind = 46;
+ { jjAddStates(18, 20); }
+ break;
+ case 6:
+ if ((0xc7fffffeafffffffL & l) != 0L)
+ { jjCheckNAddStates(15, 17); }
+ break;
+ case 7:
+ if (curChar == 92)
+ { jjAddStates(77, 78); }
+ break;
+ case 8:
+ if (curChar == 117)
+ jjstateSet[jjnewStateCnt++] = 9;
+ break;
+ case 9:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 10;
+ break;
+ case 10:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 11;
+ break;
+ case 11:
+ case 21:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAdd(12); }
+ break;
+ case 12:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAddStates(15, 17); }
+ break;
+ case 14:
+ if (curChar == 85)
+ jjstateSet[jjnewStateCnt++] = 15;
+ break;
+ case 15:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 16;
+ break;
+ case 16:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 17;
+ break;
+ case 17:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 18;
+ break;
+ case 18:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 19;
+ break;
+ case 19:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 20;
+ break;
+ case 20:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 21;
+ break;
+ case 22:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 23;
+ break;
+ case 23:
+ if ((0x14404410000000L & l) != 0L && kind > 81)
+ kind = 81;
+ break;
+ case 25:
+ if ((0xffffffffefffffffL & l) != 0L)
+ { jjCheckNAddStates(24, 26); }
+ break;
+ case 27:
+ if (curChar == 92)
+ { jjAddStates(79, 81); }
+ break;
+ case 28:
+ if ((0x14404410000000L & l) != 0L)
+ { jjCheckNAddStates(24, 26); }
+ break;
+ case 29:
+ if (curChar == 117)
+ jjstateSet[jjnewStateCnt++] = 30;
+ break;
+ case 30:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 31;
+ break;
+ case 31:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 32;
+ break;
+ case 32:
+ case 41:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAdd(33); }
+ break;
+ case 33:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAddStates(24, 26); }
+ break;
+ case 34:
+ if (curChar == 85)
+ jjstateSet[jjnewStateCnt++] = 35;
+ break;
+ case 35:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 36;
+ break;
+ case 36:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 37;
+ break;
+ case 37:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 38;
+ break;
+ case 38:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 39;
+ break;
+ case 39:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 40;
+ break;
+ case 40:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 41;
+ break;
+ case 43:
+ if ((0xffffffffefffffffL & l) != 0L)
+ { jjCheckNAddStates(21, 23); }
+ break;
+ case 45:
+ if (curChar == 92)
+ { jjAddStates(82, 84); }
+ break;
+ case 46:
+ if ((0x14404410000000L & l) != 0L)
+ { jjCheckNAddStates(21, 23); }
+ break;
+ case 47:
+ if (curChar == 117)
+ jjstateSet[jjnewStateCnt++] = 48;
+ break;
+ case 48:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 49;
+ break;
+ case 49:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 50;
+ break;
+ case 50:
+ case 59:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAdd(51); }
+ break;
+ case 51:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAddStates(21, 23); }
+ break;
+ case 52:
+ if (curChar == 85)
+ jjstateSet[jjnewStateCnt++] = 53;
+ break;
+ case 53:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 54;
+ break;
+ case 54:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 55;
+ break;
+ case 55:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 56;
+ break;
+ case 56:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 57;
+ break;
+ case 57:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 58;
+ break;
+ case 58:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 59;
+ break;
+ case 62:
+ if ((0xffffffffefffffffL & l) != 0L)
+ { jjCheckNAddStates(27, 30); }
+ break;
+ case 65:
+ if (curChar == 92)
+ { jjAddStates(85, 87); }
+ break;
+ case 66:
+ if ((0x14404410000000L & l) != 0L)
+ { jjCheckNAddStates(27, 30); }
+ break;
+ case 67:
+ if (curChar == 117)
+ jjstateSet[jjnewStateCnt++] = 68;
+ break;
+ case 68:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 69;
+ break;
+ case 69:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 70;
+ break;
+ case 70:
+ case 79:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAdd(71); }
+ break;
+ case 71:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAddStates(27, 30); }
+ break;
+ case 72:
+ if (curChar == 85)
+ jjstateSet[jjnewStateCnt++] = 73;
+ break;
+ case 73:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 74;
+ break;
+ case 74:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 75;
+ break;
+ case 75:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 76;
+ break;
+ case 76:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 77;
+ break;
+ case 77:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 78;
+ break;
+ case 78:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 79;
+ break;
+ case 86:
+ if ((0xffffffffefffffffL & l) != 0L)
+ { jjCheckNAddStates(33, 36); }
+ break;
+ case 89:
+ if (curChar == 92)
+ { jjAddStates(88, 90); }
+ break;
+ case 90:
+ if ((0x14404410000000L & l) != 0L)
+ { jjCheckNAddStates(33, 36); }
+ break;
+ case 91:
+ if (curChar == 117)
+ jjstateSet[jjnewStateCnt++] = 92;
+ break;
+ case 92:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 93;
+ break;
+ case 93:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 94;
+ break;
+ case 94:
+ case 103:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAdd(95); }
+ break;
+ case 95:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAddStates(33, 36); }
+ break;
+ case 96:
+ if (curChar == 85)
+ jjstateSet[jjnewStateCnt++] = 97;
+ break;
+ case 97:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 98;
+ break;
+ case 98:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 99;
+ break;
+ case 99:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 100;
+ break;
+ case 100:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 101;
+ break;
+ case 101:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 102;
+ break;
+ case 102:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 103;
+ break;
+ case 108:
+ if ((0x7fffffe07fffffeL & l) != 0L)
+ { jjCheckNAddStates(66, 71); }
+ break;
+ case 109:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ { jjCheckNAddTwoStates(109, 110); }
+ break;
+ case 110:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ { jjCheckNAdd(111); }
+ break;
+ case 112:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ { jjCheckNAddTwoStates(112, 113); }
+ break;
+ case 113:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ { jjCheckNAdd(114); }
+ break;
+ case 115:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 76)
+ kind = 76;
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 116:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 117:
+ if ((0x7fffffe87fffffeL & l) != 0L && kind > 76)
+ kind = 76;
+ break;
+ case 118:
+ if (curChar == 92)
+ { jjAddStates(91, 92); }
+ break;
+ case 119:
+ if ((0x4000000080000001L & l) != 0L)
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 121:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 122;
+ break;
+ case 122:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 123:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 124;
+ break;
+ case 124:
+ if ((0x7e0000007eL & l) != 0L && kind > 76)
+ kind = 76;
+ break;
+ case 125:
+ if ((0x4000000080000001L & l) != 0L && kind > 76)
+ kind = 76;
+ break;
+ case 126:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 127;
+ break;
+ case 127:
+ if ((0x4000000080000001L & l) == 0L)
+ break;
+ if (kind > 76)
+ kind = 76;
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 129:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 130;
+ break;
+ case 130:
+ if ((0x7e0000007eL & l) == 0L)
+ break;
+ if (kind > 76)
+ kind = 76;
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 132:
+ if (curChar == 64)
+ { jjCheckNAddStates(72, 76); }
+ break;
+ case 133:
+ if ((0x7fffffe07fffffeL & l) != 0L)
+ { jjCheckNAddStates(93, 95); }
+ break;
+ case 134:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ { jjCheckNAddTwoStates(134, 135); }
+ break;
+ case 135:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ { jjCheckNAdd(136); }
+ break;
+ case 137:
+ if ((0x7fffffe07fffffeL & l) != 0L)
+ { jjCheckNAddStates(96, 98); }
+ break;
+ case 138:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ { jjCheckNAddTwoStates(138, 139); }
+ break;
+ case 139:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ { jjCheckNAdd(140); }
+ break;
+ case 141:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 78)
+ kind = 78;
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 142:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 143:
+ if ((0x7fffffe87fffffeL & l) != 0L && kind > 78)
+ kind = 78;
+ break;
+ case 144:
+ if (curChar == 92)
+ { jjAddStates(99, 100); }
+ break;
+ case 145:
+ if ((0x4000000080000001L & l) != 0L)
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 147:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 148;
+ break;
+ case 148:
+ if ((0x7e0000007eL & l) != 0L)
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 149:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 150;
+ break;
+ case 150:
+ if ((0x7e0000007eL & l) != 0L && kind > 78)
+ kind = 78;
+ break;
+ case 151:
+ if ((0x4000000080000001L & l) != 0L && kind > 78)
+ kind = 78;
+ break;
+ case 152:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 153;
+ break;
+ case 153:
+ if ((0x4000000080000001L & l) == 0L)
+ break;
+ if (kind > 78)
+ kind = 78;
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 155:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 156;
+ break;
+ case 156:
+ if ((0x7e0000007eL & l) == 0L)
+ break;
+ if (kind > 78)
+ kind = 78;
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 157:
+ if ((0x7fffffe07fffffeL & l) == 0L)
+ break;
+ if (kind > 91)
+ kind = 91;
+ { jjCheckNAddTwoStates(157, 158); }
+ break;
+ case 159:
+ if ((0x7fffffe07fffffeL & l) == 0L)
+ break;
+ if (kind > 91)
+ kind = 91;
+ { jjCheckNAddTwoStates(158, 159); }
+ break;
+ case 167:
+ if ((0x2000000020L & l) != 0L)
+ { jjAddStates(101, 102); }
+ break;
+ case 174:
+ if ((0x2000000020L & l) != 0L)
+ { jjAddStates(103, 104); }
+ break;
+ case 178:
+ if ((0x2000000020L & l) != 0L)
+ { jjAddStates(105, 106); }
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else
+ {
+ int hiByte = (curChar >> 8);
+ int i1 = hiByte >> 6;
+ long l1 = 1L << (hiByte & 077);
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if (jjCanMove_1(hiByte, i1, i2, l1, l2))
+ { jjCheckNAddStates(66, 71); }
+ break;
+ case 1:
+ if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
+ break;
+ if (kind > 46)
+ kind = 46;
+ { jjAddStates(18, 20); }
+ break;
+ case 6:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ { jjAddStates(15, 17); }
+ break;
+ case 25:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ { jjAddStates(24, 26); }
+ break;
+ case 43:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ { jjAddStates(21, 23); }
+ break;
+ case 62:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ { jjAddStates(27, 30); }
+ break;
+ case 86:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ { jjAddStates(33, 36); }
+ break;
+ case 109:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ { jjCheckNAddTwoStates(109, 110); }
+ break;
+ case 110:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ { jjCheckNAdd(111); }
+ break;
+ case 112:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ { jjCheckNAddTwoStates(112, 113); }
+ break;
+ case 113:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ { jjCheckNAdd(114); }
+ break;
+ case 115:
+ if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+ break;
+ if (kind > 76)
+ kind = 76;
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 116:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ { jjCheckNAddStates(43, 46); }
+ break;
+ case 117:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 76)
+ kind = 76;
+ break;
+ case 133:
+ if (jjCanMove_1(hiByte, i1, i2, l1, l2))
+ { jjCheckNAddStates(93, 95); }
+ break;
+ case 134:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ { jjCheckNAddTwoStates(134, 135); }
+ break;
+ case 135:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ { jjCheckNAdd(136); }
+ break;
+ case 137:
+ if (jjCanMove_1(hiByte, i1, i2, l1, l2))
+ { jjCheckNAddStates(96, 98); }
+ break;
+ case 138:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ { jjCheckNAddTwoStates(138, 139); }
+ break;
+ case 139:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ { jjCheckNAdd(140); }
+ break;
+ case 141:
+ if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+ break;
+ if (kind > 78)
+ kind = 78;
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 142:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ { jjCheckNAddStates(56, 59); }
+ break;
+ case 143:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 78)
+ kind = 78;
+ break;
+ default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break;
+ }
+ } while(i != startsAt);
+ }
+ if (kind != 0x7fffffff)
+ {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 183 - (jjnewStateCnt = startsAt)))
+ break;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { break; }
+ }
+ if (jjmatchedPos > strPos)
+ return curPos;
+
+ int toRet = Math.max(curPos, seenUpto);
+
+ if (curPos < toRet)
+ for (i = toRet - Math.min(curPos, seenUpto); i-- > 0; )
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); }
+
+ if (jjmatchedPos < strPos)
+ {
+ jjmatchedKind = strKind;
+ jjmatchedPos = strPos;
+ }
+ else if (jjmatchedPos == strPos && jjmatchedKind > strKind)
+ jjmatchedKind = strKind;
+
+ return toRet;
+}
+static final int[] jjnextStates = {
+ 161, 162, 163, 171, 172, 177, 178, 161, 162, 163, 165, 170, 115, 126, 128, 6,
+ 7, 13, 1, 2, 4, 43, 44, 45, 25, 26, 27, 61, 62, 63, 65, 64,
+ 81, 85, 86, 87, 89, 88, 105, 109, 110, 112, 113, 116, 117, 118, 120, 121,
+ 123, 134, 135, 138, 139, 141, 152, 154, 142, 143, 144, 146, 147, 149, 171, 172,
+ 177, 178, 109, 110, 111, 112, 113, 114, 133, 136, 137, 140, 157, 8, 14, 28,
+ 29, 34, 46, 47, 52, 66, 67, 72, 90, 91, 96, 119, 125, 134, 135, 136,
+ 138, 139, 140, 145, 151, 168, 169, 175, 176, 179, 180,
+};
+private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
+{
+ switch(hiByte)
+ {
+ case 0:
+ return ((jjbitVec2[i2] & l2) != 0L);
+ default :
+ if ((jjbitVec0[i1] & l1) != 0L)
+ return true;
+ return false;
+ }
+}
+private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)
+{
+ switch(hiByte)
+ {
+ case 0:
+ return ((jjbitVec4[i2] & l2) != 0L);
+ case 3:
+ return ((jjbitVec5[i2] & l2) != 0L);
+ case 32:
+ return ((jjbitVec6[i2] & l2) != 0L);
+ case 33:
+ return ((jjbitVec7[i2] & l2) != 0L);
+ case 47:
+ return ((jjbitVec8[i2] & l2) != 0L);
+ case 48:
+ return ((jjbitVec0[i2] & l2) != 0L);
+ case 255:
+ return ((jjbitVec9[i2] & l2) != 0L);
+ default :
+ if ((jjbitVec3[i1] & l1) != 0L)
+ return true;
+ return false;
+ }
+}
+private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2)
+{
+ switch(hiByte)
+ {
+ case 0:
+ return ((jjbitVec10[i2] & l2) != 0L);
+ case 3:
+ return ((jjbitVec11[i2] & l2) != 0L);
+ case 32:
+ return ((jjbitVec12[i2] & l2) != 0L);
+ case 33:
+ return ((jjbitVec7[i2] & l2) != 0L);
+ case 47:
+ return ((jjbitVec8[i2] & l2) != 0L);
+ case 48:
+ return ((jjbitVec0[i2] & l2) != 0L);
+ case 255:
+ return ((jjbitVec9[i2] & l2) != 0L);
+ default :
+ if ((jjbitVec3[i1] & l1) != 0L)
+ return true;
+ return false;
+ }
+}
+
+/** Token literal values. */
+public static final String[] jjstrLiteralImages = {
+"", "\55\76", "\56\56", "\102\154\141\156\153\116\157\144\145",
+"\111\122\111", "\114\151\164\145\162\141\154",
+"\102\154\141\156\153\116\157\144\145\117\162\111\122\111", "\102\154\141\156\153\116\157\144\145\117\162\114\151\164\145\162\141\154",
+"\111\122\111\117\162\114\151\164\145\162\141\154", "\164\141\162\147\145\164\116\157\144\145",
+"\164\141\162\147\145\164\117\142\152\145\143\164\163\117\146", "\164\141\162\147\145\164\123\165\142\152\145\143\164\163\117\146",
+"\144\145\141\143\164\151\166\141\164\145\144", "\163\145\166\145\162\151\164\171", "\155\145\163\163\141\147\145",
+"\143\154\141\163\163", "\144\141\164\141\164\171\160\145", "\156\157\144\145\113\151\156\144",
+"\155\151\156\105\170\143\154\165\163\151\166\145", "\155\151\156\111\156\143\154\165\163\151\166\145",
+"\155\141\170\105\170\143\154\165\163\151\166\145", "\155\141\170\111\156\143\154\165\163\151\166\145",
+"\155\151\156\114\145\156\147\164\150", "\155\141\170\114\145\156\147\164\150", "\160\141\164\164\145\162\156",
+"\146\154\141\147\163", "\154\141\156\147\165\141\147\145\111\156", "\145\161\165\141\154\163",
+"\144\151\163\152\157\151\156\164", "\143\154\157\163\145\144",
+"\151\147\156\157\162\145\144\120\162\157\160\145\162\164\151\145\163", "\150\141\163\126\141\154\165\145", "\151\156",
+"\165\156\151\161\165\145\114\141\156\147", "\154\145\163\163\124\150\141\156",
+"\154\145\163\163\124\150\141\156\117\162\105\161\165\141\154\163",
+"\161\165\141\154\151\146\151\145\144\126\141\154\165\145\123\150\141\160\145", "\161\165\141\154\151\146\151\145\144\115\151\156\103\157\165\156\164",
+"\161\165\141\154\151\146\151\145\144\115\141\170\103\157\165\156\164",
+"\161\165\141\154\151\146\151\145\144\126\141\154\165\145\123\150\141\160\145\163\104\151\163\152\157\151\156\164", "\136\136", null, null, null, null, null, null, "\ufeff", null, null, null,
+null, null, null, null, null, "\53", "\55", "\174", "\100", "\136", "\56", "\41",
+"\77", "\57", "\52", "\75", "\50", "\51", "\173", "\175", "\133", "\135", null, null,
+null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+null, };
+protected Token jjFillToken()
+{
+ final Token t;
+ final String curTokenImage;
+ final int beginLine;
+ final int endLine;
+ final int beginColumn;
+ final int endColumn;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ curTokenImage = (im == null) ? input_stream.GetImage() : im;
+ beginLine = input_stream.getBeginLine();
+ beginColumn = input_stream.getBeginColumn();
+ endLine = input_stream.getEndLine();
+ endColumn = input_stream.getEndColumn();
+ t = Token.newToken(jjmatchedKind, curTokenImage);
+
+ t.beginLine = beginLine;
+ t.endLine = endLine;
+ t.beginColumn = beginColumn;
+ t.endColumn = endColumn;
+
+ return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+/** Get the next Token. */
+public Token getNextToken()
+{
+ Token specialToken = null;
+ Token matchedToken;
+ int curPos = 0;
+
+ EOFLoop :
+ for (;;)
+ {
+ try
+ {
+ curChar = input_stream.BeginToken();
+ }
+ catch(java.io.IOException e)
+ {
+ jjmatchedKind = 0;
+ jjmatchedPos = -1;
+ matchedToken = jjFillToken();
+ matchedToken.specialToken = specialToken;
+ return matchedToken;
+ }
+
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_0();
+ if (jjmatchedKind != 0x7fffffff)
+ {
+ if (jjmatchedPos + 1 < curPos)
+ input_stream.backup(curPos - jjmatchedPos - 1);
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ matchedToken = jjFillToken();
+ matchedToken.specialToken = specialToken;
+ return matchedToken;
+ }
+ else
+ {
+ if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ matchedToken = jjFillToken();
+ if (specialToken == null)
+ specialToken = matchedToken;
+ else
+ {
+ matchedToken.specialToken = specialToken;
+ specialToken = (specialToken.next = matchedToken);
+ }
+ }
+ continue EOFLoop;
+ }
+ }
+ int error_line = input_stream.getEndLine();
+ int error_column = input_stream.getEndColumn();
+ String error_after = null;
+ boolean EOFSeen = false;
+ try { input_stream.readChar(); input_stream.backup(1); }
+ catch (java.io.IOException e1) {
+ EOFSeen = true;
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ if (curChar == '\n' || curChar == '\r') {
+ error_line++;
+ error_column = 0;
+ }
+ else
+ error_column++;
+ }
+ if (!EOFSeen) {
+ input_stream.backup(1);
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ }
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+ }
+}
+
+private void jjCheckNAdd(int state)
+{
+ if (jjrounds[state] != jjround)
+ {
+ jjstateSet[jjnewStateCnt++] = state;
+ jjrounds[state] = jjround;
+ }
+}
+private void jjAddStates(int start, int end)
+{
+ do {
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+ } while (start++ != end);
+}
+private void jjCheckNAddTwoStates(int state1, int state2)
+{
+ jjCheckNAdd(state1);
+ jjCheckNAdd(state2);
+}
+
+private void jjCheckNAddStates(int start, int end)
+{
+ do {
+ jjCheckNAdd(jjnextStates[start]);
+ } while (start++ != end);
+}
+
+ /** Constructor. */
+ public ShaclCompactParserJJTokenManager(SimpleCharStream stream){
+
+ if (SimpleCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+
+ input_stream = stream;
+ }
+
+ /** Constructor. */
+ public ShaclCompactParserJJTokenManager (SimpleCharStream stream, int lexState){
+ ReInit(stream);
+ SwitchTo(lexState);
+ }
+
+ /** Reinitialise parser. */
+ public void ReInit(SimpleCharStream stream)
+ {
+ jjmatchedPos = jjnewStateCnt = 0;
+ curLexState = defaultLexState;
+ input_stream = stream;
+ ReInitRounds();
+ }
+
+ private void ReInitRounds()
+ {
+ int i;
+ jjround = 0x80000001;
+ for (i = 183; i-- > 0;)
+ jjrounds[i] = 0x80000000;
+ }
+
+ /** Reinitialise parser. */
+ public void ReInit(SimpleCharStream stream, int lexState)
+ {
+ ReInit(stream);
+ SwitchTo(lexState);
+ }
+
+ /** Switch to specified lex state. */
+ public void SwitchTo(int lexState)
+ {
+ if (lexState >= 1 || lexState < 0)
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+ else
+ curLexState = lexState;
+ }
+
+/** Lexer state names. */
+public static final String[] lexStateNames = {
+ "DEFAULT",
+};
+static final long[] jjtoToken = {
+ 0xff7f81ffffffffffL, 0xbbe7dffL,
+};
+static final long[] jjtoSkip = {
+ 0x7e0000000000L, 0x0L,
+};
+static final long[] jjtoSpecial = {
+ 0x400000000000L, 0x0L,
+};
+ protected SimpleCharStream input_stream;
+
+ private final int[] jjrounds = new int[183];
+ private final int[] jjstateSet = new int[2 * 183];
+
+
+ protected char curChar;
+}
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/SimpleCharStream.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/SimpleCharStream.java
new file mode 100644
index 0000000..ca54fd1
--- /dev/null
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/SimpleCharStream.java
@@ -0,0 +1,492 @@
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 6.0 */
+/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact.parser;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (without unicode processing).
+ */
+
+public class SimpleCharStream
+{
+/** Whether parser is static. */
+ public static final boolean staticFlag = false;
+ int bufsize;
+ int available;
+ int tokenBegin;
+/** Position in buffer. */
+ public int bufpos = -1;
+ protected int bufline[];
+ protected int bufcolumn[];
+
+ protected int column = 0;
+ protected int line = 1;
+
+ protected boolean prevCharIsCR = false;
+ protected boolean prevCharIsLF = false;
+
+ protected java.io.Reader inputStream;
+
+ protected char[] buffer;
+ protected int maxNextCharInd = 0;
+ protected int inBuf = 0;
+ protected int tabSize = 8;
+ protected boolean trackLineColumn = true;
+
+ public void setTabSize(int i) { tabSize = i; }
+ public int getTabSize() { return tabSize; }
+
+
+ protected void ExpandBuff(boolean wrapAround)
+ {
+ char[] newbuffer = new char[bufsize + 2048];
+ int newbufline[] = new int[bufsize + 2048];
+ int newbufcolumn[] = new int[bufsize + 2048];
+
+ try
+ {
+ if (wrapAround)
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+ }
+ else
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos -= tokenBegin);
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new Error(t.getMessage());
+ }
+
+
+ bufsize += 2048;
+ available = bufsize;
+ tokenBegin = 0;
+ }
+
+ protected void FillBuff() throws java.io.IOException
+ {
+ if (maxNextCharInd == available)
+ {
+ if (available == bufsize)
+ {
+ if (tokenBegin > 2048)
+ {
+ bufpos = maxNextCharInd = 0;
+ available = tokenBegin;
+ }
+ else if (tokenBegin < 0)
+ bufpos = maxNextCharInd = 0;
+ else
+ ExpandBuff(false);
+ }
+ else if (available > tokenBegin)
+ available = bufsize;
+ else if ((tokenBegin - available) < 2048)
+ ExpandBuff(true);
+ else
+ available = tokenBegin;
+ }
+
+ int i;
+ try {
+ if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1)
+ {
+ inputStream.close();
+ throw new java.io.IOException();
+ }
+ else
+ maxNextCharInd += i;
+ return;
+ }
+ catch(java.io.IOException e) {
+ --bufpos;
+ backup(0);
+ if (tokenBegin == -1)
+ tokenBegin = bufpos;
+ throw e;
+ }
+ }
+
+/** Start. */
+ public char BeginToken() throws java.io.IOException
+ {
+ tokenBegin = -1;
+ char c = readChar();
+ tokenBegin = bufpos;
+
+ return c;
+ }
+
+ protected void UpdateLineColumn(char c)
+ {
+ column++;
+
+ if (prevCharIsLF)
+ {
+ prevCharIsLF = false;
+ line += (column = 1);
+ }
+ else if (prevCharIsCR)
+ {
+ prevCharIsCR = false;
+ if (c == '\n')
+ {
+ prevCharIsLF = true;
+ }
+ else
+ line += (column = 1);
+ }
+
+ switch (c)
+ {
+ case '\r' :
+ prevCharIsCR = true;
+ break;
+ case '\n' :
+ prevCharIsLF = true;
+ break;
+ case '\t' :
+ column--;
+ column += (tabSize - (column % tabSize));
+ break;
+ default :
+ break;
+ }
+
+ bufline[bufpos] = line;
+ bufcolumn[bufpos] = column;
+ }
+
+/** Read a character. */
+ public char readChar() throws java.io.IOException
+ {
+ if (inBuf > 0)
+ {
+ --inBuf;
+
+ if (++bufpos == bufsize)
+ bufpos = 0;
+
+ return buffer[bufpos];
+ }
+
+ if (++bufpos >= maxNextCharInd)
+ FillBuff();
+
+ char c = buffer[bufpos];
+
+ UpdateLineColumn(c);
+ return c;
+ }
+
+ @Deprecated
+ /**
+ * @deprecated
+ * @see #getEndColumn
+ */
+
+ public int getColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ @Deprecated
+ /**
+ * @deprecated
+ * @see #getEndLine
+ */
+
+ public int getLine() {
+ return bufline[bufpos];
+ }
+
+ /** Get token end column number. */
+ public int getEndColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ /** Get token end line number. */
+ public int getEndLine() {
+ return bufline[bufpos];
+ }
+
+ /** Get token beginning column number. */
+ public int getBeginColumn() {
+ return bufcolumn[tokenBegin];
+ }
+
+ /** Get token beginning line number. */
+ public int getBeginLine() {
+ return bufline[tokenBegin];
+ }
+
+/** Backup a number of characters. */
+ public void backup(int amount) {
+
+ inBuf += amount;
+ if ((bufpos -= amount) < 0)
+ bufpos += bufsize;
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.Reader dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ if (buffer == null || buffersize != buffer.length)
+ {
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+ prevCharIsLF = prevCharIsCR = false;
+ tokenBegin = inBuf = maxNextCharInd = 0;
+ bufpos = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+ {
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, startline, startcolumn, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, 1, 1, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(dstream, encoding, 1, 1, 4096);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(dstream, encoding, startline, startcolumn, 4096);
+ }
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+ /** Get token literal value. */
+ public String GetImage()
+ {
+ if (bufpos >= tokenBegin)
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+ else
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+ new String(buffer, 0, bufpos + 1);
+ }
+
+ /** Get the suffix. */
+ public char[] GetSuffix(int len)
+ {
+ char[] ret = new char[len];
+
+ if ((bufpos + 1) >= len)
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+ else
+ {
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+ len - bufpos - 1);
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+ }
+
+ return ret;
+ }
+
+ /** Reset buffer when finished. */
+ public void Done()
+ {
+ buffer = null;
+ bufline = null;
+ bufcolumn = null;
+ }
+
+ /**
+ * Method to adjust line and column numbers for the start of a token.
+ */
+ public void adjustBeginLineColumn(int newLine, int newCol)
+ {
+ int start = tokenBegin;
+ int len;
+
+ if (bufpos >= tokenBegin)
+ {
+ len = bufpos - tokenBegin + inBuf + 1;
+ }
+ else
+ {
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+ }
+
+ int i = 0, j = 0, k = 0;
+ int nextColDiff = 0, columnDiff = 0;
+
+ while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
+ {
+ bufline[j] = newLine;
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+ bufcolumn[j] = newCol + columnDiff;
+ columnDiff = nextColDiff;
+ i++;
+ }
+
+ if (i < len)
+ {
+ bufline[j] = newLine++;
+ bufcolumn[j] = newCol + columnDiff;
+
+ while (i++ < len)
+ {
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+ bufline[j] = newLine++;
+ else
+ bufline[j] = newLine;
+ }
+ }
+
+ line = bufline[j];
+ column = bufcolumn[j];
+ }
+
+ boolean getTrackLineColumn() { return trackLineColumn; }
+ void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; }
+}
+/* JavaCC - OriginalChecksum=1a171c1505e2238d0389cbadacf342cb (do not edit this line) */
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/Token.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/Token.java
new file mode 100644
index 0000000..7af3298
--- /dev/null
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/Token.java
@@ -0,0 +1,149 @@
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 6.0 */
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact.parser;
+
+/**
+ * Describes the input token stream.
+ */
+
+public class Token implements java.io.Serializable {
+
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * An integer that describes the kind of this token. This numbering
+ * system is determined by JavaCCParser, and a table of these numbers is
+ * stored in the file ...Constants.java.
+ */
+ public int kind;
+
+ /** The line number of the first character of this Token. */
+ public int beginLine;
+ /** The column number of the first character of this Token. */
+ public int beginColumn;
+ /** The line number of the last character of this Token. */
+ public int endLine;
+ /** The column number of the last character of this Token. */
+ public int endColumn;
+
+ /**
+ * The string image of the token.
+ */
+ public String image;
+
+ /**
+ * A reference to the next regular (non-special) token from the input
+ * stream. If this is the last token from the input stream, or if the
+ * token manager has not read tokens beyond this one, this field is
+ * set to null. This is true only if this token is also a regular
+ * token. Otherwise, see below for a description of the contents of
+ * this field.
+ */
+ public Token next;
+
+ /**
+ * This field is used to access special tokens that occur prior to this
+ * token, but after the immediately preceding regular (non-special) token.
+ * If there are no such special tokens, this field is set to null.
+ * When there are more than one such special token, this field refers
+ * to the last of these special tokens, which in turn refers to the next
+ * previous special token through its specialToken field, and so on
+ * until the first special token (whose specialToken field is null).
+ * The next fields of special tokens refer to other special tokens that
+ * immediately follow it (without an intervening regular token). If there
+ * is no such token, this field is null.
+ */
+ public Token specialToken;
+
+ /**
+ * An optional attribute value of the Token.
+ * Tokens which are not used as syntactic sugar will often contain
+ * meaningful values that will be used later on by the compiler or
+ * interpreter. This attribute value is often different from the image.
+ * Any subclass of Token that actually wants to return a non-null value can
+ * override this method as appropriate.
+ */
+ public Object getValue() {
+ return null;
+ }
+
+ /**
+ * No-argument constructor
+ */
+ public Token() {}
+
+ /**
+ * Constructs a new token for the specified Image.
+ */
+ public Token(int kind)
+ {
+ this(kind, null);
+ }
+
+ /**
+ * Constructs a new token for the specified Image and Kind.
+ */
+ public Token(int kind, String image)
+ {
+ this.kind = kind;
+ this.image = image;
+ }
+
+ /**
+ * Returns the image.
+ */
+ @Override public String toString()
+ {
+ return image;
+ }
+
+ /**
+ * Returns a new Token object, by default. However, if you want, you
+ * can create and return subclass objects based on the value of ofKind.
+ * Simply add the cases to the switch for all those special cases.
+ * For example, if you have a subclass of Token called IDToken that
+ * you want to create if ofKind is ID, simply add something like :
+ *
+ * case MyParserConstants.ID : return new IDToken(ofKind, image);
+ *
+ * to the following switch statement. Then you can cast matchedToken
+ * variable to the appropriate type and use sit in your lexical actions.
+ */
+ public static Token newToken(int ofKind, String image)
+ {
+ switch(ofKind)
+ {
+ default : return new Token(ofKind, image);
+ }
+ }
+
+ public static Token newToken(int ofKind)
+ {
+ return newToken(ofKind, null);
+ }
+
+}
+/* JavaCC - OriginalChecksum=b1f3cdb13f8b7afc2b4ae081e3e4e3be (do not edit this line) */
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/TokenMgrError.java b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/TokenMgrError.java
new file mode 100644
index 0000000..0413ef9
--- /dev/null
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/compact/parser/TokenMgrError.java
@@ -0,0 +1,165 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 6.0 */
+/* JavaCCOptions: */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact.parser;
+
+/** Token Manager Error. */
+public class TokenMgrError extends Error
+{
+
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /*
+ * Ordinals for various reasons why an Error of this type can be thrown.
+ */
+
+ /**
+ * Lexical error occurred.
+ */
+ static final int LEXICAL_ERROR = 0;
+
+ /**
+ * An attempt was made to create a second instance of a static token manager.
+ */
+ static final int STATIC_LEXER_ERROR = 1;
+
+ /**
+ * Tried to change to an invalid lexical state.
+ */
+ static final int INVALID_LEXICAL_STATE = 2;
+
+ /**
+ * Detected (and bailed out of) an infinite loop in the token manager.
+ */
+ static final int LOOP_DETECTED = 3;
+
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
+
+ /**
+ * Replaces unprintable characters by their escaped (or unicode escaped)
+ * equivalents in the given string
+ */
+ protected static final String addEscapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+ /**
+ * Returns a detailed message for the Error when it is thrown by the
+ * token manager to indicate a lexical error.
+ * Parameters :
+ * EOFSeen : indicates if EOF caused the lexical error
+ * curLexState : lexical state in which this error occurred
+ * errorLine : line number when the error occurred
+ * errorColumn : column number when the error occurred
+ * errorAfter : prefix that was seen before this error occurred
+ * curchar : the offending character
+ * Note: You can customize the lexical error message by modifying this method.
+ */
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+ return("Lexical error at line " +
+ errorLine + ", column " +
+ errorColumn + ". Encountered: " +
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
+ "after : \"" + addEscapes(errorAfter) + "\"");
+ }
+
+ /**
+ * You can also modify the body of this method to customize your error messages.
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+ * of end-users concern, so you can return something like :
+ *
+ * "Internal Error : Please file a bug report .... "
+ *
+ * from this method for such cases in the release version of your parser.
+ */
+ @Override public String getMessage() {
+ return super.getMessage();
+ }
+
+ /*
+ * Constructors of various flavors follow.
+ */
+
+ /** No arg constructor. */
+ public TokenMgrError() {
+ }
+
+ /** Constructor with message and reason. */
+ public TokenMgrError(String message, int reason) {
+ super(message);
+ errorCode = reason;
+ }
+
+ /** Full Constructor. */
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ }
+}
+/* JavaCC - OriginalChecksum=67356b7e54e48778087c76088eb92168 (do not edit this line) */
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/engine/ShaclPaths.java b/jena-shacl/src/main/java/org/apache/jena/shacl/engine/ShaclPaths.java
index 437d85c..362bea7 100644
--- a/jena-shacl/src/main/java/org/apache/jena/shacl/engine/ShaclPaths.java
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/engine/ShaclPaths.java
@@ -29,6 +29,7 @@ import org.apache.jena.graph.Graph;
import org.apache.jena.graph.Node;
import org.apache.jena.graph.NodeFactory;
import org.apache.jena.graph.Triple;
+import org.apache.jena.riot.system.StreamRDF;
import org.apache.jena.shacl.lib.G;
import org.apache.jena.shacl.lib.ShLib;
import org.apache.jena.shacl.parser.ShaclParseException;
@@ -232,12 +233,18 @@ SHACL Property path: [ sh:alternativePath ( ex:father ex:mother ) ]
// return Pair.create(acc, n);
// }
- /** Create triples for path in dstGraph */
+ /** Create triples for path in dstGraph */
public static Node pathToRDF(Path p, Graph dstGraph) {
Node n = pathToRDF(dstGraph::add, p);
return n;
}
+ /** Create triples for path, send to a StreamRDF */
+ public static Node pathToRDF(Path p, StreamRDF dest) {
+ Node n = pathToRDF(dest::triple, p);
+ return n;
+ }
+
public static Node pathToRDF(Consumer<Triple> acc, Path p) {
PathToRDF proc = new PathToRDF(acc);
p.visit(proc);
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/lib/ShLib.java b/jena-shacl/src/main/java/org/apache/jena/shacl/lib/ShLib.java
index 33264e7..8239119 100644
--- a/jena-shacl/src/main/java/org/apache/jena/shacl/lib/ShLib.java
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/lib/ShLib.java
@@ -79,6 +79,7 @@ public class ShLib {
public static void printShapes(Shapes shapes) {
IndentedWriter out = IndentedWriter.stdout;
printShapes(out, shapes);
+ out.flush();
}
public static void printShapes(IndentedWriter out, Shapes shapes) {
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/parser/Shape.java b/jena-shacl/src/main/java/org/apache/jena/shacl/parser/Shape.java
index 91a98fe..4ed89ad 100644
--- a/jena-shacl/src/main/java/org/apache/jena/shacl/parser/Shape.java
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/parser/Shape.java
@@ -108,8 +108,10 @@ public abstract class Shape {
public void print(IndentedWriter out) {
printHeader(out);
- out.print(" ");
- out.print("node="+FmtUtils.stringForNode(shapeNode));
+ if ( ! shapeNode.isBlank() ) {
+ out.print(" ");
+ out.print("node="+FmtUtils.stringForNode(shapeNode));
+ }
if ( deactivated() )
out.print(" deactivated");
@@ -132,5 +134,6 @@ public abstract class Shape {
finally {
out.decIndent();
}
+ out.flush();
}
}
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/parser/ShapesParser.java b/jena-shacl/src/main/java/org/apache/jena/shacl/parser/ShapesParser.java
index 10a0bfc..d151fb8 100644
--- a/jena-shacl/src/main/java/org/apache/jena/shacl/parser/ShapesParser.java
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/parser/ShapesParser.java
@@ -124,7 +124,8 @@ public class ShapesParser {
/** Parse and add all the declared shapes into the map.
* The {@code shapesMap} is modified, adding in all shapes processed.
*/
- public static Collection<Shape> declaredShapes(Graph shapesGraph, Map<Node, Shape> shapesMap) {
+ public static Collection<Shape> declaredShapes(Graph shapesGraph, Map<Node, Shape> _shapesMap) {
+ Map<Node, Shape> shapesMap = ( _shapesMap == null ) ? new HashMap<>() : _shapesMap;
// All declared shapes.
Map<Node, Shape> acc = new LinkedHashMap<>();
G.listAllNodesOfType(shapesGraph, SHACL.NodeShape).forEach(shapeNode->
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/sys/InitShacl.java b/jena-shacl/src/main/java/org/apache/jena/shacl/sys/InitShacl.java
index 15c4d0e..8c88035 100644
--- a/jena-shacl/src/main/java/org/apache/jena/shacl/sys/InitShacl.java
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/sys/InitShacl.java
@@ -18,6 +18,7 @@
package org.apache.jena.shacl.sys;
+import org.apache.jena.shacl.compact.SHACLC;
import org.apache.jena.sys.JenaSubsystemLifecycle;
public class InitShacl implements JenaSubsystemLifecycle {
@@ -25,7 +26,9 @@ public class InitShacl implements JenaSubsystemLifecycle {
public InitShacl() {}
@Override
- public void start() {}
+ public void start() {
+ SHACLC.init();
+ }
@Override
public void stop() {}
diff --git a/jena-shacl/src/test/java/org/apache/jena/shacl/TC_SHACL.java b/jena-shacl/src/test/java/org/apache/jena/shacl/TC_SHACL.java
index c210ff1..742e75e 100644
--- a/jena-shacl/src/test/java/org/apache/jena/shacl/TC_SHACL.java
+++ b/jena-shacl/src/test/java/org/apache/jena/shacl/TC_SHACL.java
@@ -18,6 +18,7 @@
package org.apache.jena.shacl;
+import org.apache.jena.shacl.compact.TestShaclCompact;
import org.apache.jena.shacl.tests.TestValidationReport;
import org.apache.jena.shacl.tests.jena_shacl.TS_JenaShacl;
import org.apache.jena.shacl.tests.std.TS_StdSHACL;
@@ -29,6 +30,7 @@ import org.junit.runners.Suite;
TestValidationReport.class
, TS_StdSHACL.class
, TS_JenaShacl.class
+ , TestShaclCompact.class
} )
public class TC_SHACL { }
diff --git a/jena-shacl/src/test/java/org/apache/jena/shacl/compact/TestShaclCompact.java b/jena-shacl/src/test/java/org/apache/jena/shacl/compact/TestShaclCompact.java
new file mode 100644
index 0000000..9bfc3a1
--- /dev/null
+++ b/jena-shacl/src/test/java/org/apache/jena/shacl/compact/TestShaclCompact.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.shacl.compact;
+
+import static org.junit.Assert.assertTrue;
+
+import org.apache.jena.graph.Graph;
+import org.apache.jena.riot.RDFDataMgr;
+import org.apache.jena.riot.RDFFormat;
+import org.apache.jena.riot.RDFWriter;
+import org.apache.jena.shacl.Shapes;
+import org.junit.Test;
+
+public class TestShaclCompact {
+
+ // Tests from the WG github area.
+ @Test public void array_in() { testv("array-in"); }
+ @Test public void basic_shape_iri() { testv("basic-shape-iri"); }
+ @Test public void basic_shape() { testv("basic-shape"); }
+ @Test public void basic_shape_with_target() { testv("basic-shape-with-target"); }
+ @Test public void basic_shape_with_targets() { testv("basic-shape-with-targets"); }
+ @Test public void class_() { testv("class"); }
+ @Test public void comment() { testv("comment"); }
+ @Test public void complex1() { testv("complex1"); }
+ @Test public void complex2() { testv("complex2"); }
+ @Test public void count_0_1() { testv("count-0-1"); }
+ @Test public void count_0_unlimited() { testv("count-0-unlimited"); }
+ @Test public void count_1_2() { testv("count-1-2"); }
+ @Test public void count_1_unlimited() { testv("count-1-unlimited"); }
+ @Test public void datatype() { testv("datatype"); }
+ @Test public void directives() { testv("directives"); }
+ @Test public void empty() { testv("empty"); }
+ @Test public void nestedShape() { testv("nestedShape"); }
+ @Test public void nodeKind() { testv("nodeKind"); }
+ @Test public void node_or_2() { testv("node-or-2"); }
+ @Test public void node_or_3_not() { testv("node-or-3-not"); }
+ @Test public void path_alternative() { testv("path-alternative"); }
+ @Test public void path_complex() { testv("path-complex"); }
+ @Test public void path_inverse() { testv("path-inverse"); }
+ @Test public void path_oneOrMore() { testv("path-oneOrMore"); }
+ @Test public void path_sequence() { testv("path-sequence"); }
+ @Test public void path_zeroOrMore() { testv("path-zeroOrMore"); }
+ @Test public void path_zeroOrOne() { testv("path-zeroOrOne"); }
+ @Test public void property_empty() { testv("property-empty"); }
+ @Test public void property_not() { testv("property-not"); }
+ @Test public void property_or_2() { testv("property-or-2"); }
+ @Test public void property_or_3() { testv("property-or-3"); }
+ @Test public void shapeRef() { testv("shapeRef"); }
+
+ private final String DIR = "testing/shaclc-valid/";
+ private final String BASE ="urn:x-base:default";
+
+ private void testv(String string) {
+ String fn = DIR+string+".shaclc";
+ String ttl = DIR+string+".ttl";
+
+ //System.err.println("---- "+fn);
+
+ Shapes shapes = ShaclcParser.parse(fn, BASE);
+ Graph expected = RDFDataMgr.loadGraph(ttl);
+
+ Graph graphGot = shapes.getGraph();
+ Graph graphOther = expected;
+
+ boolean isomorphic = graphGot.isIsomorphicWith(graphOther);
+ if ( ! isomorphic ) {
+ System.err.println("---- "+fn);
+ System.err.println("Different");
+ System.err.println("graph(jena) = "+graphGot.size());
+ System.err.println("graph(ref) = "+graphOther.size());
+ if ( false ) {
+ RDFWriter.create().source(graphGot).format(RDFFormat.TURTLE_PRETTY).output(System.err);
+ RDFWriter.create().source(graphOther).format(RDFFormat.TURTLE_PRETTY).output(System.err);
+ }
+ }
+ assertTrue("test: "+string, isomorphic);
+ }
+}
+
diff --git a/jena-shacl/testing/shaclc-valid/array-in.shaclc b/jena-shacl/testing/shaclc-valid/array-in.shaclc
new file mode 100644
index 0000000..6e8db23
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/array-in.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/array-in>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property in=[ex:Instance1 true "string" 42] .
+}
diff --git a/jena-shacl/testing/shaclc-valid/array-in.ttl b/jena-shacl/testing/shaclc-valid/array-in.ttl
new file mode 100644
index 0000000..1c3cdf0
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/array-in.ttl
@@ -0,0 +1,19 @@
+@base <http://example.org/array-in> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:in ( ex:Instance1 true "string" 42 ) ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/basic-shape-iri.shaclc b/jena-shacl/testing/shaclc-valid/basic-shape-iri.shaclc
new file mode 100644
index 0000000..8110900
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/basic-shape-iri.shaclc
@@ -0,0 +1,4 @@
+BASE <http://example.org/basic-shape-iri>
+
+shape <http://example.org/test#TestShape> {
+}
diff --git a/jena-shacl/testing/shaclc-valid/basic-shape-iri.ttl b/jena-shacl/testing/shaclc-valid/basic-shape-iri.ttl
new file mode 100644
index 0000000..589ad26
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/basic-shape-iri.ttl
@@ -0,0 +1,14 @@
+@base <http://example.org/basic-shape-iri> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.org/basic-shape-iri>
+ a owl:Ontology ;
+.
+
+<http://example.org/test#TestShape>
+ a sh:NodeShape ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/basic-shape-with-target.shaclc b/jena-shacl/testing/shaclc-valid/basic-shape-with-target.shaclc
new file mode 100644
index 0000000..2b1fac3
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/basic-shape-with-target.shaclc
@@ -0,0 +1,6 @@
+BASE <http://example.org/basic-shape-with-target>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape -> ex:TestClass {
+}
diff --git a/jena-shacl/testing/shaclc-valid/basic-shape-with-target.ttl b/jena-shacl/testing/shaclc-valid/basic-shape-with-target.ttl
new file mode 100644
index 0000000..cb87aaa
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/basic-shape-with-target.ttl
@@ -0,0 +1,16 @@
+@base <http://example.org/basic-shape-with-target> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.org/basic-shape-with-target>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:targetClass ex:TestClass ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/basic-shape-with-targets.shaclc b/jena-shacl/testing/shaclc-valid/basic-shape-with-targets.shaclc
new file mode 100644
index 0000000..4bd4538
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/basic-shape-with-targets.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/basic-shape-with-targets>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape -> ex:TestClass1 ex:TestClass2 {
+ targetNode=ex:TestNode targetSubjectsOf=ex:subjectProperty targetObjectsOf=ex:objectProperty .
+}
diff --git a/jena-shacl/testing/shaclc-valid/basic-shape-with-targets.ttl b/jena-shacl/testing/shaclc-valid/basic-shape-with-targets.ttl
new file mode 100644
index 0000000..3f4b071
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/basic-shape-with-targets.ttl
@@ -0,0 +1,19 @@
+@base <http://example.org/basic-shape-with-targets> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.org/basic-shape-with-targets>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:targetClass ex:TestClass1, ex:TestClass2 ;
+ sh:targetNode ex:TestNode ;
+ sh:targetObjectsOf ex:objectProperty ;
+ sh:targetSubjectsOf ex:subjectProperty ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/basic-shape.shaclc b/jena-shacl/testing/shaclc-valid/basic-shape.shaclc
new file mode 100644
index 0000000..a0eb373
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/basic-shape.shaclc
@@ -0,0 +1,6 @@
+BASE <http://example.org/basic-shape>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+}
diff --git a/jena-shacl/testing/shaclc-valid/basic-shape.ttl b/jena-shacl/testing/shaclc-valid/basic-shape.ttl
new file mode 100644
index 0000000..3781d98
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/basic-shape.ttl
@@ -0,0 +1,15 @@
+@base <http://example.org/basic-shape> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.org/basic-shape>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/class.shaclc b/jena-shacl/testing/shaclc-valid/class.shaclc
new file mode 100644
index 0000000..ea6361b
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/class.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/class>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property ex:TestClass .
+}
diff --git a/jena-shacl/testing/shaclc-valid/class.ttl b/jena-shacl/testing/shaclc-valid/class.ttl
new file mode 100644
index 0000000..d9f2136
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/class.ttl
@@ -0,0 +1,19 @@
+@base <http://example.org/class> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:class ex:TestClass ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/comment.shaclc b/jena-shacl/testing/shaclc-valid/comment.shaclc
new file mode 100644
index 0000000..3ff2865
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/comment.shaclc
@@ -0,0 +1,8 @@
+BASE <http://example.org/comment>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape { # Rest is a comment
+}
+
+# Another comment
\ No newline at end of file
diff --git a/jena-shacl/testing/shaclc-valid/comment.ttl b/jena-shacl/testing/shaclc-valid/comment.ttl
new file mode 100644
index 0000000..659097b
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/comment.ttl
@@ -0,0 +1,15 @@
+@base <http://example.org/comment> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/complex1.shaclc b/jena-shacl/testing/shaclc-valid/complex1.shaclc
new file mode 100644
index 0000000..2c520f7
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/complex1.shaclc
@@ -0,0 +1,15 @@
+BASE <http://example.com/ns>
+
+IMPORTS <http://example.com/person-ontology>
+
+PREFIX ex: <http://example.com/ns#>
+
+shape ex:PersonShape -> ex:Person {
+ closed=true ignoredProperties=[rdf:type] .
+ ex:ssn xsd:string [0..1] pattern="^\\d{3}-\\d{2}-\\d{4}$" .
+ ex:worksFor IRI ex:Company [0..*] .
+ ex:address BlankNode [0..1] {
+ ex:city xsd:string [1..1] .
+ ex:postalCode xsd:integer|xsd:string [1..1] maxLength=5 .
+ } .
+}
\ No newline at end of file
diff --git a/jena-shacl/testing/shaclc-valid/complex1.ttl b/jena-shacl/testing/shaclc-valid/complex1.ttl
new file mode 100644
index 0000000..7f9926e
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/complex1.ttl
@@ -0,0 +1,48 @@
+@base <http://example.com/ns> .
+@prefix ex: <http://example.com/ns#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/ns>
+ rdf:type owl:Ontology ;
+ owl:imports <http://example.com/person-ontology> .
+
+ex:PersonShape
+ a sh:NodeShape ;
+ sh:targetClass ex:Person ;
+ sh:closed true ;
+ sh:ignoredProperties ( rdf:type ) ;
+ sh:property [
+ sh:path ex:ssn ;
+ sh:maxCount 1 ;
+ sh:datatype xsd:string ;
+ sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" ;
+ ] ;
+ sh:property [
+ sh:path ex:worksFor ;
+ sh:class ex:Company ;
+ sh:nodeKind sh:IRI ;
+ ] ;
+ sh:property [
+ sh:path ex:address ;
+ sh:maxCount 1 ;
+ sh:nodeKind sh:BlankNode ;
+ sh:node [
+ sh:property [
+ sh:path ex:city ;
+ sh:datatype xsd:string ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ ] ;
+ sh:property [
+ sh:path ex:postalCode ;
+ sh:or ( [ sh:datatype xsd:integer ] [ sh:datatype xsd:string ] ) ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ sh:maxLength 5 ;
+ ] ;
+ ] ;
+ ] .
\ No newline at end of file
diff --git a/jena-shacl/testing/shaclc-valid/complex2.shaclc b/jena-shacl/testing/shaclc-valid/complex2.shaclc
new file mode 100644
index 0000000..b517e05
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/complex2.shaclc
@@ -0,0 +1,15 @@
+BASE <http://example.com/ns>
+
+IMPORTS <http://example.com/person-ontology>
+
+PREFIX ex: <http://example.com/ns#>
+
+shapeClass ex:Person {
+ closed=true ignoredProperties=[rdf:type] .
+ ex:ssn xsd:string [0..1] pattern="^\\d{3}-\\d{2}-\\d{4}$" .
+ ex:worksFor IRI ex:Company [0..*] .
+ ex:address BlankNode [0..1] {
+ ex:city xsd:string [1..1] .
+ ex:postalCode xsd:integer|xsd:string [1..1] maxLength=5 .
+ } .
+}
diff --git a/jena-shacl/testing/shaclc-valid/complex2.ttl b/jena-shacl/testing/shaclc-valid/complex2.ttl
new file mode 100644
index 0000000..6958a34
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/complex2.ttl
@@ -0,0 +1,47 @@
+@base <http://example.com/ns> .
+@prefix ex: <http://example.com/ns#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/ns>
+ rdf:type owl:Ontology ;
+ owl:imports <http://example.com/person-ontology> .
+
+ex:Person
+ a sh:NodeShape, rdfs:Class ;
+ sh:closed true ;
+ sh:ignoredProperties ( rdf:type ) ;
+ sh:property [
+ sh:path ex:ssn ;
+ sh:maxCount 1 ;
+ sh:datatype xsd:string ;
+ sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" ;
+ ] ;
+ sh:property [
+ sh:path ex:worksFor ;
+ sh:class ex:Company ;
+ sh:nodeKind sh:IRI ;
+ ] ;
+ sh:property [
+ sh:path ex:address ;
+ sh:maxCount 1 ;
+ sh:nodeKind sh:BlankNode ;
+ sh:node [
+ sh:property [
+ sh:path ex:city ;
+ sh:datatype xsd:string ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ ] ;
+ sh:property [
+ sh:path ex:postalCode ;
+ sh:or ( [ sh:datatype xsd:integer ] [ sh:datatype xsd:string ] ) ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ sh:maxLength 5 ;
+ ] ;
+ ] ;
+ ] .
\ No newline at end of file
diff --git a/jena-shacl/testing/shaclc-valid/count-0-1.shaclc b/jena-shacl/testing/shaclc-valid/count-0-1.shaclc
new file mode 100644
index 0000000..c769d17
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/count-0-1.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/count-0-1>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property [0..1] .
+}
diff --git a/jena-shacl/testing/shaclc-valid/count-0-1.ttl b/jena-shacl/testing/shaclc-valid/count-0-1.ttl
new file mode 100644
index 0000000..ced109e
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/count-0-1.ttl
@@ -0,0 +1,19 @@
+@base <http://example.org/count-0-1> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:maxCount 1 ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/count-0-unlimited.shaclc b/jena-shacl/testing/shaclc-valid/count-0-unlimited.shaclc
new file mode 100644
index 0000000..f6d6cc1
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/count-0-unlimited.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/count-0-unlimited>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property [0..*] .
+}
diff --git a/jena-shacl/testing/shaclc-valid/count-0-unlimited.ttl b/jena-shacl/testing/shaclc-valid/count-0-unlimited.ttl
new file mode 100644
index 0000000..79be029
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/count-0-unlimited.ttl
@@ -0,0 +1,18 @@
+@base <http://example.org/count-0-unlimited> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/count-1-2.shaclc b/jena-shacl/testing/shaclc-valid/count-1-2.shaclc
new file mode 100644
index 0000000..7ae0047
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/count-1-2.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/count-1-2>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property [1..2] .
+}
diff --git a/jena-shacl/testing/shaclc-valid/count-1-2.ttl b/jena-shacl/testing/shaclc-valid/count-1-2.ttl
new file mode 100644
index 0000000..4e67e62
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/count-1-2.ttl
@@ -0,0 +1,20 @@
+@base <http://example.org/count-1-2> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:minCount 1 ;
+ sh:maxCount 2 ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/count-1-unlimited.shaclc b/jena-shacl/testing/shaclc-valid/count-1-unlimited.shaclc
new file mode 100644
index 0000000..13b94e6
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/count-1-unlimited.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/count-1-unlimited>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property [1..*] .
+}
diff --git a/jena-shacl/testing/shaclc-valid/count-1-unlimited.ttl b/jena-shacl/testing/shaclc-valid/count-1-unlimited.ttl
new file mode 100644
index 0000000..7afc1a4
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/count-1-unlimited.ttl
@@ -0,0 +1,19 @@
+@base <http://example.org/count-1-unlimited> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:minCount 1 ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/datatype.shaclc b/jena-shacl/testing/shaclc-valid/datatype.shaclc
new file mode 100644
index 0000000..3a06adc
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/datatype.shaclc
@@ -0,0 +1,8 @@
+BASE <http://example.org/datatype>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:stringProperty xsd:string .
+ ex:langProperty rdf:langString .
+}
diff --git a/jena-shacl/testing/shaclc-valid/datatype.ttl b/jena-shacl/testing/shaclc-valid/datatype.ttl
new file mode 100644
index 0000000..41c44f6
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/datatype.ttl
@@ -0,0 +1,23 @@
+@base <http://example.org/datatype> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:stringProperty ;
+ sh:datatype xsd:string ;
+ ] ;
+ sh:property [
+ sh:path ex:langProperty ;
+ sh:datatype rdf:langString ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/directives.shaclc b/jena-shacl/testing/shaclc-valid/directives.shaclc
new file mode 100644
index 0000000..e962aec
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/directives.shaclc
@@ -0,0 +1,6 @@
+BASE <http://example.org/directives>
+
+IMPORTS <http://example.org/graph1>
+IMPORTS <http://example.org/graph2>
+
+PREFIX ex: <http://example.org/directives#>
diff --git a/jena-shacl/testing/shaclc-valid/directives.ttl b/jena-shacl/testing/shaclc-valid/directives.ttl
new file mode 100644
index 0000000..083e779
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/directives.ttl
@@ -0,0 +1,13 @@
+@base <http://example.org/directives> .
+@prefix ex: <http://example.org/directives#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.org/directives>
+ a owl:Ontology ;
+ owl:imports <http://example.org/graph1> ;
+ owl:imports <http://example.org/graph2> ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/empty.shaclc b/jena-shacl/testing/shaclc-valid/empty.shaclc
new file mode 100644
index 0000000..e69de29
diff --git a/jena-shacl/testing/shaclc-valid/empty.ttl b/jena-shacl/testing/shaclc-valid/empty.ttl
new file mode 100644
index 0000000..aef3661
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/empty.ttl
@@ -0,0 +1,9 @@
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<urn:x-base:default>
+ a owl:Ontology ;
+.
\ No newline at end of file
diff --git a/jena-shacl/testing/shaclc-valid/nestedShape.shaclc b/jena-shacl/testing/shaclc-valid/nestedShape.shaclc
new file mode 100644
index 0000000..da16217
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/nestedShape.shaclc
@@ -0,0 +1,9 @@
+BASE <http://example.org/nestedShape>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property IRI {
+ ex:nestedProperty [1..1] .
+ } .
+}
diff --git a/jena-shacl/testing/shaclc-valid/nestedShape.ttl b/jena-shacl/testing/shaclc-valid/nestedShape.ttl
new file mode 100644
index 0000000..0ec4707
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/nestedShape.ttl
@@ -0,0 +1,26 @@
+@base <http://example.org/nestedShape> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:nodeKind sh:IRI ;
+ sh:node [
+ sh:property [
+ sh:path ex:nestedProperty ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ ] ;
+ ] ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/node-or-2.shaclc b/jena-shacl/testing/shaclc-valid/node-or-2.shaclc
new file mode 100644
index 0000000..5675844
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/node-or-2.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/node-or-2>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ datatype=xsd:string|datatype=rdf:langString .
+}
diff --git a/jena-shacl/testing/shaclc-valid/node-or-2.ttl b/jena-shacl/testing/shaclc-valid/node-or-2.ttl
new file mode 100644
index 0000000..2d2ded7
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/node-or-2.ttl
@@ -0,0 +1,16 @@
+@base <http://example.org/node-or-2> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/node-or-3-not.shaclc b/jena-shacl/testing/shaclc-valid/node-or-3-not.shaclc
new file mode 100644
index 0000000..5cfcbe0
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/node-or-3-not.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/node-or-3-not>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ datatype=xsd:string|!datatype=rdf:langString | class = ex:TestClass .
+}
diff --git a/jena-shacl/testing/shaclc-valid/node-or-3-not.ttl b/jena-shacl/testing/shaclc-valid/node-or-3-not.ttl
new file mode 100644
index 0000000..ad15c36
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/node-or-3-not.ttl
@@ -0,0 +1,20 @@
+@base <http://example.org/node-or-3-not> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:or (
+ [ sh:datatype xsd:string ]
+ [ sh:not [ sh:datatype rdf:langString ] ]
+ [ sh:class ex:TestClass ]
+ ) ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/nodeKind.shaclc b/jena-shacl/testing/shaclc-valid/nodeKind.shaclc
new file mode 100644
index 0000000..5a46a39
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/nodeKind.shaclc
@@ -0,0 +1,8 @@
+BASE <http://example.org/nodeKind>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:iriProperty IRI .
+ ex:literalProperty Literal .
+}
diff --git a/jena-shacl/testing/shaclc-valid/nodeKind.ttl b/jena-shacl/testing/shaclc-valid/nodeKind.ttl
new file mode 100644
index 0000000..fbfe260
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/nodeKind.ttl
@@ -0,0 +1,23 @@
+@base <http://example.org/nodeKind> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:iriProperty ;
+ sh:nodeKind sh:IRI ;
+ ] ;
+ sh:property [
+ sh:path ex:literalProperty ;
+ sh:nodeKind sh:Literal ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/path-alternative.shaclc b/jena-shacl/testing/shaclc-valid/path-alternative.shaclc
new file mode 100644
index 0000000..c096a6b
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-alternative.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/path-alternative>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property1|ex:property2 .
+}
diff --git a/jena-shacl/testing/shaclc-valid/path-alternative.ttl b/jena-shacl/testing/shaclc-valid/path-alternative.ttl
new file mode 100644
index 0000000..1ceef92
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-alternative.ttl
@@ -0,0 +1,18 @@
+@base <http://example.org/path-alternative> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path [ sh:alternativePath ( ex:property1 ex:property2 ) ] ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/path-complex.shaclc b/jena-shacl/testing/shaclc-valid/path-complex.shaclc
new file mode 100644
index 0000000..2feeef4
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-complex.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/path-complex>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ (rdf:type/rdfs:subClassOf*)|ex:property .
+}
diff --git a/jena-shacl/testing/shaclc-valid/path-complex.ttl b/jena-shacl/testing/shaclc-valid/path-complex.ttl
new file mode 100644
index 0000000..71bb9d2
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-complex.ttl
@@ -0,0 +1,18 @@
+@base <http://example.org/path-complex> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path [ sh:alternativePath ( ( rdf:type [ sh:zeroOrMorePath rdfs:subClassOf ] ) ex:property ) ] ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/path-inverse.shaclc b/jena-shacl/testing/shaclc-valid/path-inverse.shaclc
new file mode 100644
index 0000000..b155ef2
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-inverse.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/path-inverse>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ^ex:property .
+}
diff --git a/jena-shacl/testing/shaclc-valid/path-inverse.ttl b/jena-shacl/testing/shaclc-valid/path-inverse.ttl
new file mode 100644
index 0000000..c8f7cf6
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-inverse.ttl
@@ -0,0 +1,18 @@
+@base <http://example.org/path-inverse> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path [ sh:inversePath ex:property ] ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/path-oneOrMore.shaclc b/jena-shacl/testing/shaclc-valid/path-oneOrMore.shaclc
new file mode 100644
index 0000000..752c007
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-oneOrMore.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/path-oneOrMore>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property+ .
+}
diff --git a/jena-shacl/testing/shaclc-valid/path-oneOrMore.ttl b/jena-shacl/testing/shaclc-valid/path-oneOrMore.ttl
new file mode 100644
index 0000000..79e644e
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-oneOrMore.ttl
@@ -0,0 +1,18 @@
+@base <http://example.org/path-oneOrMore> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path [ sh:oneOrMorePath ex:property ] ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/path-sequence.shaclc b/jena-shacl/testing/shaclc-valid/path-sequence.shaclc
new file mode 100644
index 0000000..b649e00
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-sequence.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/path-sequence>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property1/ex:property2 .
+}
diff --git a/jena-shacl/testing/shaclc-valid/path-sequence.ttl b/jena-shacl/testing/shaclc-valid/path-sequence.ttl
new file mode 100644
index 0000000..017768f
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-sequence.ttl
@@ -0,0 +1,18 @@
+@base <http://example.org/path-sequence> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ( ex:property1 ex:property2 ) ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/path-zeroOrMore.shaclc b/jena-shacl/testing/shaclc-valid/path-zeroOrMore.shaclc
new file mode 100644
index 0000000..a847bd6
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-zeroOrMore.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/path-zeroOrMore>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property* .
+}
diff --git a/jena-shacl/testing/shaclc-valid/path-zeroOrMore.ttl b/jena-shacl/testing/shaclc-valid/path-zeroOrMore.ttl
new file mode 100644
index 0000000..f77e602
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-zeroOrMore.ttl
@@ -0,0 +1,18 @@
+@base <http://example.org/path-zeroOrMore> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path [ sh:zeroOrMorePath ex:property ] ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/path-zeroOrOne.shaclc b/jena-shacl/testing/shaclc-valid/path-zeroOrOne.shaclc
new file mode 100644
index 0000000..9922ab3
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-zeroOrOne.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/path-zeroOrOne>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property? .
+}
diff --git a/jena-shacl/testing/shaclc-valid/path-zeroOrOne.ttl b/jena-shacl/testing/shaclc-valid/path-zeroOrOne.ttl
new file mode 100644
index 0000000..bf96852
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/path-zeroOrOne.ttl
@@ -0,0 +1,18 @@
+@base <http://example.org/path-zeroOrOne> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path [ sh:zeroOrOnePath ex:property ] ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/property-empty.shaclc b/jena-shacl/testing/shaclc-valid/property-empty.shaclc
new file mode 100644
index 0000000..0628259
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/property-empty.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/property-empty>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property .
+}
diff --git a/jena-shacl/testing/shaclc-valid/property-empty.ttl b/jena-shacl/testing/shaclc-valid/property-empty.ttl
new file mode 100644
index 0000000..076922a
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/property-empty.ttl
@@ -0,0 +1,18 @@
+@base <http://example.org/property-empty> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.org/property-empty>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/property-not.shaclc b/jena-shacl/testing/shaclc-valid/property-not.shaclc
new file mode 100644
index 0000000..59a9f3e
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/property-not.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/property-not>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property !ex:Person .
+}
diff --git a/jena-shacl/testing/shaclc-valid/property-not.ttl b/jena-shacl/testing/shaclc-valid/property-not.ttl
new file mode 100644
index 0000000..618a874
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/property-not.ttl
@@ -0,0 +1,19 @@
+@base <http://example.org/property-not> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:not [ sh:class ex:Person ] ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/property-or-2.shaclc b/jena-shacl/testing/shaclc-valid/property-or-2.shaclc
new file mode 100644
index 0000000..8f4d74d
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/property-or-2.shaclc
@@ -0,0 +1,8 @@
+BASE <http://example.org/property-or-2>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property1 xsd:string|rdf:langString .
+ ex:property2 xsd:string|ex:TestClass .
+}
diff --git a/jena-shacl/testing/shaclc-valid/property-or-2.ttl b/jena-shacl/testing/shaclc-valid/property-or-2.ttl
new file mode 100644
index 0000000..ac12101
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/property-or-2.ttl
@@ -0,0 +1,23 @@
+@base <http://example.org/property-or-2> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property1 ;
+ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ;
+ ] ;
+ sh:property [
+ sh:path ex:property2 ;
+ sh:or ( [ sh:datatype xsd:string ] [ sh:class ex:TestClass ] ) ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/property-or-3.shaclc b/jena-shacl/testing/shaclc-valid/property-or-3.shaclc
new file mode 100644
index 0000000..1154c20
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/property-or-3.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/property-or-3>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property xsd:string|rdf:langString|@ex:OtherShape .
+}
diff --git a/jena-shacl/testing/shaclc-valid/property-or-3.ttl b/jena-shacl/testing/shaclc-valid/property-or-3.ttl
new file mode 100644
index 0000000..88bc80b
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/property-or-3.ttl
@@ -0,0 +1,19 @@
+@base <http://example.org/property-or-3> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] [ sh:node ex:OtherShape ] ) ;
+ ] ;
+.
diff --git a/jena-shacl/testing/shaclc-valid/shapeRef.shaclc b/jena-shacl/testing/shaclc-valid/shapeRef.shaclc
new file mode 100644
index 0000000..3b78658
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/shapeRef.shaclc
@@ -0,0 +1,7 @@
+BASE <http://example.org/shapeRef>
+
+PREFIX ex: <http://example.org/test#>
+
+shape ex:TestShape {
+ ex:property @<http://example.org/test#OtherShape1> @ex:OtherShape2 .
+}
diff --git a/jena-shacl/testing/shaclc-valid/shapeRef.ttl b/jena-shacl/testing/shaclc-valid/shapeRef.ttl
new file mode 100644
index 0000000..e6e4462
--- /dev/null
+++ b/jena-shacl/testing/shaclc-valid/shapeRef.ttl
@@ -0,0 +1,19 @@
+@base <http://example.org/shapeRef> .
+@prefix ex: <http://example.org/test#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix sh: <http://www.w3.org/ns/shacl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<>
+ a owl:Ontology ;
+.
+
+ex:TestShape
+ a sh:NodeShape ;
+ sh:property [
+ sh:path ex:property ;
+ sh:node ex:OtherShape1, ex:OtherShape2 ;
+ ] ;
+.