[Webkit-unassigned] [Bug 27410] [Gtk] adding GObject Language bindings auto-generator

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 20 08:33:01 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=27410


Luke Kenneth Casson Leighton <lkcl at lkcl.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|27427, 27430, 27431         |




--- Comment #18 from Luke Kenneth Casson Leighton <lkcl at lkcl.net>  2009-07-20 08:33:00 PDT ---
(In reply to comment #17)
> (From update of attachment 33038 [details])
> > +package CodeGeneratorGObject;
> > +
> > +require "CodeGeneratorGObjectLibrary1.pm";
> 
> This file doesn't exist as far as I can see.  What is it?  Why is it named in
> this manner?

 it contains the remainder of the code which will be reviewed separately.
 i'll add a comment to that effect.

> > +
> > +# Params: 'domClass' struct
> 
> What is this comment about?  

 i have no idea.  it was copied from the JSBindings code, by alp.

> The "Params" suggests it is about the arguments to
> the following function, but the function appears to take three arguments that
> have no relation to this comment.
> 
> > +sub GenerateInterface {
> > +    my $object = shift;
> > +    my $dataNode = shift;
> > +    my $defines = shift;
> > +
> > +    my $name = $dataNode->name;
> > +
> > +    print "$name\n";
> 
> What's the purpose of this print statement?

 i have no idea.  i am reluctant to remove it in case it is important.


> > +
> > +    $object->Generate($dataNode);
> > +
> > +    # Write changes
> > +    my $fname = "Gdom_" . $name; #decamelize($name);
> 
> The comment here doesn't seem to add anything.  Why is there commented-out code
> here?

 i have no idea.  perhaps it is there when there was the possibility
 that the DerivedSources/gdom/ files would be named Gdom_interface_name
 rather than GdomInterfaceName.


> > +    $fname =~ s/_//g;
> > +    $object->WriteData($fname);
> > +}
> > +
> > +# Params: 'idlDocument' struct
> 
> Same comment as for the previous function applies to this comment.

 same response: it's copied from the JS code, by alp.

here is a copy of the code from which it was copied (CodeGeneratorJS.pm)

you can see the same two-word comments, and the same "Params: 'domClass'
struct" comments.

if you can find an explanation from the original authors as to why
these files contain these comments, i will be happy to attach them
and add their comments.

alternatively, the comments can be left as-is, as they match up
with the file from which they were copied.  to remove them would
only confuse people who would like to compare the two files to find
out how they work.

i am changing the comment to be the same as in CodeGeneratorJS.pm



sub finish
{
    my $object = shift;

    # Commit changes!
    $object->WriteData();
}

sub leftShift($$) {
    my ($value, $distance) = @_;
    return (($value << $distance) & 0xFFFFFFFF);
}

# Params: 'domClass' struct
sub GenerateInterface
{
    my $object = shift;
    my $dataNode = shift;
    my $defines = shift;

    # Start actual generation
    $object->GenerateHeader($dataNode);
    $object->GenerateImplementation($dataNode);

    my $name = $dataNode->name;

    # Open files for writing
    my $headerFileName = "$outputDir/JS$name.h";
    my $implFileName = "$outputDir/JS$name.cpp";

    open($IMPL, ">$implFileName") || die "Couldn't open file $implFileName";
    open($HEADER, ">$headerFileName") || die "Couldn't open file
$headerFileName";
}

# Params: 'idlDocument' struct
sub GenerateModule
{
    my $object = shift;
    my $dataNode = shift;

    $module = $dataNode->module;
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list