-
Notifications
You must be signed in to change notification settings - Fork 12
Annotation
JonathanO edited this page Jun 2, 2012
·
12 revisions
The annotation library allows parsing of "annotation" like statements out of docblocks.
(using w3c XML style EBNFish)
DocAnnotation ::= Annotation S;
Annotation ::= "@" ClassName ("(" Parameters ")")?;
Parameters ::= S* Parameter S* ("," S* Parameter S*)*;
Parameter ::= (QuotedString | Integer | Bool | Float | Annotation | Array);
QuotedString ::= "\"" (NotQuotes | "\"\"")* "\"";
Integer ::= ("+" | "-")? Digits+;
Float ::= ("+" | "-")? Digits+ ( "." Digits+ )? ( ( "e" | "E" ) ( "+" | "-" ) Digits+)?;
Array ::= "{" Parameters "}";
ClassName ::= '\'? Identifier ("\", Identifier)*;
Identifier ::= [a-zA-Z_\x7f-\xff] [a-zA-Z0-9_\x7f-\xff]*;
S ::= ? white space characters ? ;
NotQuotes ::= AllCharacters - "\"";
AllCharacters ::= ? all visible characters ? ;
Digits ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;