Title: [135203] trunk/Source/WebCore
Revision
135203
Author
[email protected]
Date
2012-11-19 15:08:38 -0800 (Mon, 19 Nov 2012)

Log Message

Rename idlDocument::classes to idlDocument::interfaces in the IDL parser
https://bugs.webkit.org/show_bug.cgi?id=102671

Reviewed by Adam Barth.

Most part of code generators use 'interface'. The spec uses 'interface'.
Thus, the IDL parser should use 'interface' instead of 'class'.

No tests. No change in behavior.

* bindings/scripts/CodeGenerator.pm:
(ProcessDocument):
(AddMethodsConstantsAndAttributesFromParentInterfaces):
(ParseInterface):
* bindings/scripts/CodeGeneratorCPP.pm:
(GenerateImplementation):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bindings/scripts/CodeGeneratorObjC.pm:
(GenerateImplementation):
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):
(GenerateFunctionCallback):
* bindings/scripts/IDLParser.pm:
(Parse):
(parseModule):
* bindings/scripts/generate-bindings.pl:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135202 => 135203)


--- trunk/Source/WebCore/ChangeLog	2012-11-19 23:06:40 UTC (rev 135202)
+++ trunk/Source/WebCore/ChangeLog	2012-11-19 23:08:38 UTC (rev 135203)
@@ -1,3 +1,33 @@
+2012-11-19  Kentaro Hara  <[email protected]>
+
+        Rename idlDocument::classes to idlDocument::interfaces in the IDL parser
+        https://bugs.webkit.org/show_bug.cgi?id=102671
+
+        Reviewed by Adam Barth.
+
+        Most part of code generators use 'interface'. The spec uses 'interface'.
+        Thus, the IDL parser should use 'interface' instead of 'class'.
+
+        No tests. No change in behavior.
+
+        * bindings/scripts/CodeGenerator.pm:
+        (ProcessDocument):
+        (AddMethodsConstantsAndAttributesFromParentInterfaces):
+        (ParseInterface):
+        * bindings/scripts/CodeGeneratorCPP.pm:
+        (GenerateImplementation):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        (GenerateImplementation):
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GenerateHeader):
+        (GenerateFunctionCallback):
+        * bindings/scripts/IDLParser.pm:
+        (Parse):
+        (parseModule):
+        * bindings/scripts/generate-bindings.pl:
+
 2012-11-19  Eric Carlson  <[email protected]>
 
         HTMLMediaElement::configureTextTracks should configure all text tracks

Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (135202 => 135203)


--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm	2012-11-19 23:06:40 UTC (rev 135202)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm	2012-11-19 23:08:38 UTC (rev 135203)
@@ -126,17 +126,17 @@
     # Dynamically load external code generation perl module
     $codeGenerator = $ifaceName->new($object, $useOutputDir, $useOutputHeadersDir, $useLayerOnTop, $preprocessor, $writeDependencies, $verbose, $targetIdlFilePath);
     unless (defined($codeGenerator)) {
-        my $classes = $useDocument->classes;
-        foreach my $class (@$classes) {
-            print "Skipping $useGenerator code generation for IDL interface \"" . $class->name . "\".\n" if $verbose;
+        my $interfaces = $useDocument->interfaces;
+        foreach my $interface (@$interfaces) {
+            print "Skipping $useGenerator code generation for IDL interface \"" . $interface->name . "\".\n" if $verbose;
         }
         return;
     }
 
-    my $classes = $useDocument->classes;
-    foreach my $class (@$classes) {
-        print "Generating $useGenerator bindings code for IDL interface \"" . $class->name . "\"...\n" if $verbose;
-        $codeGenerator->GenerateInterface($class, $defines);
+    my $interfaces = $useDocument->interfaces;
+    foreach my $interface (@$interfaces) {
+        print "Generating $useGenerator bindings code for IDL interface \"" . $interface->name . "\"...\n" if $verbose;
+        $codeGenerator->GenerateInterface($interface, $defines);
     }
 }
 
@@ -190,7 +190,7 @@
     &$recurse($dataNode);
 }
 
