Chromium Code Reviews
DescriptionClosed; superseded by separate flows CL
Issue 18190004: Add Python flow to bindings generation, move dummy-generating IDL files over
https://codereview.chromium.org/18190004/
Rewrite generate-bindings.pl in Python
This rewrites (and refactors) the bindings generation "driver script"
generate-bindings.pl (i.e., the script that the build actually calls,
which calls the parser and code generator) in Python.
Once this lands, we can start work on the backend!
This also includes:
* a Perl Parser to Python wrapper (via JSON),
so can use the Perl parser in Python
* a stub rewrite of CodeGeneratorV8.pl into Python
code_generator_v8.py is where the bulk of the overall rewrite work will be.
I’ve written just enough so the interface for output functions works, but there’s no content.
The 7 files are:
generate_bindings.py – rewrite of generate-bindings.pl
interface_merger.py – refactored
semantic_analyzer.py – refactored
idl-to-json.pl – Perl Parser to Python wrapper, Perl side
blink_idl_parser_perl.py – Perl Parser to Python wrapper, Python side
code_generator_v8.py – stub
compare-python-to-perl – utility script to compare Perl and Python output
This is a bit long (800+ lines), since it's rewriting the overall script *and*
enough of the dependencies (parser wrapper + stub code generator) that we can
actually run the script.
Some command lines you can use to test include:
Easy wrapper:
./compare-python-to-perl --generate-only BarProp.idl
Directly call key script:
./generate_bindings.py --perl-parser --idl-attributes-file=IDLAttributes.txt --output-directory=test_output ../../../Source/core/page/BarProp.idl
(Does not generate any C++ code – just empty files – but exercises the scripts.)
The wrapper script updates:
http://crrev.com/16185003
BTW, weird diff for idl-to-json.pl is b/c git confused it with:
core/scripts/make_internal_runtime_flags.py
...due to shortness (large copyright relative to size of script means it's viewed as a diff off that one)
BUG=239771
Patch Set 1 #Patch Set 2 : #
Messages
Total messages: 3 (0 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||