Skip to content
JonathanO edited this page Jun 2, 2012 · 12 revisions

Annotation

The annotation library allows parsing of "annotation" like statements out of docblocks.

EBNF

(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" ;
Clone this wiki locally