-sub AddMethodsConstantsAndAttributesFromParentClasses
+sub AddMethodsConstantsAndAttributesFromParentInterfaces
 {
     # Add to $dataNode all of its inherited interface members, except for those
     # inherited through $dataNode's first listed parent.  If an array reference
@@ -297,7 +297,7 @@
     my $parser = IDLParser->new(1);
     my $document = $parser->Parse($filename, $defines, $preprocessor, $parentsOnly);
 
-    foreach my $interface (@{$document->classes}) {
+    foreach my $interface (@{$document->interfaces}) {
         return $interface if $interface->name eq $interfaceName;
     }
 

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm (135202 => 135203)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm	2012-11-19 23:06:40 UTC (rev 135202)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm	2012-11-19 23:08:38 UTC (rev 135203)
@@ -106,7 +106,6 @@
     return $reference;
 }
 
-# Params: 'domClass' struct
 sub GenerateInterface
 {
     my $object = shift;
@@ -596,7 +595,7 @@
     my @ancestorInterfaceNames = ();
 
     if (@{$dataNode->parents} > 1) {
-        $codeGenerator->AddMethodsConstantsAndAttributesFromParentClasses($dataNode, \@ancestorInterfaceNames);
+        $codeGenerator->AddMethodsConstantsAndAttributesFromParentInterfaces($dataNode, \@ancestorInterfaceNames);
     }
 
     my $interfaceName = $dataNode->name;

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (135202 => 135203)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-11-19 23:06:40 UTC (rev 135202)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-11-19 23:08:38 UTC (rev 135203)
@@ -92,7 +92,6 @@
     return (($value << $distance) & 0xFFFFFFFF);
 }
 
-# Params: 'domClass' struct
 sub GenerateInterface
 {
     my $object = shift;
@@ -668,7 +667,7 @@
     # We only support multiple parents with SVG (for now).
     if (@{$dataNode->parents} > 1) {
         die "A class can't have more than one parent" unless $interfaceName =~ /SVG/;
-        $codeGenerator->AddMethodsConstantsAndAttributesFromParentClasses($dataNode, \@ancestorInterfaceNames);
+        $codeGenerator->AddMethodsConstantsAndAttributesFromParentInterfaces($dataNode, \@ancestorInterfaceNames);
     }
 
     my $hasLegacyParent = $dataNode->extendedAttributes->{"JSLegacyParent"};

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm (135202 => 135203)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm	2012-11-19 23:06:40 UTC (rev 135202)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm	2012-11-19 23:08:38 UTC (rev 135203)
@@ -266,7 +266,6 @@
     $interfaceAvailabilityVersion = "WEBKIT_VERSION_LATEST" if $newPublicClass;
 }
 
-# Params: 'domClass' struct
 sub GenerateInterface
 {
     my $object = shift;
@@ -1048,7 +1047,7 @@
     my @ancestorInterfaceNames = ();
 
     if (@{$dataNode->parents} > 1) {
-        $codeGenerator->AddMethodsConstantsAndAttributesFromParentClasses($dataNode, \@ancestorInterfaceNames);
+        $codeGenerator->AddMethodsConstantsAndAttributesFromParentInterfaces($dataNode, \@ancestorInterfaceNames);
     }
 
     my $interfaceName = $dataNode->name;

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (135202 => 135203)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-11-19 23:06:40 UTC (rev 135202)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-11-19 23:08:38 UTC (rev 135203)
@@ -79,7 +79,6 @@
     return $reference;
 }
 
-# Params: 'domClass' struct
 sub GenerateInterface
 {
     my $object = shift;
@@ -274,9 +273,9 @@
     my $interfaceName = $dataNode->name;
     my $v8InterfaceName = "V8$interfaceName";
 
-    # Copy contents of parent classes except the first parent.
+    # Copy contents of parent interfaces except the first parent.
     my @parents;
-    $codeGenerator->AddMethodsConstantsAndAttributesFromParentClasses($dataNode, \@parents, 1);
+    $codeGenerator->AddMethodsConstantsAndAttributesFromParentInterfaces($dataNode, \@parents, 1);
     $codeGenerator->LinkOverloadedFunctions($dataNode);
 
     # Ensure the IsDOMNodeType function is in sync.
@@ -1511,7 +1510,7 @@
     }
 
     # Adding and removing event listeners are not standard callback behavior,
-    # but they are extremely consistent across the various classes that take event listeners,
+    # but they are extremely consistent across the various interfaces that take event listeners,
     # so we can generate them as a "special case".
     if ($name eq "addEventListener") {
         GenerateEventListenerCallback($interfaceName, !$codeGenerator->IsSubType($dataNode, "Node"), "add");

Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (135202 => 135203)


--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm	2012-11-19 23:06:40 UTC (rev 135202)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm	2012-11-19 23:08:38 UTC (rev 135203)
@@ -36,12 +36,12 @@
 # Used to represent a parsed IDL document
 struct( idlDocument => {
     module => '$',   # Module identifier
-    classes => '@',  # All parsed interfaces
+    interfaces => '@',  # All parsed interfaces
     fileName => '$'  # file name
 });
 
 # Used to represent 'interface' blocks
-struct( domClass => {
+struct( domInterface => {
     name => '$',      # Class identifier (without module)
     parents => '@',      # List of strings
     constants => '@',    # List of 'domConstant'
@@ -52,7 +52,7 @@
     isException => '$', # Used for exception interfaces
 });
 
-# Used to represent domClass contents (name of method, signature)
+# Used to represent domInterface contents (name of method, signature)
 struct( domFunction => {
     isStatic => '$',
     signature => '$',    # Return type/Object name/extended attributes
@@ -60,7 +60,7 @@
     raisesExceptions => '@',  # Possibly raised exceptions.
 });
 
-# Used to represent domClass contents (name of attribute, signature)
+# Used to represent domInterface contents (name of attribute, signature)
 struct( domAttribute => {
     type => '$',              # Attribute type (including namespace)
     isStatic => '$',
@@ -174,7 +174,7 @@
     } else {
         $document = idlDocument->new();
         $document->module("");
-        push(@{$document->classes}, @definitions);
+        push(@{$document->interfaces}, @definitions);
     }
 
     $document->fileName($fileName);
@@ -376,7 +376,7 @@
 
     my $next = $self->nextToken();
     if ($next->value() eq "interface") {
-        my $dataNode = domClass->new();
+        my $dataNode = domInterface->new();
         $self->assertTokenValue($self->getToken(), "interface", __LINE__);
         my $interfaceNameToken = $self->getToken();
         $self->assertTokenType($interfaceNameToken, IdentifierToken);
@@ -576,7 +576,7 @@
 
     my $next = $self->nextToken();
     if ($next->value() eq "exception") {
-        my $dataNode = domClass->new();
+        my $dataNode = domInterface->new();
         $self->assertTokenValue($self->getToken(), "exception", __LINE__);
         my $exceptionNameToken = $self->getToken();
         $self->assertTokenType($exceptionNameToken, IdentifierToken);
@@ -2091,7 +2091,7 @@
         $self->assertTokenValue($self->getToken(), "{", __LINE__);
         $document->module($token->value());
         my $definitions = $self->parseDefinitions();
-        push(@{$document->classes}, @{$definitions});
+        push(@{$document->interfaces}, @{$definitions});
         $self->assertTokenValue($self->getToken(), "}", __LINE__);
         $self->parseOptionalSemicolon();
         return $document;
@@ -2118,7 +2118,7 @@
     my $self = shift;
     my $next = $self->nextToken();
     if ($next->value() eq "interface") {
-        my $dataNode = domClass->new();
+        my $dataNode = domInterface->new();
         $self->assertTokenValue($self->getToken(), "interface", __LINE__);
         my $extendedAttributeList = $self->parseExtendedAttributeListAllowEmpty();
         my $token = $self->getToken();
@@ -2188,7 +2188,7 @@
     my $self = shift;
     my $next = $self->nextToken();
     if ($next->value() eq "exception") {
-        my $dataNode = domClass->new();
+        my $dataNode = domInterface->new();
         $self->assertTokenValue($self->getToken(), "exception", __LINE__);
         my $extendedAttributeList = $self->parseExtendedAttributeListAllowEmpty();
         my $token = $self->getToken();

Modified: trunk/Source/WebCore/bindings/scripts/generate-bindings.pl (135202 => 135203)


--- trunk/Source/WebCore/bindings/scripts/generate-bindings.pl	2012-11-19 23:06:40 UTC (rev 135202)
+++ trunk/Source/WebCore/bindings/scripts/generate-bindings.pl	2012-11-19 23:08:38 UTC (rev 135203)
@@ -137,12 +137,12 @@
     my $parser = IDLParser->new(!$verbose);
     my $document = $parser->Parse($idlFile, $defines, $preprocessor);
 
-    foreach my $dataNode (@{$document->classes}) {
+    foreach my $dataNode (@{$document->interfaces}) {
         if ($dataNode->extendedAttributes->{"Supplemental"} and $dataNode->extendedAttributes->{"Supplemental"} eq $targetInterfaceName) {
             my $targetDataNode;
-            foreach my $class (@{$targetDocument->classes}) {
-                if ($class->name eq $targetInterfaceName) {
-                    $targetDataNode = $class;
+            foreach my $interface (@{$targetDocument->interfaces}) {
+                if ($interface->name eq $targetInterfaceName) {
+                    $targetDataNode = $interface;
                     last;
                 }
             }

Modified: trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl (135202 => 135203)


--- trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl	2012-11-19 23:06:40 UTC (rev 135202)
+++ trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl	2012-11-19 23:08:38 UTC (rev 135203)
@@ -80,7 +80,7 @@
     $supplementals{$idlFile} = [];
 }
 foreach my $idlFile (keys %documents) {
-    foreach my $dataNode (@{$documents{$idlFile}->classes}) {
+    foreach my $dataNode (@{$documents{$idlFile}->interfaces}) {
         if ($dataNode->extendedAttributes->{"Supplemental"}) {
             my $targetIdlFile = $interfaceNameToIdlFile{$dataNode->extendedAttributes->{"Supplemental"}};
             push(@{$supplementals{$targetIdlFile}}, $idlFile);
@@ -168,7 +168,7 @@
     my $document = shift;
     my $idlFile = shift;
 
-    foreach my $dataNode (@{$document->classes}) {
+    foreach my $dataNode (@{$document->interfaces}) {
         checkIfIDLAttributesExists($idlAttributes, $dataNode->extendedAttributes, $idlFile);
 
         foreach my $attribute (@{$dataNode->attributes}) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to