[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash/server/asobj gen-asclass.pl
From: |
Ann Barcomb |
Subject: |
[Gnash-commit] gnash/server/asobj gen-asclass.pl |
Date: |
Thu, 29 Mar 2007 12:06:44 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Ann Barcomb <ann> 07/03/29 12:06:44
Modified files:
server/asobj : gen-asclass.pl
Log message:
More inline comments added for anyone reading the code.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/gen-asclass.pl?cvsroot=gnash&r1=1.1&r2=1.2
Patches:
Index: gen-asclass.pl
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/gen-asclass.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gen-asclass.pl 20 Mar 2007 18:47:53 -0000 1.1
+++ gen-asclass.pl 29 Mar 2007 12:06:44 -0000 1.2
@@ -1,11 +1,22 @@
#!perl
+
+########################### NOTES ##################################
+## If you wish to change the output of this program, search for
+## 'sub create_headerfile' and 'sub create_cppfile'.
+##
+## To run this program, type 'gen-class.pl --help' (you may need
+## to use '/path/to/perl gen-clas.pl --help'), which will display
+## available options.
+####################################################################
+
+
use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
-our $VERBOSE = 0;
+our $VERBOSE = 0; ## default setting; can be changed by command-line option
our $LICENSE = q|
//
@@ -42,8 +53,9 @@
open ($fh, '>', $args{headerfile}) or die
"Cannot open file '$args{headerfile}': $!\n";
notify("Creating file '$args{headerfile}'.");
-
print $fh $LICENSE;
+
+ ## The text between the EOFs will be printed in the header file.
print $fh <<EOF;
#ifndef __GNASH_ASOBJ_$args{up}_H__
@@ -84,11 +96,22 @@
open ($fh, '>', $args{cppfile}) or die
"Cannot open file '$args{cppfile}': $!\n";
notify("Creating file '$args{cppfile}'.");
+ print $fh $LICENSE;
+
- ## Create code for each method
+ ## Loop through the list of methods. Generate code, stored in
+ ## $declarations, $registrations, and $implementations. $declarations
+ ## contains the declaration code for all methods, etc. These will
+ ## be printed later, in the section delimited with EOF. You may
+ ## change the output of these three looped sections.
my ($declarations, $registrations, $implementations);
foreach my $m (@{$args{methods}}) {
+ ## Where you see 'qq|' and '|', read '"' and '"'. Using the quote
+ ## operator eliminates the need to escape literal quotes. Thus,
+ ## qq|This is an "example".\n| == "This is an \"example\".\n"
+ ## A '.' concatenates a string.
+
$declarations .=
qq|\nstatic void $args{lc}_| .$m. qq|(const fn_call& fn);|;
@@ -108,7 +131,7 @@
}
- print $fh $LICENSE;
+ ## The text between the EOFs will be printed in the C++ source file.
print $fh <<EOF;
#ifdef HAVE_CONFIG_H
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash/server/asobj gen-asclass.pl,
Ann Barcomb <=