| OLD | NEW |
| 1 # | 1 # |
| 2 # KDOM IDL parser | 2 # KDOM IDL parser |
| 3 # | 3 # |
| 4 # Copyright (C) 2005 Nikolas Zimmermann <wildfox@kde.org> | 4 # Copyright (C) 2005 Nikolas Zimmermann <wildfox@kde.org> |
| 5 # | 5 # |
| 6 # This library is free software; you can redistribute it and/or | 6 # This library is free software; you can redistribute it and/or |
| 7 # modify it under the terms of the GNU Library General Public | 7 # modify it under the terms of the GNU Library General Public |
| 8 # License as published by the Free Software Foundation; either | 8 # License as published by the Free Software Foundation; either |
| 9 # version 2 of the License, or (at your option) any later version. | 9 # version 2 of the License, or (at your option) any later version. |
| 10 # | 10 # |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 struct( domInterface => { | 44 struct( domInterface => { |
| 45 name => '$', # Class identifier | 45 name => '$', # Class identifier |
| 46 parents => '@', # List of strings | 46 parents => '@', # List of strings |
| 47 constants => '@', # List of 'domConstant' | 47 constants => '@', # List of 'domConstant' |
| 48 functions => '@', # List of 'domFunction' | 48 functions => '@', # List of 'domFunction' |
| 49 attributes => '@', # List of 'domAttribute' | 49 attributes => '@', # List of 'domAttribute' |
| 50 extendedAttributes => '$', # Extended attributes | 50 extendedAttributes => '$', # Extended attributes |
| 51 constructors => '@', # Constructors, list of 'domFunction' | 51 constructors => '@', # Constructors, list of 'domFunction' |
| 52 customConstructors => '@', # Custom constructors, list of 'domFunction' | 52 customConstructors => '@', # Custom constructors, list of 'domFunction' |
| 53 isException => '$', # Used for exception interfaces | 53 isException => '$', # Used for exception interfaces |
| 54 isCallback => '$', # Used for callback interfaces |
| 54 }); | 55 }); |
| 55 | 56 |
| 56 # Used to represent domInterface contents (name of method, signature) | 57 # Used to represent domInterface contents (name of method, signature) |
| 57 struct( domFunction => { | 58 struct( domFunction => { |
| 58 isStatic => '$', | 59 isStatic => '$', |
| 59 signature => '$', # Return type/Object name/extended attributes | 60 signature => '$', # Return type/Object name/extended attributes |
| 60 parameters => '@', # List of 'domSignature' | 61 parameters => '@', # List of 'domSignature' |
| 61 }); | 62 }); |
| 62 | 63 |
| 63 # Used to represent domInterface contents (name of attribute, signature) | 64 # Used to represent domInterface contents (name of attribute, signature) |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 $self->assertUnexpectedToken($next->value(), __LINE__); | 464 $self->assertUnexpectedToken($next->value(), __LINE__); |
| 464 } | 465 } |
| 465 | 466 |
| 466 sub parseCallbackRestOrInterface | 467 sub parseCallbackRestOrInterface |
| 467 { | 468 { |
| 468 my $self = shift; | 469 my $self = shift; |
| 469 my $extendedAttributeList = shift; | 470 my $extendedAttributeList = shift; |
| 470 | 471 |
| 471 my $next = $self->nextToken(); | 472 my $next = $self->nextToken(); |
| 472 if ($next->value() eq "interface") { | 473 if ($next->value() eq "interface") { |
| 473 return $self->parseInterface($extendedAttributeList); | 474 my $interface = $self->parseInterface($extendedAttributeList); |
| 475 $interface->isCallback(1); |
| 476 return $interface; |
| 474 } | 477 } |
| 475 if ($next->type() == IdentifierToken) { | 478 if ($next->type() == IdentifierToken) { |
| 476 return $self->parseCallbackRest($extendedAttributeList); | 479 return $self->parseCallbackRest($extendedAttributeList); |
| 477 } | 480 } |
| 478 $self->assertUnexpectedToken($next->value(), __LINE__); | 481 $self->assertUnexpectedToken($next->value(), __LINE__); |
| 479 } | 482 } |
| 480 | 483 |
| 481 sub parseInterface | 484 sub parseInterface |
| 482 { | 485 { |
| 483 my $self = shift; | 486 my $self = shift; |
| (...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2203 $customConstructor->{overloadedIndex} = $index++; | 2206 $customConstructor->{overloadedIndex} = $index++; |
| 2204 push(@{$interface->customConstructors}, $customConstructor); | 2207 push(@{$interface->customConstructors}, $customConstructor); |
| 2205 } | 2208 } |
| 2206 delete $extendedAttributeList->{"CustomConstructors"}; | 2209 delete $extendedAttributeList->{"CustomConstructors"}; |
| 2207 $extendedAttributeList->{"CustomConstructor"} = "VALUE_IS_MISSING"; | 2210 $extendedAttributeList->{"CustomConstructor"} = "VALUE_IS_MISSING"; |
| 2208 } | 2211 } |
| 2209 $interface->extendedAttributes($extendedAttributeList); | 2212 $interface->extendedAttributes($extendedAttributeList); |
| 2210 } | 2213 } |
| 2211 | 2214 |
| 2212 1; | 2215 1; |
| OLD | NEW |