phpdoc-parser/doc/grammars/type.ebnf

29 lines
384 B
EBNF
Raw Normal View History

2017-07-10 15:16:28 +02:00
Type
::= Atomic (Union | Intersection)?
2017-10-27 21:33:37 +02:00
| Nullable
2017-07-10 15:16:28 +02:00
Union
::= ('|' Atomic)+
Intersection
::= ('&' Atomic)+
2017-10-27 21:33:37 +02:00
Nullable
::= '?' Identifier Generic?
2017-07-10 15:16:28 +02:00
Atomic
::= Identifier (Generic | Array)?
| '(' Type ')' Array?
Generic
::= '<' Type (',' Type)* '>'
Array
::= ('[' ']')+
Identifier
::= ('\'? Word)+
Word
::= [a-zA-Z_#x7F-#x10FFFF][0-9a-zA-Z_#x7F-#x10FFFF]*