Skip to content

Commit

Permalink
Sync minor grammar changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Mar 28, 2017
1 parent ed776d6 commit 8e1f387
Show file tree
Hide file tree
Showing 7 changed files with 1,072 additions and 1,399 deletions.
140 changes: 69 additions & 71 deletions etc/shex.ebnf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
| "NOT" (shapeAtomNoRef | shapeRef) shapeOr?
| shapeRef shapeOr
[11] inlineShapeExpression ::= inlineShapeOr
# [12] shapeOr ::= shapeAnd ("OR" shapeAnd)*
[12] shapeOr ::= shapeOrA | shapeOrB shapeOrA?
[12a] shapeOrA ::= ("OR" shapeAnd)+
[12b] shapeOrB ::= ("AND" shapeNot)+
Expand Down Expand Up @@ -156,97 +157,94 @@
[40] groupTripleExpr ::= unaryTripleExpr (';' unaryTripleExpr?)*

[43] unaryTripleExpr ::= productionLabel? (tripleConstraint | bracketedTripleExpr) | include
[43a] productionLabel ::= '$' (iri | blankNode)

# Use oneOfTripleExpr instead of innerTripleExpr
#[44] bracketedTripleExpr ::= '(' innerTripleExpr ')' cardinality? annotation* semanticActions
[44] bracketedTripleExpr ::= '(' oneOfTripleExpr ')' cardinality? annotation* semanticActions

[45] productionLabel ::= '$' (iri | blankNode)
[45] tripleConstraint ::= senseFlags? predicate inlineShapeExpression cardinality? annotation* semanticActions
[46] cardinality ::= '*' | '+' | '?' | REPEAT_RANGE
[47] senseFlags ::= '^'

[46] tripleConstraint ::= senseFlags? predicate inlineShapeExpression cardinality? annotation* semanticActions
[47] cardinality ::= '*' | '+' | '?' | REPEAT_RANGE
[48] senseFlags ::= '^'
[48] valueSet ::= '[' valueSetValue* ']'

[49] valueSet ::= '[' valueSetValue* ']'
[49] valueSetValue ::= iriRange | literalRange | languageRange | '.' exclusion+

[50] valueSetValue ::= (iriRange | literalRange | languageRange) | '.' (exclusion)+
[50] exclusion ::= '-' (iri | literal | LANGTAG) '~'?
[51] iriRange ::= iri ('~' iriExclusion*)?
[52] iriExclusion ::= '-' iri '~'?
[53] literalRange ::= literal ('~' literalExclusion*)?
[54] literalExclusion ::= '-' literal '~'?
[55] languageRange ::= LANGTAG ('~' languageExclusion*)?
[56] languageExclusion ::= '-' LANGTAG '~'?

[51] exclusion ::= '-' (iri | literal | LANGTAG) '~'?
[51i] iriRange ::= iri ('~' iriExclusion*)?
[52i] iriExclusion ::= '-' iri '~'?
[51l] literalRange ::= literal ('~' literalExclusion*)?
[52l] literalExclusion ::= '-' literal '~'?
[51g] languageRange ::= LANGTAG ('~' languageExclusion*)?
[52g] languageExclusion ::= '-' LANGTAG '~'?
[57] include ::= '&' shapeLabel

[53] include ::= '&' shapeLabel
[58] annotation ::= '//' predicate (iri | literal)
[59] semanticActions ::= codeDecl*
[60] codeDecl ::= '%' iri (CODE | "%")

[54] annotation ::= '//' predicate (iri | literal)
[55] semanticActions ::= codeDecl*
[56] codeDecl ::= '%' iri (CODE | "%")

