|
learn about yacker
yacker: Create a grammar
Input a grammar to test:
Grammar name:
Overwrite existing grammar:
(Please be polite about changing grammars.)
Grammar BNF:
[1g] trigDoc ::= (statement)* [2g] statement ::= directive "." | graph [3g] graph ::= graphIri? "{" (triples ".")* "}" [4g] graphIri ::= IRIref # Remaining from Turtle [3] directive ::= prefixID | base [4] prefixID ::= PREFIX PNAME_NS IRI_REF [5] base ::= BASE IRI_REF [6] triples ::= subject predicateObjectList [7] predicateObjectList ::= verb objectList ( ";" verb objectList )* (";")? [8] objectList ::= object ( "," object )* [9] verb ::= predicate | "a" [10] subject ::= IRIref | blank [11] predicate ::= IRIref [12] object ::= IRIref | blank | literal [13] literal ::= RDFLiteral | NumericLiteral | BooleanLiteral [14] blank ::= BlankNode | blankNodePropertyList | collection [15] blankNodePropertyList ::= "[" predicateObjectList "]" [16] collection ::= "(" object* ")" [60s] RDFLiteral ::= String ( LANGTAG | ( "^^" IRIref ) )? [61s] NumericLiteral ::= NumericLiteralUnsigned | NumericLiteralPositive | NumericLiteralNegative [62s] NumericLiteralUnsigned ::= INTEGER | DECIMAL | DOUBLE [63s] NumericLiteralPositive ::= INTEGER_POSITIVE | DECIMAL_POSITIVE | DOUBLE_POSITIVE [64s] NumericLiteralNegative ::= INTEGER_NEGATIVE | DECIMAL_NEGATIVE | DOUBLE_NEGATIVE [65s] BooleanLiteral ::= "true" | "false" [66s] String ::= STRING_LITERAL1 | STRING_LITERAL2 | STRING_LITERAL_LONG1 | STRING_LITERAL_LONG2 [67s] IRIref ::= IRI_REF | PrefixedName [68s] PrefixedName ::= PNAME_LN | PNAME_NS [69s] BlankNode ::= BLANK_NODE_LABEL | ANON @terminals [17] BASE ::= "@base" [18] PREFIX ::= "@prefix" #[70s] IRI_REF ::= "<" ( [^<>\"{}|^`\\] - [#0000- ] | UCHAR )* ">" [70s] IRI_REF ::= "<" ( [^<>\"{}|^`\\] - [#x00-#x20] | UCHAR )* ">" [71s] PNAME_NS ::= (PN_PREFIX)? ":" [72s] PNAME_LN ::= PNAME_NS PN_LOCAL [73s] BLANK_NODE_LABEL ::= "_:" PN_LOCAL [76s] LANGTAG ::= BASE | PREFIX | "@" [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )* [77s] INTEGER ::= [0-9]+ [78s] DECIMAL ::= [0-9]+ "." [0-9]+ | "." [0-9]+ [79s] DOUBLE ::= [0-9]+ "." [0-9]+ EXPONENT | "." ( [0-9] )+ EXPONENT | ( [0-9] )+ EXPONENT [80s] INTEGER_POSITIVE ::= "+" INTEGER [81s] DECIMAL_POSITIVE ::= "+" DECIMAL [82s] DOUBLE_POSITIVE ::= "+" DOUBLE [83s] INTEGER_NEGATIVE ::= "-" INTEGER [84s] DECIMAL_NEGATIVE ::= "-" DECIMAL [85s] DOUBLE_NEGATIVE ::= "-" DOUBLE [86s] EXPONENT ::= [eE] [+-]? [0-9]+ [87s] STRING_LITERAL1 ::= "'" ( ( [^'\\\n\r] ) | ECHAR | UCHAR )* "'" [88s] STRING_LITERAL2 ::= '"' ( ( [^\"\\\n\r] ) | ECHAR | UCHAR )* '"' [89s] STRING_LITERAL_LONG1 ::= "'''" ( ( "'" | "''" )? ( [^'\\] | ECHAR | UCHAR ) )* "'''" [90s] STRING_LITERAL_LONG2 ::= '"""' ( ( '"' | '""' )? ( [^\"\\] | ECHAR | UCHAR ) )* '"""' [19] UCHAR ::= ( "\\u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] ) | ( "\\U" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] ) [91s] ECHAR ::= "\\" [tbnrf\\\"'] [92s] NIL ::= "(" (WS)* ")" [93s] WS ::= " " | "\t" | "\r" | "\n" [94s] ANON ::= "[" (WS)* "]" [95s] PN_CHARS_BASE ::= [A-Z] | [a-z] | [#00C0-#00D6] | [#00D8-#00F6] | [#00F8-#02FF] | [#0370-#037D] | [#037F-#1FFF] | [#200C-#200D] | [#2070-#218F] | [#2C00-#2FEF] | [#3001-#D7FF] | [#F900-#FDCF] | [#FDF0-#FFFD] | [#10000-#EFFFF] | UCHAR [96s] PN_CHARS_U ::= PN_CHARS_BASE | "_" [98s] PN_CHARS ::= PN_CHARS_U | "-" | [0-9] | #00B7 | [#0300-#036F] | [#203F-#2040] [99s] PN_PREFIX ::= PN_CHARS_BASE ( ( PN_CHARS | "." )* PN_CHARS )? [100s] PN_LOCAL ::= ( PN_CHARS_U | [0-9] ) ( ( PN_CHARS | "." )* PN_CHARS )? @pass ::= [ \t\r\n]+ | "#" [^\r\n]*
generate grammar in
Perl
C
C++
Python
.
generate
descriptive
terse
names.
or
list existing parsers
.
Eric Prud'hommeaux
<eric+yacker@w3.org>
$Id: yacker,v 1.82 2008/04/12 04:10:11 eric Exp $
$Id: Presenter.pm,v 1.39 2007/12/21 09:35:46 eric Exp $