phpdoc-parser/doc/grammer.peg
2017-10-27 21:22:33 +02:00

25 lines
307 B
Plaintext

Type
= Atomic (Union / Intersection)?
Union
= ('|' Atomic)+
Intersection
= ('&' Atomic)+
Atomic
= Identifier (Generic / Array)?
/ '(' Type ')' Array?
Generic
= '<' Type (',' Type)* '>'
Array
= ('[' ']')+
Identifier
= ('\'? Word)+
Word
= [a-zA-Z_\127-\255\\][a-zA-Z0-9_\127-\255\\]*