mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
50 lines
763 B
Text
50 lines
763 B
Text
![]() |
grammar QML;
|
||
|
|
||
|
import ECMAScript;
|
||
|
|
||
|
qmlProgram
|
||
|
: qmlHeaderItem* qmlObjectRoot EOF
|
||
|
;
|
||
|
|
||
|
qmlHeaderItem
|
||
|
: qmlImportDeclaration
|
||
|
| qmlPragmaDeclaration
|
||
|
;
|
||
|
|
||
|
qmlImportDeclaration
|
||
|
: 'import' qmlQualifiedId DecimalLiteral ('as' Identifier)? ';'?
|
||
|
| 'import' StringLiteral DecimalLiteral? ('as' Identifier)? ';'?
|
||
|
;
|
||
|
|
||
|
qmlQualifiedId
|
||
|
: Identifier ('.' Identifier)*
|
||
|
;
|
||
|
|
||
|
qmlPragmaDeclaration
|
||
|
: 'pragma' Identifier ';'?
|
||
|
;
|
||
|
|
||
|
qmlObjectRoot
|
||
|
: qmlObjectLiteral?
|
||
|
;
|
||
|
|
||
|
qmlObjectLiteral
|
||
|
: qmlQualifiedId qmlMembers
|
||
|
;
|
||
|
|
||
|
qmlMembers
|
||
|
: '{' qmlMember* '}'
|
||
|
;
|
||
|
|
||
|
qmlMember
|
||
|
: qmlQualifiedId ':' singleExpression
|
||
|
| qmlObjectLiteral
|
||
|
| 'readonly'? 'property' qmlPropertyType Identifier (':' singleExpression)?
|
||
|
| functionDeclaration
|
||
|
;
|
||
|
|
||
|
|
||
|
qmlPropertyType
|
||
|
: Identifier // TODO
|
||
|
| 'var'
|
||
|
;
|