{-# LANGUAGE OverloadedStrings #-}
module Hydra.Impl.Haskell.Sources.Ext.Shex.Syntax where
import Hydra.Core
import Hydra.Compute
import Hydra.Module
import Hydra.Grammar
import Hydra.Impl.Haskell.Dsl.Grammars
import Hydra.Util.GrammarToModule
import qualified Hydra.Impl.Haskell.Dsl.Standard as Standard
base_ :: Pattern
base_ = [Char] -> Pattern
terminal [Char]
"BASE"
prefix_ :: Pattern
prefix_ = [Char] -> Pattern
terminal [Char]
"PREFIX"
start_ :: Pattern
start_ = [Char] -> Pattern
terminal [Char]
"start"
equal_ :: Pattern
equal_ = [Char] -> Pattern
terminal [Char]
"="
or_ :: Pattern
or_ = [Char] -> Pattern
terminal [Char]
"OR"
and_ :: Pattern
and_ = [Char] -> Pattern
terminal [Char]
"AND"
not_ :: Pattern
not_ = [Char] -> Pattern
terminal [Char]
"NOT"
true_ :: Pattern
true_ = [Char] -> Pattern
terminal [Char]
"true"
false_ :: Pattern
false_ = [Char] -> Pattern
terminal [Char]
"false"
iri_ :: Pattern
iri_ = [Char] -> Pattern
terminal [Char]
"IRI"
bnode_ :: Pattern
bnode_ = [Char] -> Pattern
terminal [Char]
"BNODE"
literal_ :: Pattern
literal_ = [Char] -> Pattern
terminal [Char]
"LITERAL"
nonLiteral_ :: Pattern
nonLiteral_ = [Char] -> Pattern
terminal [Char]
"NONLITERAL"
length_ :: Pattern
length_ = [Char] -> Pattern
terminal [Char]
"LENGTH"
minLength_ :: Pattern
minLength_ = [Char] -> Pattern
terminal [Char]
"MINLENGTH"
maxLength_ :: Pattern
maxLength_ = [Char] -> Pattern
terminal [Char]
"MAXLENGTH"
external_ :: Pattern
external_ = [Char] -> Pattern
terminal [Char]
"EXTERNAL"
percent_ :: Pattern
percent_ = [Char] -> Pattern
terminal [Char]
"%"
at_ :: Pattern
at_ = [Char] -> Pattern
terminal [Char]
"@"
dollar_ :: Pattern
dollar_ = [Char] -> Pattern
terminal [Char]
"$"
ampersand_ :: Pattern
ampersand_ = [Char] -> Pattern
terminal [Char]
"&"
colon_ :: Pattern
colon_ = [Char] -> Pattern
terminal [Char]
":"
period_ :: Pattern
period_ = [Char] -> Pattern
terminal [Char]
"."
coma_ :: Pattern
coma_ = [Char] -> Pattern
terminal [Char]
","
semicolon_ :: Pattern
semicolon_ = [Char] -> Pattern
terminal [Char]
";"
underscore_ :: Pattern
underscore_ = [Char] -> Pattern
terminal [Char]
"_"
dash_ :: Pattern
dash_ = [Char] -> Pattern
terminal [Char]
"-"
parenOpen_ :: Pattern
parenOpen_ = [Char] -> Pattern
terminal [Char]
"("
parenClose_ :: Pattern
parenClose_ = [Char] -> Pattern
terminal [Char]
")"
braceOpen_ :: Pattern
braceOpen_ = [Char] -> Pattern
terminal [Char]
"{"
braceClose_ :: Pattern
braceClose_ = [Char] -> Pattern
terminal [Char]
"}"
pipe_ :: Pattern
pipe_ = [Char] -> Pattern
terminal [Char]
"|"
star_ :: Pattern
star_ = [Char] -> Pattern
terminal [Char]
"*"
plus_ :: Pattern
plus_ = [Char] -> Pattern
terminal [Char]
"+"
question_ :: Pattern
question_ = [Char] -> Pattern
terminal [Char]
"?"
tilde_ :: Pattern
tilde_ = [Char] -> Pattern
terminal [Char]
"~"
doubleFrwSlash_ :: Pattern
doubleFrwSlash_ = [Char] -> Pattern
terminal [Char]
"\\"
singleQuote_ :: Pattern
singleQuote_ = [Char] -> Pattern
terminal [Char]
"'"
doubleQuote_ :: Pattern
doubleQuote_ = [Char] -> Pattern
terminal [Char]
"\""
minInclusive_ :: Pattern
minInclusive_ = [Char] -> Pattern
terminal [Char]
"MININCLUSIVE"
minExclusive_ :: Pattern
minExclusive_ = [Char] -> Pattern
terminal [Char]
"MINEXCLUSIVE"
maxInclusive_ :: Pattern
maxInclusive_ = [Char] -> Pattern
terminal [Char]
"MAXINCLUSIVE"
maxExclusive_ :: Pattern
maxExclusive_ = [Char] -> Pattern
terminal [Char]
"MAXEXCLUSIVE"
totalDigits_ :: Pattern
totalDigits_ = [Char] -> Pattern
terminal [Char]
"TOTALDIGITS"
fractionDigits_ :: Pattern
fractionDigits_ = [Char] -> Pattern
terminal [Char]
"FRACTIONDIGITS"
= [Char] -> Pattern
terminal [Char]
"EXTRA"
closed_ :: Pattern
closed_ = [Char] -> Pattern
terminal [Char]
"CLOSED"
shexSyntaxModule :: Module Meta
shexSyntaxModule :: Module Meta
shexSyntaxModule = Namespace -> Grammar -> Maybe [Char] -> Module Meta
grammarToModule Namespace
ns Grammar
shexGrammar forall a b. (a -> b) -> a -> b
$
forall a. a -> Maybe a
Just ([Char]
"A Shex model. Based on the BNF at:\n" forall a. [a] -> [a] -> [a]
++
[Char]
" https://github.com/shexSpec/grammar/blob/master/bnf")
where
ns :: Namespace
ns = [Char] -> Namespace
Namespace [Char]
"hydra/ext/shex/syntax"
shexGrammar :: Grammar
shexGrammar :: Grammar
shexGrammar = [Production] -> Grammar
Grammar [
[Char] -> [Pattern] -> Production
define [Char]
"ShexDoc" [
[Pattern] -> Pattern
list[Pattern -> Pattern
starPattern
"Directive", Pattern -> Pattern
opt([Pattern] -> Pattern
list[ [Pattern] -> Pattern
alts[Pattern
"NotStartAction", Pattern
"StartActions"], Pattern -> Pattern
star Pattern
"Statement" ]), Pattern
"PrefixDecl"]],
[Char] -> [Pattern] -> Production
define [Char]
"Directive" [
Pattern
"BaseDecl", Pattern
"PrefixDecl"],
[Char] -> [Pattern] -> Production
define [Char]
"BaseDecl" [
[Pattern] -> Pattern
list[Pattern
base_, Pattern
"IriRef"]],
[Char] -> [Pattern] -> Production
define [Char]
"PrefixDecl" [
[Pattern] -> Pattern
list[Pattern
prefix_, Pattern
"PnameNs", Pattern
"IriRef"]],
[Char] -> [Pattern] -> Production
define [Char]
"NotStartAction" [
[Char]
"start"[Char] -> Pattern -> Pattern
>: [Pattern] -> Pattern
list[Pattern
start_, Pattern
equal_, Pattern
"ShapeExpression"],
[Char]
"shapeExprDecl"[Char] -> Pattern -> Pattern
>: [Pattern] -> Pattern
list[Pattern
"ShapeExprLabel", [Pattern] -> Pattern
alts[Pattern
"ShapeExpression", Pattern
external_]]],
[Char] -> [Pattern] -> Production
define [Char]
"StartActions" [
Pattern -> Pattern
plus(Pattern
"CodeDecl")],
[Char] -> [Pattern] -> Production
define [Char]
"Statement" [
[Pattern] -> Pattern
alts[ Pattern
"Directive", Pattern
"NotStartAction"]],
[Char] -> [Pattern] -> Production
define [Char]
"ShapeExpression" [
Pattern
"ShapeOr"],
[Char] -> [Pattern] -> Production
define [Char]
"InlineShapeExpression" [
Pattern
"InlineShapeOr"],
[Char] -> [Pattern] -> Production
define [Char]
"ShapeOr" [
[Pattern] -> Pattern
list[Pattern
"ShapeAnd", Pattern -> Pattern
star([Pattern] -> Pattern
list[Pattern
or_, Pattern
"ShapeAnd"])]],
[Char] -> [Pattern] -> Production
define [Char]
"InlineShapeOr" [
[Pattern] -> Pattern
list[Pattern
"ShapeAnd", Pattern -> Pattern
star([Pattern] -> Pattern
list[Pattern
or_, Pattern
"InlineShapeAnd"])]],
[Char] -> [Pattern] -> Production
define [Char]
"ShapeAnd" [
[Pattern] -> Pattern
list[Pattern
"ShapeNot", Pattern -> Pattern
star([Pattern] -> Pattern
list[Pattern
and_, Pattern
"ShapeNot"])]],
[Char] -> [Pattern] -> Production
define [Char]
"InlineShapeAnd" [
[Pattern] -> Pattern
list[Pattern
"InlineShapeNot", Pattern -> Pattern
star([Pattern] -> Pattern
list[Pattern
and_, Pattern
"InlineShapeNot"])]],
[Char] -> [Pattern] -> Production
define [Char]
"ShapeNot" [
[Pattern] -> Pattern
list[Pattern -> Pattern
opt (Pattern
not_), Pattern
"ShapeAtom"]],
[Char] -> [Pattern] -> Production
define [Char]
"InlineShapeNot" [
[Pattern] -> Pattern
list[Pattern -> Pattern
opt(Pattern
not_), Pattern
"InlineShapeAtom"]],
[Char] -> [Pattern] -> Production
define [Char]
"ShapeAtom" [
[Pattern] -> Pattern
list[Pattern
"NodeConstraint", Pattern -> Pattern
opt(Pattern
"ShapeOrRef")],
Pattern
"ShapeOrRef",
[Pattern] -> Pattern
list[Pattern
parenOpen_, Pattern
"ShapeExpression", Pattern
parenClose_],
Pattern
period_],
[Char] -> [Pattern] -> Production
define [Char]
"InlineShapeAtom" [
[Pattern] -> Pattern
list[Pattern
"NodeConstraint", Pattern -> Pattern
opt(Pattern
"InlineShapeOrRef")],
[Pattern] -> Pattern
list[Pattern
"InlineShapeOrRef", Pattern -> Pattern
opt(Pattern
"NodeConstraint")],
[Pattern] -> Pattern
list[Pattern
parenOpen_, Pattern
"ShapeExpression", Pattern
parenClose_],
Pattern
period_],
[Char] -> [Pattern] -> Production
define [Char]
"ShapeOrRef" [
Pattern
"ShapeDefinition",
Pattern
"AtpNameLn",
Pattern
"AtpNameNs",
[Pattern] -> Pattern
list[Pattern
at_,Pattern
"ShapeExprLabel"]],
[Char] -> [Pattern] -> Production
define [Char]
"InlineShapeOrRef" [
Pattern
"InlineShapeDefinition",
Pattern
"AtpNameLn",
Pattern
"AtpNameNs",
[Pattern] -> Pattern
list[Pattern
at_,Pattern
"ShapeExprLabel"]],
[Char] -> [Pattern] -> Production
define [Char]
"NodeConstraint" [
[Pattern] -> Pattern
list[Pattern
literal_, Pattern -> Pattern
star(Pattern
"XsFacet")],
[Pattern] -> Pattern
list[Pattern
"NonLiteralKind", Pattern -> Pattern
star(Pattern
"StringFacet")],
[Pattern] -> Pattern
list[Pattern
"Datatype", Pattern -> Pattern
star(Pattern
"XsFacet")],
[Pattern] -> Pattern
list[Pattern
"ValueSet", Pattern -> Pattern
star(Pattern
"XsFacet")],
[Pattern] -> Pattern
list[Pattern
"ValueSet", Pattern -> Pattern
star(Pattern
"XsFacet")],
Pattern -> Pattern
plus(Pattern
"XsFacet")],
[Char] -> [Pattern] -> Production
define [Char]
"NonLiteralKind" [Pattern
iri_, Pattern
bnode_, Pattern
nonLiteral_],
[Char] -> [Pattern] -> Production
define [Char]
"XsFacet" [Pattern
"StringFacet", Pattern
"NumericFacet"],
[Char] -> [Pattern] -> Production
define [Char]
"StringFacet" [
[Pattern] -> Pattern
list [Pattern
"StringLength", Pattern
"Integer"],
Pattern
"Regexp" ],
[Char] -> [Pattern] -> Production
define [Char]
"StringLength" [
Pattern
length_, Pattern
minLength_, Pattern
maxLength_],
[Char] -> [Pattern] -> Production
define [Char]
"NumericFacet" [
[Pattern] -> Pattern
list [Pattern
"NumericRange", Pattern
"NumericLiteral"],
[Pattern] -> Pattern
list [Pattern
"NumericLength", Pattern
"Integer"]],
[Char] -> [Pattern] -> Production
define [Char]
"NumericRange" [
Pattern
minInclusive_, Pattern
minExclusive_, Pattern
maxInclusive_, Pattern
maxExclusive_],
[Char] -> [Pattern] -> Production
define [Char]
"NumericLength" [
Pattern
totalDigits_, Pattern
fractionDigits_],
[Char] -> [Pattern] -> Production
define [Char]
"ShapeDefinition" [
[Pattern] -> Pattern
list[Pattern -> Pattern
star([Pattern] -> Pattern
alts[Pattern
"IncludeSet", Pattern
"ExtraPropertySet", Pattern
closed_]),
Pattern
braceOpen_, Pattern -> Pattern
opt(Pattern
"TripleExpression"), Pattern
braceClose_,
Pattern -> Pattern
star(Pattern
"Annotation"), Pattern
"SemanticActions"]],
[Char] -> [Pattern] -> Production
define [Char]
"InlineShapeDefinition" [
[Pattern] -> Pattern
list[Pattern -> Pattern
star([Pattern] -> Pattern
alts[Pattern
"IncludeSet", Pattern
"ExtraPropertySet", Pattern
closed_]), Pattern
braceOpen_, Pattern -> Pattern
opt(Pattern
"TripleExpression"), Pattern
braceClose_]],
[Char] -> [Pattern] -> Production
define [Char]
"ExtraPropertySet" [
[Pattern] -> Pattern
list[Pattern
extra_, Pattern -> Pattern
plusPattern
"Predicate"]],
[Char] -> [Pattern] -> Production
define [Char]
"TripleExpression" [
Pattern
"OneOfTripleExpr"],
[Char] -> [Pattern] -> Production
define [Char]
"OneOfTripleExpr" [
Pattern
"GroupTripleExpr",
Pattern
"MultiElementOneOf"],
[Char] -> [Pattern] -> Production
define [Char]
"MultiElementOneOf" [
[Pattern] -> Pattern
list[Pattern
"GroupTripleExpr", Pattern -> Pattern
plus([Pattern] -> Pattern
list[Pattern
pipe_, Pattern
"GroupTripleExpr"])]],
[Char] -> [Pattern] -> Production
define [Char]
"InnerTripleExpr" [
Pattern
"MultiElementGroup",
Pattern
"MultiElementOneOf"],
[Char] -> [Pattern] -> Production
define [Char]
"GroupTripleExpr" [
Pattern
"SingleElementGroup",
Pattern
"MultiElementGroup"],
[Char] -> [Pattern] -> Production
define [Char]
"SingleElementGroup" [
[Pattern] -> Pattern
list[Pattern
"UnaryTripleExpr", Pattern -> Pattern
opt(Pattern
semicolon_)]],
[Char] -> [Pattern] -> Production
define [Char]
"MultiElementGroup" [
[Pattern] -> Pattern
list[Pattern
"UnaryTripleExpr", Pattern -> Pattern
plus([Pattern] -> Pattern
list[Pattern
semicolon_, Pattern
"UnaryTripleExpr"]), Pattern -> Pattern
opt(Pattern
semicolon_)]],
[Char] -> [Pattern] -> Production
define [Char]
"UnaryTripleExpr" [
[Pattern] -> Pattern
list[Pattern -> Pattern
opt([Pattern] -> Pattern
list[Pattern
dollar_, Pattern
"TripleExprLabel"]), [Pattern] -> Pattern
alts[Pattern
"TripleConstraint", Pattern
"BracketedTripleExpr"]],
Pattern
"Include"],
[Char] -> [Pattern] -> Production
define [Char]
"BracketedTripleExpr" [
[Pattern] -> Pattern
list[Pattern
parenOpen_, Pattern
"InnerTripleExpr", Pattern
parenClose_, Pattern -> Pattern
optPattern
"Cardinality", Pattern -> Pattern
starPattern
"Annotation", Pattern
"SemanticActions"]],
[Char] -> [Pattern] -> Production
define [Char]
"TripleConstraint" [
[Pattern] -> Pattern
list[Pattern -> Pattern
optPattern
"SenseFlags", Pattern
"Predicate", Pattern
"InlineShapeExpression", Pattern -> Pattern
optPattern
"Cardinality", Pattern -> Pattern
starPattern
"Annotation", Pattern
"SemanticActions"]],
[Char] -> [Pattern] -> Production
define [Char]
"Cardinality" [
Pattern
star_, Pattern
plus_, Pattern
question_, Pattern
"RepeatRange"],
[Char] -> [Pattern] -> Production
define [Char]
"SenseFlags" [
[Char] -> Pattern
terminal [Char]
"^"],
[Char] -> [Pattern] -> Production
define [Char]
"ValueSet" [
[Pattern] -> Pattern
list[[Char] -> Pattern
terminal [Char]
"[", Pattern -> Pattern
starPattern
"ValueSetValue", [Char] -> Pattern
terminal [Char]
"]"]],
[Char] -> [Pattern] -> Production
define [Char]
"ValueSetValue" [
Pattern
"IriRange",
Pattern
"Literal"],
[Char] -> [Pattern] -> Production
define [Char]
"IriRange" [
[Pattern] -> Pattern
list[Pattern
"Iri", Pattern -> Pattern
opt([Pattern] -> Pattern
list[Pattern
tilde_, Pattern -> Pattern
starPattern
"Exclusion"])],
[Pattern] -> Pattern
list[Pattern
period_, Pattern -> Pattern
plusPattern
"Exclusion"]],
[Char] -> [Pattern] -> Production
define [Char]
"Exclusion" [
[Pattern] -> Pattern
list[Pattern
dash_, Pattern
"Iri", Pattern
tilde_]],
[Char] -> [Pattern] -> Production
define [Char]
"Include" [
[Pattern] -> Pattern
list[Pattern
ampersand_, Pattern
"TripleExprLabel"]],
[Char] -> [Pattern] -> Production
define [Char]
"Annotation" [
[Pattern] -> Pattern
list[[Char] -> Pattern
terminal [Char]
"//", Pattern
"Predicate", [Pattern] -> Pattern
alts[Pattern
"Iri", Pattern
"Literal"]]],
[Char] -> [Pattern] -> Production
define [Char]
"SemanticActions" [
Pattern -> Pattern
starPattern
"CodeDecl"],
[Char] -> [Pattern] -> Production
define [Char]
"CodeDecl" [
[Pattern] -> Pattern
list[Pattern
percent_, Pattern
"Iri", [Pattern] -> Pattern
alts[Pattern
"Code", Pattern
percent_]]],
[Char] -> [Pattern] -> Production
define [Char]
"Literal" [
Pattern
"RdfLiteral",
Pattern
"NumericLiteral",
Pattern
"BooleanLiteral"],
[Char] -> [Pattern] -> Production
define [Char]
"Predicate" [
Pattern
"Iri",
Pattern
"RdfType"],
[Char] -> [Pattern] -> Production
define [Char]
"Datatype" [
Pattern
"Iri"],
[Char] -> [Pattern] -> Production
define [Char]
"ShapeExprLabel" [
Pattern
"Iri",
Pattern
"BlankNode"],
[Char] -> [Pattern] -> Production
define [Char]
"TripleExprLabel" [
[Pattern] -> Pattern
list[Pattern
dollar_, [Pattern] -> Pattern
alts[Pattern
"Iri", Pattern
"BlankNode"]]],
[Char] -> [Pattern] -> Production
define [Char]
"NumericLiteral" [
Pattern
"Integer", Pattern
"Decimal", Pattern
"Double"],
[Char] -> [Pattern] -> Production
define [Char]
"RdfLiteral" [
[Pattern] -> Pattern
list[Pattern
"String", Pattern -> Pattern
opt([Pattern] -> Pattern
alts[Pattern
"LangTag", [Pattern] -> Pattern
list[[Char] -> Pattern
terminal [Char]
"^^", Pattern
"Datatype"]])]],
[Char] -> [Pattern] -> Production
define [Char]
"BooleanLiteral" [
Pattern
true_, Pattern
false_],
[Char] -> [Pattern] -> Production
define [Char]
"String" [
Pattern
"StringLiteral1",
Pattern
"StringLiteralLong1",
Pattern
"StringLiteral2",
Pattern
"StringLiteralLong2"],
[Char] -> [Pattern] -> Production
define [Char]
"Iri" [
Pattern
"IriRef",
Pattern
"PrefixedName"],
[Char] -> [Pattern] -> Production
define [Char]
"PrefixedName" [
Pattern
"PnameLn",
Pattern
"PnameNs"],
[Char] -> [Pattern] -> Production
define [Char]
"BlankNode" [
Pattern
"BlankNodeLabel"],
[Char] -> [Pattern] -> Production
define [Char]
"IncludeSet" [
[Pattern] -> Pattern
list[Pattern
ampersand_, Pattern -> Pattern
plusPattern
"ShapeExprLabel"]],
[Char] -> [Pattern] -> Production
define [Char]
"Code" [
[Pattern] -> Pattern
list[Pattern
braceOpen_, Pattern -> Pattern
star([Pattern] -> Pattern
alts[ [Char] -> Pattern
regex [Char]
"[^%\\]", [Pattern] -> Pattern
list[Pattern
doubleFrwSlash_, [Char] -> Pattern
regex [Char]
"[%\\]"], Pattern
"Uchar" ]), Pattern
percent_, Pattern
braceClose_]],
[Char] -> [Pattern] -> Production
define [Char]
"RepeatRange" [
[Pattern] -> Pattern
list[Pattern
braceOpen_, Pattern
"Integer", Pattern -> Pattern
opt([Pattern] -> Pattern
list[Pattern
coma_, Pattern -> Pattern
opt(Pattern -> Pattern
opt([Pattern] -> Pattern
alts[Pattern
"Integer", Pattern
star_]))]), Pattern
braceClose_]],
[Char] -> [Pattern] -> Production
define [Char]
"RdfType" [
[Char] -> Pattern
terminal [Char]
"a"],
[Char] -> [Pattern] -> Production
define [Char]
"IriRef" [
[Pattern] -> Pattern
list[[Char] -> Pattern
terminal [Char]
"<", Pattern -> Pattern
star([Pattern] -> Pattern
alts[ [Char] -> Pattern
regex [Char]
"[^#x00-#x20<>\"{}|^`\\]", Pattern
"Uchar"]), [Char] -> Pattern
terminal [Char]
">"]],
[Char] -> [Pattern] -> Production
define [Char]
"PnameNs" [
[Pattern] -> Pattern
list[Pattern -> Pattern
optPattern
"PnPrefix", Pattern
semicolon_]],
[Char] -> [Pattern] -> Production
define [Char]
"PnameLn" [
[Pattern] -> Pattern
list[Pattern
"PnameNs", Pattern
"PnLocal"]],
[Char] -> [Pattern] -> Production
define [Char]
"AtpNameNs" [
[Pattern] -> Pattern
list[Pattern
at_, Pattern -> Pattern
optPattern
"PnPrefix", Pattern
colon_]],
[Char] -> [Pattern] -> Production
define [Char]
"AtpNameLn" [
[Pattern] -> Pattern
list[Pattern
at_, Pattern
"PnameNs", Pattern
"PnLocal"]],
[Char] -> [Pattern] -> Production
define [Char]
"Regexp" [
[Pattern] -> Pattern
list[[Char] -> Pattern
terminal [Char]
"~/", Pattern -> Pattern
star([Pattern] -> Pattern
alts[
[Char] -> Pattern
regex [Char]
"[^#x2f#x5C#xA#xD]",
[Pattern] -> Pattern
list[[Char] -> Pattern
terminal [Char]
"\\", [Char] -> Pattern
regex [Char]
"[tbnrf\\/]"], Pattern
"Uchar"]),
[Char] -> Pattern
terminal [Char]
"/", Pattern -> Pattern
star( [Char] -> Pattern
regex [Char]
"[smix]")
]],
[Char] -> [Pattern] -> Production
define [Char]
"BlankNodeLabel" [
[Pattern] -> Pattern
list[[Char] -> Pattern
terminal [Char]
"_:", [Pattern] -> Pattern
alts[Pattern
"PnCharsU", [Char] -> Pattern
regex [Char]
"[0-9]"], Pattern -> Pattern
opt(Pattern -> Pattern
star([Pattern] -> Pattern
alts[Pattern
"PnChars", Pattern
period_])),Pattern
"PnChars"]],
[Char] -> [Pattern] -> Production
define [Char]
"LangTag" [
[Char] -> Pattern
regex [Char]
"@[a-zA-Z]+('-'[a-zA-Z0-9]+)*"],
[Char] -> [Pattern] -> Production
define [Char]
"Integer" [
[Char] -> Pattern
regex [Char]
"[+-]? [0-9]+"],
[Char] -> [Pattern] -> Production
define [Char]
"Decimal" [
[Char] -> Pattern
regex [Char]
"[+-]? [0-9]*\\.[0-9]+"],
[Char] -> [Pattern] -> Production
define [Char]
"Double" [
[Char] -> Pattern
regex [Char]
"([+-]?([0-9]+)?\\.[0-9]*[eE][+-]?[0-9]+"],
[Char] -> [Pattern] -> Production
define [Char]
"StringLiteral1" [
[Pattern] -> Pattern
list[Pattern
singleQuote_, Pattern -> Pattern
star([Pattern] -> Pattern
alts[[Char] -> Pattern
regex [Char]
"[^#x27#x5C#xA#xD]", Pattern
"Echar", Pattern
"Uchar"]), Pattern
singleQuote_]],
[Char] -> [Pattern] -> Production
define [Char]
"StringLiteral2" [
[Pattern] -> Pattern
list[Pattern
doubleQuote_, Pattern -> Pattern
star([Pattern] -> Pattern
alts[[Char] -> Pattern
regex [Char]
"[^#x22#x5C#xA#xD]", Pattern
"Echar", Pattern
"Uchar"]), Pattern
doubleQuote_]],
[Char] -> [Pattern] -> Production
define [Char]
"StringLiteralLong1" [
[Pattern] -> Pattern
list[Pattern
singleQuote_, Pattern
singleQuote_, Pattern
singleQuote_,
Pattern -> Pattern
star([Pattern] -> Pattern
alts[[Pattern] -> Pattern
list[ Pattern -> Pattern
opt([Pattern] -> Pattern
alts[Pattern
singleQuote_, [Pattern] -> Pattern
list[Pattern
singleQuote_,Pattern
singleQuote_]]), [Char] -> Pattern
regex [Char]
"[^\'\\]"], Pattern
"Echar", Pattern
"Uchar"]),
Pattern
singleQuote_, Pattern
singleQuote_, Pattern
singleQuote_]],
[Char] -> [Pattern] -> Production
define [Char]
"StringLiteralLong2" [
[Pattern] -> Pattern
list[Pattern
doubleQuote_, Pattern
doubleQuote_, Pattern
doubleQuote_,
Pattern -> Pattern
star([Pattern] -> Pattern
alts[[Pattern] -> Pattern
list[ Pattern -> Pattern
opt([Pattern] -> Pattern
alts[Pattern
doubleQuote_, [Pattern] -> Pattern
list[Pattern
doubleQuote_,Pattern
doubleQuote_]]), [Char] -> Pattern
regex [Char]
"[^\"\\]"], Pattern
"Echar", Pattern
"Uchar"]),
Pattern
doubleQuote_, Pattern
doubleQuote_, Pattern
doubleQuote_]],
[Char] -> [Pattern] -> Production
define [Char]
"Uchar" [
[Pattern] -> Pattern
list[[Char] -> Pattern
terminal [Char]
"\\u", Pattern
"Hex", Pattern
"Hex", Pattern
"Hex", Pattern
"Hex"],
[Pattern] -> Pattern
list[[Char] -> Pattern
terminal [Char]
"\\U", Pattern
"Hex", Pattern
"Hex", Pattern
"Hex", Pattern
"Hex", Pattern
"Hex", Pattern
"Hex", Pattern
"Hex", Pattern
"Hex"]],
[Char] -> [Pattern] -> Production
define [Char]
"Echar" [
[Pattern] -> Pattern
list[Pattern
doubleFrwSlash_, [Char] -> Pattern
regex [Char]
"[tbnrf\\\"\']"]],
[Char] -> [Pattern] -> Production
define [Char]
"PnCharsBase" [
[Char] -> Pattern
regex [Char]
"[A-Z]",
[Char] -> Pattern
regex [Char]
"[a-z]"],
[Char] -> [Pattern] -> Production
define [Char]
"PnCharsU" [
Pattern
"PnCharsBase",
Pattern
underscore_],
[Char] -> [Pattern] -> Production
define [Char]
"PnChars" [
Pattern
"PnCharsU",
Pattern
dash_,
[Char] -> Pattern
regex [Char]
"0-9"],
[Char] -> [Pattern] -> Production
define [Char]
"PnPrefix" [
[Pattern] -> Pattern
list[Pattern
"PnCharsBase",
Pattern -> Pattern
opt([Pattern] -> Pattern
list[[Pattern] -> Pattern
alts[Pattern
"PnChars", Pattern
period_],Pattern
"PnChars"])]],
[Char] -> [Pattern] -> Production
define [Char]
"PnLocal" [
[Pattern] -> Pattern
list[
[Pattern] -> Pattern
alts[Pattern
"PnCharsU", Pattern
colon_, [Char] -> Pattern
regex [Char]
"0-9", Pattern
"Plx"],
Pattern -> Pattern
opt([Pattern] -> Pattern
list[
Pattern -> Pattern
star([Pattern] -> Pattern
alts[Pattern
"PnChars", Pattern
period_, Pattern
colon_, Pattern
"Plx"]),
[Pattern] -> Pattern
alts[Pattern
"PnChars", Pattern
colon_, Pattern
"Plx"]]
)]],
[Char] -> [Pattern] -> Production
define [Char]
"Plx" [
Pattern
"Percent",
Pattern
"PnLocalEsc"],
[Char] -> [Pattern] -> Production
define [Char]
"Percent" [
[Pattern] -> Pattern
list[Pattern
percent_, Pattern
"Hex", Pattern
"Hex"]],
[Char] -> [Pattern] -> Production
define [Char]
"Hex" [[Char] -> Pattern
regex [Char]
"[0-9][A-F][a-f]"],
[Char] -> [Pattern] -> Production
define [Char]
"PnLocalEsc" [
[Pattern] -> Pattern
list[Pattern
doubleFrwSlash_, [Char] -> Pattern
regex [Char]
"[_~\\.-!$&'\\(\\)\\*+,;=/\\?#@%]"]]]