phpdoc-parser/doc/grammars/type.peg
2017-10-27 21:37:29 +02:00

29 lines
358 B
Plaintext

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