Chromium Code Reviews| Index: Source/bindings/scripts/deprecated_generate_bindings.pl |
| diff --git a/Source/bindings/scripts/generate-bindings.pl b/Source/bindings/scripts/deprecated_generate_bindings.pl |
| similarity index 90% |
| rename from Source/bindings/scripts/generate-bindings.pl |
| rename to Source/bindings/scripts/deprecated_generate_bindings.pl |
| index e1ea014366d7f9b2d2746048ded6fd223eb1dd24..d36a0b177321ba56ceacbca2ec9d7c9470ef9b27 100755 |
| --- a/Source/bindings/scripts/generate-bindings.pl |
| +++ b/Source/bindings/scripts/deprecated_generate_bindings.pl |
| @@ -2,31 +2,24 @@ |
| # |
| # Copyright (C) 2005 Apple Computer, Inc. |
| # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> |
| -# |
| +# |
|
Nils Barth (inactive)
2013/07/09 08:48:16
Presubmit check complained about trailing whitespa
|
| # This file is part of WebKit |
| -# |
| +# |
| # This library is free software; you can redistribute it and/or |
| # modify it under the terms of the GNU Library General Public |
| # License as published by the Free Software Foundation; either |
| # version 2 of the License, or (at your option) any later version. |
| -# |
| +# |
| # This library is distributed in the hope that it will be useful, |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| # Library General Public License for more details. |
| -# |
| +# |
| # You should have received a copy of the GNU Library General Public License |
| # along with this library; see the file COPYING.LIB. If not, write to |
| # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| # Boston, MA 02110-1301, USA. |
| -# |
| - |
| -# This script is a temporary hack. |
| -# Files are generated in the source directory, when they really should go |
| -# to the DerivedSources directory. |
| -# This should also eventually be a build rule driven off of .idl files |
| -# however a build rule only solution is blocked by several radars: |
| -# <rdar://problems/4251781&4251785> |
| +# |
| use strict; |
| @@ -36,14 +29,12 @@ use Getopt::Long; |
| use Text::ParseWords; |
| use Cwd; |
| -use IDLParser; |
| -use CodeGeneratorV8; |
| -use IDLSerializer; |
| +use deprecated_idl_parser; |
| +use deprecated_code_generator_v8; |
| +use deprecated_idl_serializer; |
| my @idlDirectories; |
| my $outputDirectory; |
| -my $defines; |
| -my $filename; |
| my $preprocessor; |
| my $verbose; |
| my $supplementalDependencyFile; |
| @@ -53,8 +44,6 @@ my $writeFileOnlyIfChanged; |
| GetOptions('include=s@' => \@idlDirectories, |
| 'outputDir=s' => \$outputDirectory, |
| - 'defines=s' => \$defines, |
| - 'filename=s' => \$filename, |
| 'preprocessor=s' => \$preprocessor, |
| 'verbose' => \$verbose, |
| 'supplementalDependencyFile=s' => \$supplementalDependencyFile, |
| @@ -66,7 +55,6 @@ my $targetIdlFile = $ARGV[0]; |
| die('Must specify input file.') unless defined($targetIdlFile); |
| die('Must specify output directory.') unless defined($outputDirectory); |
| -$defines = "" unless defined($defines); |
| $targetIdlFile = Cwd::realpath($targetIdlFile); |
| if ($verbose) { |
| @@ -115,8 +103,8 @@ if ($supplementalDependencyFile) { |
| } |
| # Parse the target IDL file. |
| -my $targetParser = IDLParser->new(!$verbose); |
| -my $targetDocument = $targetParser->Parse($targetIdlFile, $defines, $preprocessor); |
| +my $targetParser = deprecated_idl_parser->new(!$verbose); |
| +my $targetDocument = $targetParser->Parse($targetIdlFile, $preprocessor); |
| if ($idlAttributesFile) { |
| my $idlAttributes = loadIDLAttributes($idlAttributesFile); |
| @@ -127,8 +115,8 @@ foreach my $idlFile (@supplementedIdlFiles) { |
| next if $idlFile eq $targetIdlFile; |
| my $interfaceName = fileparse(basename($idlFile), ".idl"); |
| - my $parser = IDLParser->new(!$verbose); |
| - my $document = $parser->Parse($idlFile, $defines, $preprocessor); |
| + my $parser = deprecated_idl_parser->new(!$verbose); |
| + my $document = $parser->Parse($idlFile, $preprocessor); |
| foreach my $interface (@{$document->interfaces}) { |
| if (!$interface->isPartial || $interface->name eq $targetInterfaceName) { |
| @@ -179,13 +167,13 @@ foreach my $idlFile (@supplementedIdlFiles) { |
| } |
| } |
| -# FIXME: This code will be removed once IDLParser.pm and CodeGeneratorV8.pm |
| -# are connected via JSON files. See http://crbug.com/242795 |
| +# Serialize to and from JSON to ensure Perl and Python parsers are equivalent, |
| +# as part of porting compiler to Python. See http://crbug.com/242795 |
| $targetDocument = deserializeJSON(serializeJSON($targetDocument)); |
| # Generate desired output for the target IDL file. |
| my @dependentIdlFiles = ($targetDocument->fileName(), @supplementedIdlFiles); |
| -my $codeGenerator = CodeGeneratorV8->new($targetDocument, \@idlDirectories, $preprocessor, $defines, $verbose, \@dependentIdlFiles, $writeFileOnlyIfChanged); |
| +my $codeGenerator = deprecated_code_generator_v8->new($targetDocument, \@idlDirectories, $preprocessor, $verbose, \@dependentIdlFiles, $writeFileOnlyIfChanged); |
| my $interfaces = $targetDocument->interfaces; |
| foreach my $interface (@$interfaces) { |
| print "Generating bindings code for IDL interface \"" . $interface->name . "\"...\n" if $verbose; |