⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 98766 in webkit


Ignore:
Timestamp:
Oct 28, 2011, 2:46:17 PM (15 years ago)
Author:
adamk@chromium.org
Message:

Remove unused parsers for 'exception' and 'alias' IDL keywords
https://bugs.webkit.org/show_bug.cgi?id=71140

Reviewed by Adam Barth.

  • bindings/scripts/IDLParser.pm:

(ParseInterface):
(DetermineParseMode):
(ProcessSection):

  • bindings/scripts/IDLStructure.pm:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r98765 r98766  
     12011-10-28  Adam Klein  <adamk@chromium.org>
     2
     3        Remove unused parsers for 'exception' and 'alias' IDL keywords
     4        https://bugs.webkit.org/show_bug.cgi?id=71140
     5
     6        Reviewed by Adam Barth.
     7
     8        * bindings/scripts/IDLParser.pm:
     9        (ParseInterface):
     10        (DetermineParseMode):
     11        (ProcessSection):
     12        * bindings/scripts/IDLStructure.pm:
     13
    1142011-10-28  Dan Bernstein  <mitz@apple.com>
    215
  • trunk/Source/WebCore/bindings/scripts/IDLParser.pm

    r94156 r98766  
    3333use constant MODE_MODULE  => 10; # 'module' section
    3434use constant MODE_INTERFACE  => 11; # 'interface' section
    35 use constant MODE_EXCEPTION  => 12; # 'exception' section
    36 use constant MODE_ALIAS    => 13; # 'alias' section
    3735
    3836# Helper variables
     
    237235
    238236    # Beginning of the regexp parsing magic
    239     if ($sectionName eq "exception") {
    240         print " |- Trying to parse exception...\n" unless $beQuiet;
    241 
    242         my $exceptionName = "";
    243         my $exceptionData = "";
    244         my $exceptionDataName = "";
    245         my $exceptionDataType = "";
    246 
    247         # Match identifier of the exception, and enclosed data...
    248         $data =~ /$IDLStructure::exceptionSelector/;
    249         $exceptionName = (defined($1) ? $1 : die("Parsing error!\nSource:\n$data\n)"));
    250         $exceptionData = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)"));
    251 
    252         ('' =~ /^/); # Reset variables needed for regexp matching
    253 
    254         # ... parse enclosed data (get. name & type)
    255         $exceptionData =~ /$IDLStructure::exceptionSubSelector/;
    256         $exceptionDataType = (defined($1) ? $1 : die("Parsing error!\nSource:\n$data\n)"));
    257         $exceptionDataName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)"));
    258 
    259         # Fill in domClass datastructure
    260         $dataNode->name($exceptionName);
    261 
    262         my $newDataNode = new domAttribute();
    263         $newDataNode->type("readonly attribute");
    264         $newDataNode->signature(new domSignature());
    265 
    266         $newDataNode->signature->name($exceptionDataName);
    267         $newDataNode->signature->type($exceptionDataType);
    268 
    269         my $arrayRef = $dataNode->attributes;
    270         push(@$arrayRef, $newDataNode);
    271 
    272         print "  |----> Exception; NAME \"$exceptionName\" DATA TYPE \"$exceptionDataType\" DATA NAME \"$exceptionDataName\"\n |-\n |\n" unless $beQuiet;
    273     } elsif ($sectionName eq "interface") {
     237    if ($sectionName eq "interface") {
    274238        print " |- Trying to parse interface...\n" unless $beQuiet;
    275239
     
    416380    } elsif ($_ =~ /interface/) {
    417381        $mode = MODE_INTERFACE;
    418     } elsif ($_ =~ /exception/) {
    419         $mode = MODE_EXCEPTION;
    420     } elsif ($_ =~ /(\A|\b)alias/) {
    421         # The (\A|\b) above is needed so we don't match attributes
    422         # whose names contain the substring "alias".
    423         $mode = MODE_ALIAS;
    424382    }
    425383
     
    443401        my $arrayRef = $document->classes;
    444402        push(@$arrayRef, $node);
    445     } elsif($parseMode eq MODE_EXCEPTION) {
    446         my $node = new domClass();
    447         $object->ParseInterface($node, "exception");
    448 
    449         die ("No module specified! Fatal Error!\n") if ($document eq 0);
    450         my $arrayRef = $document->classes;
    451         push(@$arrayRef, $node);
    452     } elsif($parseMode eq MODE_ALIAS) {
    453         print " |- Trying to parse alias...\n" unless $beQuiet;
    454    
    455         my $line = join("", @temporaryContent);
    456         $line =~ /$IDLStructure::aliasSelector/;
    457 
    458         my $interfaceName = (defined($1) ? $1 : die("Parsing error!\nSource:\n$line\n)"));
    459         my $wrapperName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
    460    
    461         print "  |----> Alias; INTERFACE \"$interfaceName\" WRAPPER \"$wrapperName\"\n |-\n |\n" unless $beQuiet;
    462 
    463         # FIXME: Check if alias is already in aliases
    464         my $aliases = $document->aliases;
    465         $aliases->{$interfaceName} = $wrapperName;
    466403    }
    467404
  • trunk/Source/WebCore/bindings/scripts/IDLStructure.pm

    r98563 r98766  
    3333});
    3434
    35 # Used to represent 'interface' / 'exception' blocks
     35# Used to represent 'interface' blocks
    3636struct( domClass => {
    3737    name => '$',      # Class identifier (without module)
     
    103103our $typeNamespaceSelector = '((?:' . $idlId . '*::)*)\s*(' . $idlDataType . '*)';
    104104
    105 our $exceptionSelector = 'exception\s*(' . $idlIdNs . '*)\s*([a-zA-Z\s{;]*};)';
    106 our $exceptionSubSelector = '{\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*;\s*}';
    107 
    108105our $interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([-a-zA-Z0-9_"=\s(),;:\[\]&\|]*)';
    109106our $interfaceMethodSelector = '\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)\s*\(\s*([a-zA-Z0-9:\s,=\[\]]*)';
Note: See TracChangeset for help on using the changeset viewer.