| OLD | NEW |
| 1 #!/usr/bin/perl -w | 1 #!/usr/bin/perl -w |
| 2 # | 2 # |
| 3 # Copyright (C) 2005 Apple Computer, Inc. | 3 # Copyright (C) 2005 Apple Computer, Inc. |
| 4 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> | 4 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> |
| 5 # | 5 # |
| 6 # This file is part of WebKit | 6 # This file is part of WebKit |
| 7 # | 7 # |
| 8 # This library is free software; you can redistribute it and/or | 8 # This library is free software; you can redistribute it and/or |
| 9 # modify it under the terms of the GNU Library General Public | 9 # modify it under the terms of the GNU Library General Public |
| 10 # License as published by the Free Software Foundation; either | 10 # License as published by the Free Software Foundation; either |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 use strict; | 31 use strict; |
| 32 | 32 |
| 33 use File::Path; | 33 use File::Path; |
| 34 use File::Basename; | 34 use File::Basename; |
| 35 use Getopt::Long; | 35 use Getopt::Long; |
| 36 use Text::ParseWords; | 36 use Text::ParseWords; |
| 37 use Cwd; | 37 use Cwd; |
| 38 | 38 |
| 39 use IDLParser; | 39 use IDLParser; |
| 40 use CodeGeneratorV8; | 40 use CodeGeneratorV8; |
| 41 use IDLSerializer; |
| 41 | 42 |
| 42 my @idlDirectories; | 43 my @idlDirectories; |
| 43 my $outputDirectory; | 44 my $outputDirectory; |
| 44 my $outputHeadersDirectory; | 45 my $outputHeadersDirectory; |
| 45 my $defines; | 46 my $defines; |
| 46 my $filename; | 47 my $filename; |
| 47 my $preprocessor; | 48 my $preprocessor; |
| 48 my $verbose; | 49 my $verbose; |
| 49 my $supplementalDependencyFile; | 50 my $supplementalDependencyFile; |
| 50 my $additionalIdlFiles; | 51 my $additionalIdlFiles; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 $constant->extendedAttributes->{$extendedAttributeName} = $i
nterface->extendedAttributes->{$extendedAttributeName}; | 178 $constant->extendedAttributes->{$extendedAttributeName} = $i
nterface->extendedAttributes->{$extendedAttributeName}; |
| 178 } | 179 } |
| 179 push(@{$targetDataNode->constants}, $constant); | 180 push(@{$targetDataNode->constants}, $constant); |
| 180 } | 181 } |
| 181 } else { | 182 } else { |
| 182 die "$idlFile is not a supplemental dependency of $targetIdlFile. Th
ere maybe a bug in the the supplemental dependency generator (preprocess_idls.py
).\n"; | 183 die "$idlFile is not a supplemental dependency of $targetIdlFile. Th
ere maybe a bug in the the supplemental dependency generator (preprocess_idls.py
).\n"; |
| 183 } | 184 } |
| 184 } | 185 } |
| 185 } | 186 } |
| 186 | 187 |
| 188 # FIXME: This code will be removed once IDLParser.pm and CodeGeneratorV8.pm |
| 189 # are connected via JSON files. See http://crbug.com/242795 |
| 190 $targetDocument = deserializeJSON(serializeJSON($targetDocument)); |
| 191 |
| 187 # Generate desired output for the target IDL file. | 192 # Generate desired output for the target IDL file. |
| 188 my @dependentIdlFiles = ($targetDocument->fileName(), @supplementedIdlFiles); | 193 my @dependentIdlFiles = ($targetDocument->fileName(), @supplementedIdlFiles); |
| 189 my $codeGenerator = CodeGeneratorV8->new($targetDocument, \@idlDirectories, $pre
processor, $defines, $verbose, \@dependentIdlFiles, $writeFileOnlyIfChanged); | 194 my $codeGenerator = CodeGeneratorV8->new($targetDocument, \@idlDirectories, $pre
processor, $defines, $verbose, \@dependentIdlFiles, $writeFileOnlyIfChanged); |
| 190 my $interfaces = $targetDocument->interfaces; | 195 my $interfaces = $targetDocument->interfaces; |
| 191 foreach my $interface (@$interfaces) { | 196 foreach my $interface (@$interfaces) { |
| 192 print "Generating bindings code for IDL interface \"" . $interface->name . "
\"...\n" if $verbose; | 197 print "Generating bindings code for IDL interface \"" . $interface->name . "
\"...\n" if $verbose; |
| 193 $codeGenerator->GenerateInterface($interface); | 198 $codeGenerator->GenerateInterface($interface); |
| 194 $codeGenerator->WriteData($interface, $outputDirectory, $outputHeadersDirect
ory); | 199 $codeGenerator->WriteData($interface, $outputDirectory, $outputHeadersDirect
ory); |
| 195 } | 200 } |
| 196 | 201 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 last OUTER; | 296 last OUTER; |
| 292 } | 297 } |
| 293 } | 298 } |
| 294 } | 299 } |
| 295 if ($error) { | 300 if ($error) { |
| 296 die "IDL ATTRIBUTE CHECKER ERROR: $error | 301 die "IDL ATTRIBUTE CHECKER ERROR: $error |
| 297 If you want to add a new IDL attribute, you need to add it to bindings/scripts/I
DLAttributes.txt and add explanations to the Blink IDL document (http://chromium
.org/blink/webidl). | 302 If you want to add a new IDL attribute, you need to add it to bindings/scripts/I
DLAttributes.txt and add explanations to the Blink IDL document (http://chromium
.org/blink/webidl). |
| 298 "; | 303 "; |
| 299 } | 304 } |
| 300 } | 305 } |
| OLD | NEW |