diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-01 13:48:41 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-02 00:54:54 (GMT) |
commit | ecd07750a74111ed9ef65a7439ddccc065c5dadc (patch) | |
tree | 96422a2eca0a2ad2900027ee34df251a7a96890b /src/declarative/qml/parser/qmljs.g | |
parent | 5118020e63f5e634a74082c417362d735a7a2303 (diff) | |
download | Qt-ecd07750a74111ed9ef65a7439ddccc065c5dadc.zip Qt-ecd07750a74111ed9ef65a7439ddccc065c5dadc.tar.gz Qt-ecd07750a74111ed9ef65a7439ddccc065c5dadc.tar.bz2 |
Add parameterized synthesized signals
Also changed syntax for emitting a signal to be consistent with normal QtScript.
Diffstat (limited to 'src/declarative/qml/parser/qmljs.g')
-rw-r--r-- | src/declarative/qml/parser/qmljs.g | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/declarative/qml/parser/qmljs.g b/src/declarative/qml/parser/qmljs.g index ed5f653..c7952e2 100644 --- a/src/declarative/qml/parser/qmljs.g +++ b/src/declarative/qml/parser/qmljs.g @@ -254,6 +254,7 @@ public: AST::UiProgram *UiProgram; AST::UiImportList *UiImportList; AST::UiImport *UiImport; + AST::UiParameterList *UiParameterList; AST::UiPublicMember *UiPublicMember; AST::UiObjectDefinition *UiObjectDefinition; AST::UiObjectInitializer *UiObjectInitializer; @@ -706,6 +707,52 @@ case $rule_number: { UiPropertyType: T_IDENTIFIER ; +UiParameterListOpt: ; +/. +case $rule_number: { + sym(1).Node = 0; +} break; +./ + +UiParameterListOpt: UiParameterList ; +/. +case $rule_number: { + sym(1).Node = sym(1).UiParameterList->finish (); +} break; +./ + +UiParameterList: UiPropertyType JsIdentifier ; +/. +case $rule_number: { + AST::UiParameterList *node = makeAstNode<AST::UiParameterList> (driver->nodePool(), sym(1).sval, sym(2).sval); + node->identifierToken = loc(2); + sym(1).Node = node; +} break; +./ + +UiParameterList: UiParameterList T_COMMA UiPropertyType JsIdentifier ; +/. +case $rule_number: { + AST::UiParameterList *node = makeAstNode<AST::UiParameterList> (driver->nodePool(), sym(1).UiParameterList, sym(3).sval, sym(4).sval); + node->commaToken = loc(2); + node->identifierToken = loc(4); + sym(1).Node = node; +} break; +./ + +UiObjectMember: T_SIGNAL T_IDENTIFIER T_LPAREN UiParameterListOpt T_RPAREN ; +/. +case $rule_number: { + AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (NameId *)0, sym(2).sval); + node->type = AST::UiPublicMember::Signal; + node->propertyToken = loc(1); + node->typeToken = loc(2); + node->identifierToken = loc(3); + node->parameters = sym(4).UiParameterList; + sym(1).Node = node; +} break; +./ + UiObjectMember: T_SIGNAL T_IDENTIFIER ; /. case $rule_number: { |