[57] literal ::= rdfLiteral | numericLiteral | booleanLiteral
[58] predicate ::= iri | RDF_TYPE
[59] datatype ::= iri
[60] shapeLabel ::= iri | blankNode
[61] numericLiteral ::= INTEGER | DECIMAL | DOUBLE
[62] rdfLiteral ::= langString | string ('^^' datatype)?
[63] booleanLiteral ::= 'true' | 'false'
[64] string ::= STRING_LITERAL1 | STRING_LITERAL_LONG1
[13t] literal ::= rdfLiteral | numericLiteral | booleanLiteral
[61] predicate ::= iri | RDF_TYPE
[62] datatype ::= iri
[63] shapeLabel ::= iri | blankNode
[16t] numericLiteral ::= INTEGER | DECIMAL | DOUBLE
[129s] rdfLiteral ::= langString | string ('^^' datatype)?
[134s] booleanLiteral ::= 'true' | 'false'
[135s] string ::= STRING_LITERAL1 | STRING_LITERAL_LONG1
| STRING_LITERAL2 | STRING_LITERAL_LONG2
[64l] langString ::= LANG_STRING_LITERAL1 | LANG_STRING_LITERAL_LONG1
[66] langString ::= LANG_STRING_LITERAL1 | LANG_STRING_LITERAL_LONG1
| LANG_STRING_LITERAL2 | LANG_STRING_LITERAL_LONG2
[65] iri ::= IRIREF | prefixedName
[66] prefixedName ::= PNAME_LN | PNAME_NS
[67] blankNode ::= BLANK_NODE_LABEL
[68] includeSet ::= "&" (shapeLabel)+
[136s] iri ::= IRIREF | prefixedName
[137s] prefixedName ::= PNAME_LN | PNAME_NS
[138s] blankNode ::= BLANK_NODE_LABEL

# Reserved for future use
#[65] includeSet ::= "&" (shapeLabel)+
@terminals

