Contents 
 Index 
 "Perl Program Reference" 
 < Previous 
 Next > 

asn_bapitypes.pl

Go to the documentation of this file.
00001 // This file has been modified on-the-fly with an input filter
00002 // to change it from Perl syntax to C++ strictly for the purposes
00003 // of faking out Doxygen. Modifications include:
00004 
00005 // - changing local() definitions to C++ #define statements.
00006 // - commenting out undef statements.
00007 // - changing $globe'... variable names to $globe_...
00008 // - changing sub statements to look like C++ functions.
00009 // - changing # comments to C++ comments.
00010 // - ...
00011 
00012 // If you see other strangeness in the HTML version of the Perl file,
00013 // it comes from getting it to look more C++ like.
00014 
00015 
00016 // #!/usr/#define/bin/perl
00017 //#############################################################################
00018 /** @file
00019  ** @brief Looks at asn files and stores information about enumerations so 
00020  ** that it can be merged with with bapitypes.h.
00021  ** 
00022  ** A platform-independent definition of enumerations et al are defined
00023  ** in asn files. Comments have been added to these files but the normal
00024  ** asn tools do not pass them through to the h files.
00025  **
00026  ** This tool parses the asn files and stores information.
00027  ** Then it parses the generated bapitypes.h file.
00028  ** It merges information stored with information from bapitypes.h
00029  ** and outputs a file with the merged information.
00030  **
00031  ** @ingroup tp_tools tp_bapi
00032  **
00033  ** @author Glenn C. Maxey
00034  **/
00035 // #
00036 //#    $Id: asn_bapitypes.pl,v 1.2 2002/11/20 15:23:01 gmaxe Exp $
00037 //#
00038 //# Copyright 2002 Created by Voyant Technologies, Inc., Westminster, Colorado, USA.
00039 //#
00040 //# Revision Information:
00041 //#
00042 //# $Log: asn_bapitypes.pl,v $
00043 //# Revision 1.2  2002/11/20 15:23:01  gmaxe
00044 // //# Added exit codes so that wrapper scripts can catch errors properly.
00045 //#
00046 //# Revision 1.1  2002/02/02 01:48:52  gmaxe
00047 //# Supports index tokens from all dox files;
00048 //# supports used-by index tokens.
00049 //# asn_bapitypes.pl is a new file to handle remerging of comments
00050 //# into what the tools see.
00051 //#
00052 //#
00053 //#############################################################################
00054 
00055 //#############################################################################
00056 /** @fn int BEGIN
00057  ** @brief Code to execute when first entered.
00058  **
00059  ** @param None. 
00060  **
00061  ** @return None.
00062  **
00063  ** @lim None
00064  ** @ingroup tp_bapi
00065  **/
00066 // #############################################################################
00067 int BEGIN  ( ) {
00068 //    print "\n============  Starting asn_bapitypes.pl ==================================\n";
00069    $_file_list = "_file_list";
00070    $in_file = "";
00071    $f_type = "asn";
00072    $asn_path = "./";
00073    
00074    $comment_dox = "\-\-\/\/\!";  //  --//!
00075    $comment_dox_normal = "\/\/\!";  //  //!
00076    $comment_ignore = "\-\-\/\/"; //  --//
00077    // undef (%unproc_file); //  key = $in_file; content = $_temp_in no blank lines   
00078    $code_enum = "ENUMERATED";
00079    $code_seq = "SEQUENCE";
00080    $code_def_mark = "\:\:\=";  //  ::=
00081    // undef (%ct_item);  //  code top item; key = item name; content = dox comment
00082    // undef (%enum_item); // enumeration item; key = enum+item; content = dox comment
00083 
00084    $td_enum = "typedef enum";    // type definition flag
00085    $td_struct = "typedef struct";    // type definition flag
00086    $comp_of_flag = "COMPONENTS OF ";  //  says that we have to do something different.
00087    $comp_of_flag2 = "\;\,\;";  //  says that we have to do something different.
00088 
00089    push (@INC, `pwd`);
00090    push (@INC, '../perl');
00091    if (0){
00092 //       print (@INC, "\n");
00093    }
00094 }
00095 
00096 //#############################################################################
00097 /** @fn int main
00098  ** @brief The main program.
00099  **
00100  ** @param None. 
00101  **
00102  ** @return None.
00103  **
00104  ** @lim None
00105  ** @ingroup tp_bapi
00106  **/
00107 // #############################################################################
00108 // sub main {
00109 {
00110    // #############################################################################
00111    // # Start of Main Program
00112    // #############################################################################
00113 
00114    if (@ARGV < 1) {
00115       &using_asn_bapi();
00116 //       exit(1);
00117    }
00118 
00119    //  Get path to asn files if there is one.
00120    if (@ARGV > 0) {
00121       $asn_path = @ARGV[0];
00122       if ($asn_path =~ /\//) {
00123 //          print "The path specified is $asn_path\n";
00124    
00125       } else {
00126 //          print "The input argument \"$asn_path\" requires a forward slash (\/).\n";
00127          &using_asn_bapi();
00128 //          exit(1);
00129       }
00130    } //  if 1 or more arguments
00131 
00132    if (@ARGV > 1) {
00133       $bapitypes_file = @ARGV[1];
00134 //       print "The master file is $bapitypes_file\n";
00135       unless (open ( IN_MASTER, $bapitypes_file)) {
00136 //          print "Cannot open file \"$bapitypes_file\"\n";
00137 //          exit(0);
00138       }
00139 //       close (IN_MASTER);
00140    } else {
00141 //       print "Need to have the master bapitypes file.\n";
00142       &using_asn_bapi();
00143 //       exit(1);
00144    } //  if 2 or more arguments
00145 
00146    if (&create_file_list() == 0) {
00147       &process_file_list();
00148    } else {
00149 //       print "Cannot create file list\n";
00150 //       exit(0);
00151    }
00152    
00153    &fix_enum_list();
00154    
00155    &read_manipulate_master();
00156    
00157    $out_file = "$bapitypes_file.gen";
00158 //    //  print "before passing: $out_file\n";
00159    
00160    &write_output_file($out_file);
00161 
00162 
00163    if (@file_errors) {
00164 //       print "\n============  Summary of errors ==================================\n";
00165       for ($i=0; $i<@file_errors; $i++){
00166 //          print "$i = $file_errors[$i]\n";
00167       }
00168    }
00169 
00170 
00171    // #############################################################################
00172    // # End of most of work
00173    // #############################################################################
00174 }
00175 
00176 //#############################################################################
00177 /** @fn int create_file_list
00178  ** @brief Creates a temporary file that lists all of the files which should
00179  ** be processed.
00180  **
00181  ** @return The file is created in the directory given by the first input
00182  ** parameter to the program.
00183  **
00184  ** @lim 
00185  **
00186  ** @ingroup tp_bapi
00187  **/
00188 // #############################################################################
00189 int create_file_list  ( ) {
00190    $_file_list = "$asn_path$_file_list";
00191 
00192    if (system ("ls $asn_path*.$f_type* > $_file_list")) {
00193 //       print "ls $asn_path*.$f_type* > $_file_list\n";
00194 //       print "There is no $asn_path directory. Nothing done.\n";
00195       push (@file_errors, "There is no $asn_path directory. Nothing done.\n");
00196       return(1);
00197    }
00198 
00199    return (0);
00200 } //  create_file_list
00201 
00202 //#############################################################################
00203 /** @fn int process_file_list
00204  ** @brief Gathers information from all files given in the list.
00205  **
00206  ** Opens the file that contains the list of files that are of interest.
00207  ** Then it opens each of those files one at a time.
00208  ** 
00209  ** @return This creates two hash tables. One is for the code top item
00210  ** and the other is for enumeration values (of a code top item).
00211  ** A "code top item" is some code element definition. Top means that it
00212  ** is not part of an enumeration.
00213  ** 
00214  ** In both cases, what the hash stores is the doxygen comment associated
00215  ** with it.
00216  **
00217  ** The key into ct_item is the name of the item fixed up to what will be
00218  ** seen later in bapitypes.
00219  **
00220  ** The key into enum_item is the name of the enumeration plus the enumeration item
00221  ** fixed up to what will be seen later in bapitypes.
00222  **
00223  ** @lim None.
00224  **
00225  ** @ingroup tp_bapi
00226  **/
00227 // #############################################################################
00228 int process_file_list  ( ) {
00229 
00230    unless (open ( IN_LIST, $_file_list)) {
00231 //       print "Cannot open file \"$_file_list\"\n";
00232       push (@file_errors, "Cannot open file \"$_file_list\"\n");
00233 //       exit(1);
00234    }
00235    
00236 INCOMING:   while (<IN_LIST>){    //  read a line from file into $_
00237       $in_file = $_;
00238       $in_file =~ s/\n//;
00239 //       printf ("Working on... %s\n", $in_file);
00240       unless (open ( IN_FILE, $in_file)) {
00241 //          print "Cannot open file \"$in_file\"\n";
00242          push (@file_errors, "Cannot open file \"$in_file\"\n");
00243          next INCOMING;
00244       }
00245       $_temp_in = "";   //  reset temporary input buffer
00246       $_dox_comment = "";
00247       $_dox_flag = 0;
00248       $_seq_flag = 0;
00249       $_enum_flag = 0;
00250       $_rem_enum = "";
00251 INC_LINE:   while (<IN_FILE>){ //  read in entire file
00252          if (0){
00253 //             print "enum=$_enum_flag;seq=$_seq_flag\n";
00254          }
00255          if (/^$comment_dox/){
00256             //  pass through doxygen comments
00257             $_temp_in .= $_;
00258             //  collect doxygen comments for top level item
00259             $_dox_flag = 1;
00260             $_temp = $_;
00261             $_temp =~ s/$comment_dox/$comment_dox_normal/g;
00262             if (0){
00263 //                print "hola =$_temp\n";
00264             }
00265             $_dox_comment .= $_temp;
00266             $_enum_flag = 0;
00267             $_seq_flag = 0;
00268          } elsif (/^$comment_ignore/) {
00269             //  ignore regular comments
00270             next INC_LINE;
00271          } elsif (!/[\S]+/) {
00272             //  ignore blank lines
00273 //             //  print "ggg :$_\n";
00274             next INC_LINE;
00275          } elsif ((/$code_def_mark/) && ($_seq_flag == 0) && ($_enum_flag == 0)) {
00276             //  starting enumeration stuff
00277             $_temp_in .= $_;
00278             //  pick-off code item name
00279             //  name is [0]; what it is [1]
00280             @code_def_line = split (/$code_def_mark/, $_, 2);
00281             $code_def_line[0] =~ s/[\s]//g;  //  white space
00282             $code_def_line[0] =~ s/\-/\_/g;  //  change name
00283             if ($code_def_line[1] =~ /$code_seq/){
00284                $_seq_flag = 1;
00285                $_rem_seq = $code_def_line[0];
00286                if (0){
00287 //                   print ">>$code_def_line[0]\n";
00288                }
00289             } elsif ($code_def_line[1] =~ /$code_enum/) {
00290                $_enum_flag = 1;
00291                $_rem_enum = $code_def_line[0];
00292                if (0){
00293 //                   print ">>$code_def_line[0]\n";
00294                }
00295             }
00296             if ($_dox_flag == 1) { 
00297                $ct_item{$code_def_line[0]} = $_dox_comment;
00298                $_dox_flag = 0;
00299             }
00300             $_dox_comment = "";
00301             if (0){
00302 //                print "hola =$_rem_enum\n";
00303             }
00304          } elsif (($_enum_flag == 1) && (!/\}/) && (!/\{/)) {
00305             //  Within an enumeration
00306             //  pick-off enumeration item name
00307             //  name is [0]; dox comment is [1]
00308             @code_def_line = split (/$comment_dox/, $_, 2);
00309             if ($code_def_line[0] !~ /\S+/) {
00310                //  if we're inside of an enumeration and there is no
00311                //  name to the left of the comment, then this
00312                //  comment should be appended to the previous one.
00313                $enum_item{$_temp} .= "\n$comment_dox_normal$code_def_line[1]"; 
00314                if (0) {
00315 //                   print "stop $_rem_enum\n$_";
00316 //                   print "[0]=$code_def_line[0]=\n";
00317 //                   print "[1]=$code_def_line[1]=\n";
00318 //                   print "$enum_item{$_temp}\n";
00319                }
00320                next INC_LINE;
00321             }
00322             $code_def_line[0] =~ s/[\s]//g;  //  white space
00323             $code_def_line[0] =~ s/\-/\_/g;  //  change name
00324             $code_def_line[0] =~ s/\,//g;    //  get rid of commas
00325             $code_def_line[1] =~ s/\n//g;    //  get rid of carriage return
00326             //  name is [0]; everything else isn't important
00327             @enum_item_name = split (/\(/, $code_def_line[0], 2);
00328             //  enumeration item; key = enum+item; content = dox comment
00329             $_temp = "$_rem_enum$enum_item_name[0]";
00330             $enum_item{$_temp} = "$comment_dox_normal$code_def_line[1]"; 
00331          } elsif (($_seq_flag == 1) && (!/\}/) && (!/\{/)) {
00332             //  Within a sequence
00333             if (0){
00334 //                print "REPEAT enum=$_enum_flag;seq=$_seq_flag\n";
00335             }
00336             //  pick-off sequence item name
00337             //  name is [1]; dox comment is somewhere [2]
00338             @name_chunk = split (/\s+/, $_, 3);
00339             $_temp = "$_rem_seq$name_chunk[1]";
00340             if (0) {
00341 //                print "input>>$_";
00342 //                print "[0]=$name_chunk[0]=\n";
00343 //                print "[1]=$name_chunk[1]=\n";
00344 //                print "[2]=$name_chunk[2]=\n";
00345 //                print "[3]=$name_chunk[3]=\n";
00346 //                print "last\n";
00347             }
00348             //  nothing is [0]; dox comment is [1]
00349             @code_def_line = split (/$comment_dox/, $name_chunk[2], 2);
00350             if (0) {
00351 //                print "input>>$name_chunk[2]";
00352 //                print "[0]=$code_def_line[0]=\n";
00353 //                print "[1]=$code_def_line[1]=\n";
00354 //                print "last\n";
00355             }
00356             $code_def_line[1] =~ s/\n//g;    //  get rid of carriage return
00357             if (/$comp_of_flag/){
00358                //  If the sequence has components it, then flag them for
00359                //  later processing.
00360                @get_comp1 = split (/$comp_of_flag/, $_, 2);
00361                @get_comp2 = split (/\s+/, $get_comp1[1], 2);
00362                $get_comp2[0] =~ s/\,//g;
00363                if ($get_comp2[0] =~ /\./){
00364                   @get_comp3 = split (/\./, $get_comp2[0], 2);
00365                   $get_comp2[0] = $get_comp3[1]; 
00366                }
00367                //  Create a place-holder key in the enumeration hash
00368                //  to be resolved later.
00369                $_temp = "$_rem_seq$comp_of_flag2$get_comp2[0]";
00370                if (0){
00371 //                   print "key=$_temp\n";
00372                }
00373                $enum_item{$_temp} = "$comment_dox_normal$code_def_line[1]";
00374             } else {
00375                //  enumeration item; key = enum+item; content = dox comment
00376                $enum_item{$_temp} = "$comment_dox_normal$code_def_line[1]"; 
00377             }
00378          } elsif (($_enum_flag == 1) && (/\}/)) {
00379             //  At the end of an enumeration
00380             $_temp_in .= $_;
00381             $_enum_flag = 0;
00382          } elsif (($_seq_flag == 1) && (/\}/)) {
00383             //  At the end of an enumeration
00384             $_temp_in .= $_;
00385             $_seq_flag = 0;
00386          } else {
00387             //  pass through code stuff
00388             $_temp_in .= $_;
00389          }
00390       } //  while within a given file
00391 //       close (IN_FILE);
00392       
00393       if (0){
00394 //          print $_temp_in;
00395       }
00396       $unproc_file{$in_file} = $_temp_in;
00397       //  if possible, fix the list with things we know
00398       &fix_enum_list();
00399    } //  while getting a specific file
00400 //    close (IN_LIST);
00401    
00402    if (0) {
00403       foreach $ddd (sort keys %ct_item){
00404 //          print "ct key=$ddd content=$ct_item{$ddd}\n";
00405       }
00406 //       exit(1);
00407    }
00408    if (0) {
00409       foreach $ddd (sort keys %enum_item){
00410 //          print "enum key=$ddd content=$enum_item{$ddd}\n";
00411       }
00412 //       exit(1);
00413    }
00414    if (0) {
00415       foreach $ddd (keys %unproc_file){
00416 //          print "key=$ddd\n=====\ncontent=$unproc_file{$ddd}\n";
00417       }
00418    }
00419    
00420    
00421    return (0);
00422 
00423 } //  process_file_list
00424 
00425 //#############################################################################
00426 /** @fn int fix_enum_list
00427  ** @brief Resolves enumeration items that were built from other components.
00428  **
00429  ** Duplicates entries in the hash table for the equivalent of the component.
00430  ** Removes place-holder entries in the hash that say component.
00431  **
00432  ** @lim This is called several times so that it can resolve things as new
00433  ** things are learned.
00434  ** @ingroup tp_bapi
00435  **/
00436 // #############################################################################
00437 int fix_enum_list  ( ) {
00438 //    //  print "Fixing the enumeration list of nested components.\n";
00439    $_key_flag = 0; 
00440      
00441    //  Fix the enum list so that components are resolved.
00442    foreach $enum_key (sort keys %enum_item){
00443       if ($enum_key =~ /$comp_of_flag2/){
00444          @key_part = split (/$comp_of_flag2/, $enum_key, 2);
00445 //          //  print "$key_part[0] and $key_part[1]\n";
00446          foreach $key_again (sort keys %enum_item){
00447             //  get all keys that match component key [1] and make
00448             //  them part of the other component key [0].
00449             if ($key_again =~ /^$key_part[1]/){
00450                //  Only set the flag if the item is resolved.
00451                $_key_flag = 1;
00452                //  We need to correlate key
00453                @src_key = split (/$key_part[1]/, $key_again, 2);
00454 //                //  print "$key_part[0]=$key_part[1]=$key_again=$src_key[0] and $src_key[1]\n";
00455                $_temp_src = "$key_again";
00456                $_temp_tgt = "$key_part[0]$src_key[1]";
00457 //                //  print "$_temp_tgt to be $_temp_src\n";
00458                $enum_item{$_temp_tgt}=$enum_item{$_temp_src};
00459             }
00460          } //  for each key_again
00461          //  remove the element from the hash that says "component of"
00462          if ($_key_flag == 1){
00463             delete($enum_item{$enum_key});
00464             $_key_flag = 0;
00465          }
00466       } //  if enum_key is a component
00467    } //  for each enum_key
00468    if (0) {
00469 //       print "This is enumeration list again\n=====================\n";
00470       foreach $enum_key (sort keys %enum_item){
00471 //          print "enum key=$enum_key content=$enum_item{$enum_key}\n";
00472       } //  for each enum_key
00473    }
00474    return (1);
00475 
00476 } //  fix_enum_list
00477 
00478 
00479 //#############################################################################
00480 /** @fn int read_manipulate_master
00481  ** @brief Reads in the file generated by development tools and appends
00482  ** any dox comments that those tools may have stripped from the source files.
00483  **
00484  ** @return $bapitypes contains the original information along with comments.
00485  **
00486  ** @ingroup tp_bapi
00487  **/
00488 // #############################################################################
00489 int read_manipulate_master  ( ) {
00490 
00491    if (0) {
00492 //       print "The master file is $bapitypes_file\n";
00493    } 
00494    unless (open ( IN_MASTER, $bapitypes_file)) {
00495 //       print "Cannot open file \"$bapitypes_file\"\n";
00496       return (0);
00497    }
00498    $_in_enum = 0;
00499    $_rem_enum = "";
00500    //  Get the master definitions
00501    while (<IN_MASTER>){    //  entire master file into memory.
00502       //  Figure out what the line says.
00503       if (/^$td_enum/) {
00504          //  We have a type definition that needs comments
00505          $_in_enum = 1;
00506          //  Figure out which typedef we've got
00507          //  pick-off code item name
00508          //  nothing is [0]; name is [1]; typedef start is [2]
00509          @code_def_line = split (/$td_enum|\s/, $_, 2);
00510          $code_def_line[1] =~ s/\s//g;  //  white space
00511          $code_def_line[1] =~ s/\{//g;  //  white space
00512          $_rem_enum = $code_def_line[1];
00513          $bapitypes .= $ct_item{$code_def_line[1]};
00514          if (0){
00515 //             print $ct_item{$code_def_line[1]};
00516 //             print "what=$code_def_line[1]\n";
00517          }
00518          if (1) {
00519             //  Adam E's suggestion about which keyword to eliminate
00520             $bapitypes .= "\/\/ Next line changed to fake out Doxygen\n\/\/ $_";
00521             $bapitypes .= "$td_enum \{\n";
00522          } else {
00523             $bapitypes .= $_;
00524          }
00525       } elsif (/^$td_struct/){
00526          //  We have a type definition that needs comments
00527          $_in_struct = 1;
00528          //  Figure out which typedef we've got
00529          //  pick-off code item name
00530          //  nothing is [0]; name is [1]; typedef start is [2]
00531          @code_def_line = split (/$td_struct|\s/, $_, 2);
00532          $code_def_line[1] =~ s/\s//g;  //  white space
00533          $code_def_line[1] =~ s/\{//g;  //  white space
00534          $_rem_enum = $code_def_line[1];
00535          $bapitypes .= $ct_item{$code_def_line[1]};
00536          if (0){
00537 //             print $ct_item{$code_def_line[1]};
00538 //             print "what=$code_def_line[1]\n";
00539          }
00540          $bapitypes .= $_;
00541       } elsif ( ($_in_enum == 1) && (!/\}/)) {
00542          //  Middle of an enumeration
00543          //  name is [0]; value is [1]
00544          $_temp_line = $_;
00545          $_temp_line =~ s/\n//;
00546          @code_def_line = split (/\=/, $_temp_line, 2);
00547          $code_def_line[0] =~ s/\s//g;  //  white space
00548          $_temp = "$_rem_enum$code_def_line[0]";
00549          if (exists($enum_item{$_temp})) {
00550             if (0){
00551 //                print "what=$_temp=$enum_item{$_temp}\n";
00552             }
00553             $_temp_line .= " $enum_item{$_temp}\n"; 
00554          } else {
00555             $_temp_line .= "\n"; 
00556          }
00557          $bapitypes .= $_temp_line;
00558       } elsif ( ($_in_struct == 1) && (!/\}/)) {
00559          //  Middle of an structure
00560          //  name is [2]; value is [1]
00561          $_temp_line = $_;
00562          $_temp_line =~ s/\n//;
00563          @code_def_line = split (/\s+/, $_temp_line, 3);
00564          if (0) {
00565 //             print "[0]=$code_def_line[0]\n";
00566 //             print "[1]=$code_def_line[1]\n";
00567 //             print "[2]=$code_def_line[2]\n";
00568          }
00569          $code_def_line[2] =~ s/\s//g;  //  white space
00570          $code_def_line[2] =~ s/\;//g;  //  semicolin
00571          $code_def_line[2] =~ s/\n//g;  //  carriage return
00572          $_temp = "$_rem_enum$code_def_line[2]";
00573          if (exists($enum_item{$_temp})) {
00574             if (0){
00575 //                print "what=$_temp=$enum_item{$_temp}\n";
00576             }
00577             $_temp_line .= " $enum_item{$_temp}\n"; 
00578          } else {
00579             $_temp_line .= "\n"; 
00580          }
00581          $bapitypes .= $_temp_line;
00582       } elsif (($_in_enum == 1) && (/\}/)) {
00583          //  End of the enumeration
00584          //  We're doing something unique here:
00585          if (1) {
00586             //  Adam E's suggestion about which keyword to eliminate
00587             $bapitypes .= $_;
00588          } else {
00589             $bapitypes .= "\/\/ Next line changed to fake out Doxygen\n\/\/ $_";
00590             $bapitypes .= "\} \;\n";
00591          }
00592          $_in_enum = 0;
00593       } elsif (($_in_struct == 1) && (/\}/)) {
00594          //  End of the structure
00595          $bapitypes .= $_;
00596          $_in_struct = 0;
00597       } else {
00598          $bapitypes .= $_;
00599       }
00600       
00601       
00602    }
00603 //    close (IN_MASTER);
00604    if (0){
00605 //       print $bapitypes;
00606    }
00607 
00608    return (1);
00609 } //  read_manipulate_master
00610 
00611 //#############################################################################
00612 /** @fn int write_output_file
00613  ** @brief Uses the second argument of the input (master file) and appends
00614  ** ".gen" to the name and outputs the enhanced data.
00615  **
00616  ** @return A new file named similar to the input file but with a ".gen" extension.
00617  **
00618  ** @ingroup tp_bapi
00619  **/
00620 // #############################################################################
00621 int write_output_file  ( ) {
00622    $file_out = $_[0];
00623 //    print "Writing the $file_out output file.\n";
00624    
00625    //  $bapitypes =~ s/typedef enum/enum/g;
00626    
00627    unless (open ( OUT_FILE, ">$file_out")) {
00628       push (@file_errors, "Cannot open file \"$file_out\"\n");
00629 //       print "Cannot open file \"$file_out\"\n";
00630    }
00631 //    print (OUT_FILE "\/\/\! \@file\n");
00632 //    print (OUT_FILE "\/\/\! \@brief Slightly modified version of the original header file.\n");
00633 //    print (OUT_FILE "\/\/\! \n\/\/\! Comments that were stripped by external proprietary tools\n");
00634 //    print (OUT_FILE "\/\/\! have been re-inserted in this version which is only used\n");
00635 //    print (OUT_FILE "\/\/\! to generate HTML documentation.\n");
00636 //    print (OUT_FILE "\/\/\! \n\/\/\! A couple of other modifications were carried out\n");
00637 //    print (OUT_FILE "\/\/\! to make Doxygen happy.\n");
00638 //    print (OUT_FILE "\/\/\! \n\/\/\! THIS FILE IS GENERATED!!!\n");
00639 //    print (OUT_FILE "\/\/\! \n\/\/\! \@ingroup bapi\n");
00640 
00641 
00642 //    print (OUT_FILE "$bapitypes");
00643 //    close (OUT_FILE);
00644 
00645 } //  write_output_file
00646 
00647 
00648 
00649 //#############################################################################
00650 /** @fn int using_asn_bapi
00651  ** @brief What to do when no arguments are given.
00652  ** @param None
00653  ** @return None
00654  ** 
00655  ** @lim None
00656  ** @ingroup tp_bapi
00657  **/
00658 // #############################################################################
00659 int using_asn_bapi  ( ) {
00660 //    print "asn_bapitypes.pl <path to asn files> <path and name of bapitypes>\n";
00661 //    print "Outputs <path and name of bapitypes> with a \".gen\" extension.\n";
00662 //    print "\nTerminating asn_bapitypes.pl without doing anything.\n";
00663    return;
00664 }
00665 
00666 
00667 
00668 
00669 
00670 //#############################################################################
00671 /** @fn int END
00672  ** @brief Code to execute when first entered.
00673  **
00674  ** @param None. 
00675  **
00676  ** @return None.
00677  **
00678  ** @lim None
00679  ** @ingroup tp_bapi
00680  **/
00681 // #############################################################################
00682 int END  ( ) {
00683    // undef ($_file_list); //  "_file_list";
00684    // undef ($in_file ); //   "";
00685    // undef ($f_type ); //   "asn";
00686    // undef ($asn_path ); //   "./";
00687    
00688    // undef ($comment_dox ); //   "\-\-\/\/\!";  # --//!
00689    // undef ($comment_dox_normal ); //   "\/\/\!";  # //!
00690    // undef ($comment_ignore ); //   "\-\-\/\/"; # --//
00691    // undef (%unproc_file); //  key = $in_file; content = $_temp_in no blank lines   
00692    // undef ($code_enum ); //   "ENUMERATED";
00693    // undef ($code_seq ); //   "SEQUENCE";
00694    // undef ($code_def_mark ); //   "\:\:\=";  # ::=
00695    // undef (%ct_item);  //  code top item; key = item name; content = dox comment
00696    // undef (%enum_item); // enumeration item; key = enum+item; content = dox comment
00697 
00698    // undef ($td_enum ); //   "typedef enum";    #type definition flag
00699    // undef ($td_struct ); //   "typedef struct";    #type definition flag
00700 
00701    
00702    // #############################################################################
00703    // # Memory clean-up.
00704    // #############################################################################
00705 
00706 //    print "\n============  Finished asn_bapitypes.pl ==================================\n";
00707 //    exit(0);
00708 } //  END
00709 


 "Perl Program Reference" 
 < Previous 
 Next > 


Open-Source tools compliments of Voyant Technologies, Inc. and Glenn C. Maxey.
01/13/2003

TP Tools v2-00-0a

# tpt-perl-hcr-02