#!/usr/bin/perl $FILEIN = shift(@ARGV); $FILEOUT = shift(@ARGV); if (defined($FILEIN) && defined($FILEOUT)) { print("command: OpenALF.alf2lib.pl $FILEIN $FILEOUT\n\n"); } else { die("usage: OpenALF.alf2lib.pl \n"); } $ALF_Debug = shift(@ARGV); # print out messages $ALF_InstallDir = "../source"; ### step 1: import data, use lexical parser require "$ALF_InstallDir/OpenALF.littlehelper.pl"; require "$ALF_InstallDir/OpenALF.parseLex.pl"; require "$ALF_InstallDir/IEEE1603_2003.clause6.pl"; &FileIn($FILEIN,'ALF_ReadLexical'); ### step 2: analyze syntax, create object-oriented database require "$ALF_InstallDir/OpenALF.global.pl"; require "$ALF_InstallDir/OpenALF.parseALF.pl"; require "$ALF_InstallDir/OpenALF.compileALF.pl"; require "$ALF_InstallDir/IEEE1603_2003.clause7.pl"; require "$ALF_InstallDir/IEEE1603_2003.clause8.pl"; require "$ALF_InstallDir/IEEE1603_2003.clause9.pl"; require "$ALF_InstallDir/IEEE1603_2003.clause10.pl"; &ALF_CreateData('test'); ### step 3: access data for application purpose, for example: require "$ALF_InstallDir/OpenALF.compileLiberty.pl"; require "$ALF_InstallDir/OpenALF.simpleApplications.pl"; &ALF_DumpDatabase if $ALF_Debug; &ALF_ReportLibraryContents('test'); ### step 4: create .lib view in database require "$ALF_InstallDir/OpenALF.logic.pl"; require "$ALF_InstallDir/OpenALF.timing.pl"; require "$ALF_InstallDir/OpenALF.compileLiberty.pl"; require "$ALF_InstallDir/OpenALF.mapALF2Liberty.pl"; &ALF_Data2Liberty('test'); ### step 5: validate database integrity after .lib view creation: &ALF_DumpDatabase if $ALF_Debug; &ALF_ReportLibraryContents('test',1); ### step 6: export data require "$ALF_InstallDir/OpenALF.printLiberty.pl"; $AutoFirstLine = "// "; # 1st line in output file will be preceded by "// " &FileOut($FILEOUT,'ALF_Export','Liberty','test'); 1;