mirror of
https://github.com/danog/phpdoc-parser.git
synced 2025-01-22 22:01:36 +01:00
50 lines
865 B
Plaintext
50 lines
865 B
Plaintext
ConstantExpr
|
|
= ConstantFloat
|
|
/ ConstantInt
|
|
/ ConstantTrue
|
|
/ ConstantFalse
|
|
/ ConstantNull
|
|
/ ConstantString
|
|
/ ConstantArray
|
|
/ ConstantFetch
|
|
|
|
ConstantFloat
|
|
= '-'? [0-9]+ '.' [0-9]* ConstantFloatExp?
|
|
/ '-'? [0-9]* '.' [0-9]+ ConstantFloatExp?
|
|
/ '-'? [0-9]+ ConstantFloatExp
|
|
|
|
ConstantFloatExp
|
|
= [eE] '-'? [0-9]+
|
|
|
|
ConstantInt
|
|
= '-'? [0-9]+
|
|
|
|
ConstantTrue
|
|
= [tT][rR][uU][eE]
|
|
|
|
ConstantFalse
|
|
= [fF][aA][lL][sS][eE]
|
|
|
|
ConstantNull
|
|
= [nN][uU][lL][lL]
|
|
|
|
ConstantString
|
|
= '\'' ( [^'\\] / '\\' . )* '\''
|
|
/ '"' ( [^"\\] / '\\' . )* '"'
|
|
|
|
ConstantArray
|
|
= '[' ConstantArrayItems? ']'
|
|
/ 'array(' ConstantArrayItems? ')'
|
|
|
|
ConstantArrayItems
|
|
= ConstantArrayItem (',' ConstantArrayItem)* ','?
|
|
|
|
ConstantArrayItem
|
|
= ConstantExpr ('=>' ConstantExpr)?
|
|
|
|
ConstantFetch
|
|
= Identifier '::' Word
|
|
/ Identifier
|
|
|
|
# TODO: ConstantOperation, i.e. ˙2 + 3˙
|