[69] CODE ::= '{' ([^%\\] | '\\' [%\\] | UCHAR)* '%' '}'
[70] REPEAT_RANGE ::= '{' INTEGER (',' (INTEGER | '*')?)? '}'
[71] RDF_TYPE ::= 'a'
[72] IRIREF ::= '<' ([^#x00-#x20<>\"{}|^`\\] | UCHAR)* '>' /* #x00=NULL #01-#x1F=control codes #x20=space */
[73] PNAME_NS ::= PN_PREFIX? ':'
[74] PNAME_LN ::= PNAME_NS PN_LOCAL
[75] ATPNAME_NS ::= '@' PN_PREFIX? ':'
[76] ATPNAME_LN ::= '@' PNAME_NS PN_LOCAL

[77] BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)?
[78] LANGTAG ::= '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)*
[79] INTEGER ::= [+-]? [0-9]+
[80] DECIMAL ::= [+-]? [0-9]* '.' [0-9]+
[81] DOUBLE ::= [+-]? ([0-9]+ '.' [0-9]* EXPONENT | '.'? [0-9]+ EXPONENT)
[82] EXPONENT ::= [eE] [+-]? [0-9]+
[83] STRING_LITERAL1 ::= "'" ([^#x27#x5C#xA#xD] | ECHAR | UCHAR)* "'" /* #x27=' #x5C=\ #xA=new line #xD=carriage return */
[84] STRING_LITERAL2 ::= '"' ([^#x22#x5C#xA#xD] | ECHAR | UCHAR)* '"' /* #x22=" #x5C=\ #xA=new line #xD=carriage return */
[85] STRING_LITERAL_LONG1 ::= "'''" (("'" | "''")? ([^\'\\] | ECHAR | UCHAR))* "'''"
[86] STRING_LITERAL_LONG2 ::= '"""' (('"' | '""')? ([^\"\\] | ECHAR | UCHAR))* '"""'
[83l] LANG_STRING_LITERAL1 ::= "'" ([^#x27#x5C#xA#xD] | ECHAR | UCHAR)* "'" LANGTAG
[84l] LANG_STRING_LITERAL2 ::= '"' ([^#x22#x5C#xA#xD] | ECHAR | UCHAR)* '"' LANGTAG
[85l] LANG_STRING_LITERAL_LONG1 ::= "'''" (("'" | "''")? ([^\'\\] | ECHAR | UCHAR))* "'''" LANGTAG
[86l] LANG_STRING_LITERAL_LONG2 ::= '"""' (('"' | '""')? ([^\"\\] | ECHAR | UCHAR))* '"""' LANGTAG
[XX] REGEXP ::= '/' ([^/\\\n\r] | '\\' [nrt\\|.?*+(){}$-\[\]^/] | UCHAR)+ '/' [smix]*
[87] UCHAR ::= '\\u' HEX HEX HEX HEX
[67] CODE ::= '{' ([^%\\] | '\\' [%\\] | UCHAR)* '%' '}'
[68] REPEAT_RANGE ::= '{' INTEGER (',' (INTEGER | '*')?)? '}'
[69] RDF_TYPE ::= 'a'
[18t] IRIREF ::= '<' ([^#x00-#x20<>\"{}|^`\\] | UCHAR)* '>' /* #x00=NULL #01-#x1F=control codes #x20=space */
[140s] PNAME_NS ::= PN_PREFIX? ':'
[141s] PNAME_LN ::= PNAME_NS PN_LOCAL
[70] ATPNAME_NS ::= '@' PN_PREFIX? ':'
[71] ATPNAME_LN ::= '@' PNAME_NS PN_LOCAL
[72] REGEXP ::= '/' ([^/\\\n\r] | '\\' [nrt\\|.?*+(){}$-\[\]^/] | UCHAR)+ '/' [smix]*

[142s] BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)?
[145s] LANGTAG ::= '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)*
[19t] INTEGER ::= [+-]? [0-9]+
[20t] DECIMAL ::= [+-]? [0-9]* '.' [0-9]+
[21t] DOUBLE ::= [+-]? ([0-9]+ '.' [0-9]* EXPONENT | '.'? [0-9]+ EXPONENT)
[155s] EXPONENT ::= [eE] [+-]? [0-9]+
[156s] STRING_LITERAL1 ::= "'" ([^#x27#x5C#xA#xD] | ECHAR | UCHAR)* "'" /* #x27=' #x5C=\ #xA=new line #xD=carriage return */
[157s] STRING_LITERAL2 ::= '"' ([^#x22#x5C#xA#xD] | ECHAR | UCHAR)* '"' /* #x22=" #x5C=\ #xA=new line #xD=carriage return */
[158s] STRING_LITERAL_LONG1 ::= "'''" (("'" | "''")? ([^\'\\] | ECHAR | UCHAR))* "'''"
[159s] STRING_LITERAL_LONG2 ::= '"""' (('"' | '""')? ([^\"\\] | ECHAR | UCHAR))* '"""'
[73] LANG_STRING_LITERAL1 ::= "'" ([^#x27#x5C#xA#xD] | ECHAR | UCHAR)* "'" LANGTAG
[74] LANG_STRING_LITERAL2 ::= '"' ([^#x22#x5C#xA#xD] | ECHAR | UCHAR)* '"' LANGTAG
[75] LANG_STRING_LITERAL_LONG1 ::= "'''" (("'" | "''")? ([^\'\\] | ECHAR | UCHAR))* "'''" LANGTAG
[76] LANG_STRING_LITERAL_LONG2 ::= '"""' (('"' | '""')? ([^\"\\] | ECHAR | UCHAR))* '"""' LANGTAG
[26t] UCHAR ::= '\\u' HEX HEX HEX HEX
| '\\U' HEX HEX HEX HEX HEX HEX HEX HEX
[88] ECHAR ::= '\\' [tbnrf\\\"\']
[89] PN_CHARS_BASE ::= [A-Z] | [a-z]
[160s] ECHAR ::= '\\' [tbnrf\\\"\']
[164s] PN_CHARS_BASE ::= [A-Z] | [a-z]
| [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF]
| [#x0370-#x037D] | [#x037F-#x1FFF]
| [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF]
| [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD]
| [#x10000-#xEFFFF]
[90] PN_CHARS_U ::= PN_CHARS_BASE | '_'
[91] PN_CHARS ::= PN_CHARS_U | '-' | [0-9]
| [#x00B7] | [#x0300-#x036F] | [#x203F-#x2040]
[92] PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)?
[93] PN_LOCAL ::= (PN_CHARS_U | ':' | [0-9] | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))?
[94] PLX ::= PERCENT | PN_LOCAL_ESC
[95] PERCENT ::= '%' HEX HEX
[96] HEX ::= [0-9] | [A-F] | [a-f]
[97] PN_LOCAL_ESC ::= '\\' ('_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%')

# @pass is not a rule, but a declaration
#@pass ::= [ \t\r\n]+
# | "#" [^\r\n]*
[165s] PN_CHARS_U ::= PN_CHARS_BASE | '_'
[167s] PN_CHARS ::= PN_CHARS_U | '-' | [0-9]
| [#x00B7] | [#x0300-#x036F] | [#x203F-#x2040]
[168s] PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)?
[169s] PN_LOCAL ::= (PN_CHARS_U | ':' | [0-9] | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))?
[170s] PLX ::= PERCENT | PN_LOCAL_ESC
[171s] PERCENT ::= '%' HEX HEX
[172s] HEX ::= [0-9] | [A-F] | [a-f]
[173s] PN_LOCAL_ESC ::= '\\' ('_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%')

@pass [ \t\r\n]+ | "#" [^\r\n]*
Loading

0 comments on commit 8e1f387

Please sign in to comment.