亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? focusparser.pm

?? 最新的版本ACE-5.6.8,剛從外文網上搬下,與大家分享.
?? PM
?? 第 1 頁 / 共 2 頁
字號:
        print OUT $_; # print end hook!
      }
    }
  }

  # everything went well!
  close (IN);
  close (OUT);

  rename ($copy_file_name_tmp, $copy_file_name);
}

###############################################################
# Visit_Copy: visit the <copy> tags and weave the code into the
# source file. In particular, open the source file specified
# in the file-source tag. Search for the start hook and
# copy until the end hook is reached.
###############################################################
sub Visit_Copy
{
  my ($copy_tag, $copy_file_name, $default_module_name, $prefix_path) = @_;

  # Check if a file name has been specified
  my $dest_file_tag = $copy_tag->getElementsByTagName ('source');

  if (! $dest_file_tag)
  {
    print "Error: <copy-from-source> does not have the <file> tag..";
    print "aborting \n";
    exit 1;
  }

  if ($dest_file_tag->getLength != 1)
  {
    print "Assertion Error: A <copy-from-source> element can have only \
           one <source> tag from which to copy elements";
    exit (1);
  }

  my $dest_file_name = $dest_file_tag->item(0)->getFirstChild->getNodeValue;

  #Check if the file exists and one is able to access it
  $dest_file_name = $prefix_path . "/" . $default_module_name . "/" . $dest_file_name;

  open (DEST, "<". $dest_file_name) ||
   die "cannot open $dest_file_name \n Wrong <file> tag within <copy-from-source> exiting" ;

  # check for the start and end tags within the target file where
  # one needs to start copying from
  my $start_tag = $copy_tag->getElementsByTagName ('copy-hook-start');
  my $end_tag   = $copy_tag->getElementsByTagName ('copy-hook-end');

  if (! $start_tag || ! $end_tag)
  {
    print "Assertion Error: A <copy> element should have a \
           <copy-hook-start> tag and <copy-hook-end> tag \n";
    exit (1);
  }

  # Get the <dest-hook> tag that indicates the destination where the
  # code between the start and end tags will be placed.
  my $dest_hook_tag   = $copy_tag->getElementsByTagName ('dest-hook');
  if (! $dest_hook_tag)
  {
    print "Assertion Error: <copy-from-source> should have a <dest-hook> \
           tag that dictates where in the source file the code should be \
           placed. \n";
    exit (1);
  }

  # Remove any starting and trailing white spaces
  chomp ($dest_hook_tag);

  # We have everything we need! Do the copy
  my $start_tag_name = $start_tag->item(0)->getFirstChild->getNodeValue;
  my $end_tag_name   = $end_tag->item(0)->getFirstChild->getNodeValue;
  my $dest_tag_name  = $dest_hook_tag->item(0)->getFirstChild->getNodeValue;

  # First we add the FOCUS prepend tags
  $start_tag_name = $FOCUS_PREPEND_TAG . $start_tag_name;
  $end_tag_name   = $FOCUS_PREPEND_TAG . $end_tag_name;
  $dest_tag_name  = $FOCUS_PREPEND_TAG . $dest_tag_name;

  # Step 1: Iterate over the target file till the
  # dest-hook is found in that file
  my $copy_file_name_tmp = $copy_file_name . "tmp";
  open (OUT, ">". $copy_file_name_tmp) ||
    die "cannot open temporary file for modying file:" . $copy_file_name;
  open (IN, "<" . $copy_file_name) ||
    die "cannot open file $copy_file_name specified in the <file> tag \n";

  my $dest_tag_found = 0; #check if tag matched
  foreach my $line (<IN>)
  {
    if ($line =~ /$dest_tag_name/)
    { $dest_tag_found = 1; print OUT $line; last; }

    print OUT $line;
  }
  close (IN);

  # If we reached the end of file before finding the tag!
  if (! $dest_tag_found)
  {
    print "\n Error: <dest-hook> tag missing in file .. aborting \n";
    close (DEST);
    close (IN);
    close (OUT);
    unlink ($copy_file_name_tmp);
    exit (1);
  }

  # Step 2: Now look in the destination file and look for the hooks
  # where one needs to copy. There could be multiple places where the
  # hook can be present. E.g.
  # .......
  # //@@ COPY_START_HOOK
  # ....
  # ....
  # //@@ COPY_END_HOOK
  # ....
  # ....
  # //@@ COPY_START_HOOK
  # ....
  # ....
  # //@@ COPY_END_HOOK
  # Handle this case

  my $line_matched = 0;
  my $start_copying = 0; # initially do not copy
  foreach my $line (<DEST>)
  {
    # Check if the line matches the start tag
    if ($line =~/$start_tag_name/)
    {
      $line_matched += 1;
      $start_copying = 1;
    }
    else
    {
      # Check if the line matches the end tag
      if ($line =~/$end_tag_name/)
      {
        # check if the start tag matched!
        if (! $line_matched)
        {
          print "Assertion error: <copy-hook-end> tag misplaced with \
                 the <copy-hoook-source> \n";
          close (DEST);
          close (IN);
          close (OUT);
          unlink ($copy_file_name_tmp);
          exit (1);
        }

        # decrement the count for nested tags
        $line_matched -= 1;
        if (! $line_matched )
          { $start_copying = 0; }
      }
      else
      {
        # Print out the line
        if ($start_copying)
          { print OUT $line; }
      }
    }
  }

  # At the end of this loop line_matched should be 0
  if ($line_matched)
  {
    print "Error: in $dest_file_name, number of <copy-hook-source> tags \
           did not match the number of <copy-hook-end> tags. Reverting \
           changes. \n";
    close (DEST);
    close (IN);
    close (OUT);
    unlink ($copy_file_name_tmp);
    exit (1);
  }

  # Step 3: Now copy data after the tag in the original file onto the destination
  # file.
  open (IN, "<" . $copy_file_name) ||
    die "cannot open file $copy_file_name specified in the <file> tag \n";
  $dest_tag_found = 0; #used as a flag
  foreach my $line (<IN>)
  {
    if ($dest_tag_found)
    { print OUT $line; }

    # If the hook is found, then don't write the hook onto OUT
    # as it would have been written earlier
    if (! $dest_tag_found &&
        $line =~ /$dest_tag_name/)
      { $dest_tag_found = 1; }
  }

  # Normal exit path
  close (IN);
  close (OUT);
  close (DEST);

  # Rename the tmp file to the file modified
  rename ($copy_file_name_tmp, $copy_file_name);
}

#################################################################
# commit_files: A procedure to commit all the copy files that
# were specialized back to the orginal files.
#################################################################
sub commit_files
{
  my ($path_name, $output_path_name, @files) = @_;

  # iterate over the file_name_list
  foreach my $file (@files)
  {
    # <file name="....">
    my $file_name = $file->getAttribute('name');

    # output_path == input_path then do an in place
    # substitution.
    if ($output_path_name eq $path_name)
    {
      rename ($path_name . "/" . $file_name . "copy",
              $path_name . "/" . $file_name);
    }
    else
    {
      # Check if the path_name exists. The path name
      # corresponds to a directory. So create it if it does
      # not exist.
      if (! -d $output_path_name)
      {
        #@@? Need to revert the *copy files?
        mkpath ($output_path_name, 0, 0744) ||
          die "cannot create $output_path_name: commit files failed! \n";
      }

      # move the specialized file to the output directory
      rename ($path_name . "/" . $file_name . "copy",
              $output_path_name . "/" . $file_name);
    }
  }
}

#### Main ########################################################
# Specialize_Component
# procedure to execute the transformations specified in the
# specialization file
##################################################################
sub Specialize_Components
{
  # Get the command line arguments
  my ($prefix_path, $spl_file, $output_prefix) = @_;

  my $parser = XML::DOM::Parser->new();
  my $doc = $parser->parsefile($spl_file);

  # Check if the prefix path ends with a / or not
  # if it does not then manually add the / to it
  my $last = substr ($prefix_path, -1);
  if ($last ne "/")
  { $prefix_path = $prefix_path . "/"; }

  # Entry Point: <transform> element
  foreach my $transform ($doc->getElementsByTagName('transform'))
  {
    # <module tags>
    foreach my $module ($transform->getElementsByTagName('module'))
    {
      # Complete path name to the module
      my $module_name = $module->getAttribute('name');
      my $path_name = $prefix_path . $module_name;

      # <file tags>
      my @files = $module->getElementsByTagName('file');
      foreach my $file (@files)
      {
	# <file name="....">
	my $file_name = $file->getAttribute('name');

	# Rather than modifying the files directly, make a local
	# copy of the files and then transform them and commit
	# if there is a file called foo we make a file foo_copy
	my $file_path_copy = $path_name . "/" . $file_name . "copy";
	my $file_path_name = $path_name . "/" . $file_name;

	copy ($file_path_name, $file_path_copy);

	# Diagnostic comment
	print "Instrumenting $file_name ..........";

        # <comment> ... </comment>
        my @comment_list = $file->getElementsByTagName ('comment');
        foreach my $comment (@comment_list)
        { Visit_Comment ($comment, $file_path_copy); }

        # <copy-from-source> ... </copy-from-source>
        my @copy_from_source_files =
          $file->getElementsByTagName ('copy-from-source');
        foreach my $copy_from_source (@copy_from_source_files)
        {
          Visit_Copy ($copy_from_source,
                      $file_path_copy,
                      $module_name,
                      $prefix_path);
        }

	# <remove> ... </remove>
	my @remove_list = $file->getElementsByTagName ('remove');
        foreach my $remove (@remove_list)
	{ Visit_Remove ($remove, $file_path_copy); }

	# <substitute ... </substitute>
	my @substitute_list = $file->getElementsByTagName ('substitute');
	foreach my $substitute (@substitute_list)
	{ Visit_Substitute ($substitute, $file_path_copy); }

	# <add> <hook> ...... </hook> <add>
	my @add_list = $file->getElementsByTagName ('add');
	foreach my $add (@add_list)
	{ Visit_Add ($add, $file_path_copy); }

	# Everything went well.. Print success
	print " [done] \n";
      }
    }

    # At this point all the specializations in all the modules have
    # succeeded. It is at this point that we need to commit the
    # specializations in each of the modules. That is move the temporary
    # file that we created to the main file that was specialized.
    # This also means that we need another loop and do the same thing
    # as above....
    # <module tags>
    foreach my $module ($transform->getElementsByTagName('module'))
    {
      # Complete path name to the module
      my $module_name = $module->getAttribute('name');
      my $path_name = $prefix_path . $module_name;

      # Output path name: append output_prefix to the
      # current module name. Append "/" to create a
      # directory like /foo/bar/baz/
      my $output_path = $output_prefix . "/" . $module_name;

      # <file tags>
      my @files = $module->getElementsByTagName('file');

      # commit the files
      commit_files ($path_name, $output_path, @files);
    }
  }
}

####
# Requiured for a module
####
1;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区电影| 色婷婷久久久久swag精品| 精品卡一卡二卡三卡四在线| 六月丁香婷婷久久| 亚洲精品一区二区三区99| 国产美女久久久久| 亚洲同性同志一二三专区| 91蜜桃网址入口| 亚洲成人动漫在线观看| 日韩欧美国产一二三区| 国产福利一区二区| 亚洲欧美另类综合偷拍| 9191久久久久久久久久久| 国产麻豆精品在线观看| 亚洲精选一二三| 日韩三级视频在线看| 丰满岳乱妇一区二区三区| 亚洲一区二区三区在线播放| 日韩视频免费观看高清完整版| 国产成人免费视频一区| 亚洲一区二区精品久久av| 精品sm在线观看| 色国产综合视频| 久久精品999| 一区二区三区中文字幕在线观看| 欧美一级欧美一级在线播放| 国产成人在线看| 亚洲第四色夜色| 欧美国产1区2区| 欧美欧美欧美欧美首页| 大尺度一区二区| 日韩国产欧美视频| 亚洲色图一区二区| 日韩欧美国产wwwww| 99久久精品国产麻豆演员表| 奇米四色…亚洲| 亚洲精品国产一区二区精华液 | 91精品国产91热久久久做人人| 国产自产高清不卡| 一区二区三区在线免费视频| 久久综合成人精品亚洲另类欧美| 精品婷婷伊人一区三区三| 国产aⅴ综合色| 美女尤物国产一区| 亚洲一区视频在线观看视频| 欧美激情一区二区三区不卡 | 在线观看亚洲a| 国产福利不卡视频| 蜜臀91精品一区二区三区| 一区二区三区在线观看国产| 国产亚洲欧美日韩俺去了| 欧美精品欧美精品系列| 一本大道久久a久久综合| 国产精品一二三四五| 卡一卡二国产精品| 日本不卡视频在线| 婷婷六月综合网| 亚洲永久精品国产| 亚洲日本青草视频在线怡红院 | 日韩视频免费观看高清完整版在线观看| 99久久99久久免费精品蜜臀| 国产在线国偷精品产拍免费yy| 午夜精品视频一区| 一区二区三区资源| 一区二区三区小说| 一区二区三区波多野结衣在线观看 | 国产在线国偷精品免费看| 国产iv一区二区三区| 国产一区二区三区在线观看免费| 蜜桃传媒麻豆第一区在线观看| 视频一区二区三区在线| 亚洲福利视频三区| 视频一区二区欧美| 天堂va蜜桃一区二区三区漫画版| 亚洲一区二区三区国产| 亚洲午夜激情网页| 亚洲国产精品一区二区久久恐怖片| 亚洲欧美精品午睡沙发| 亚洲人成伊人成综合网小说| 亚洲少妇30p| 亚洲一区二区免费视频| 亚洲123区在线观看| 青青草国产精品亚洲专区无| 日本aⅴ免费视频一区二区三区| 免费成人小视频| 美女精品自拍一二三四| 国产在线乱码一区二区三区| 国产揄拍国内精品对白| 韩国v欧美v亚洲v日本v| 国产传媒一区在线| 白白色 亚洲乱淫| 91久久精品日日躁夜夜躁欧美| 91成人网在线| 日韩免费看网站| 国产欧美精品一区二区色综合朱莉| 国产欧美精品日韩区二区麻豆天美| 国产日本欧美一区二区| 亚洲精品日韩专区silk| 日韩高清一区在线| 欧美日韩国产综合视频在线观看 | 成人91在线观看| 欧美亚洲愉拍一区二区| 日韩一区二区三区高清免费看看| www久久精品| 亚洲欧美一区二区三区孕妇| 亚洲va韩国va欧美va精品| 麻豆国产欧美一区二区三区| 成人性生交大片免费看中文| 欧洲激情一区二区| 亚洲精品在线免费观看视频| 最新热久久免费视频| 丝袜亚洲精品中文字幕一区| 国产九色精品成人porny| 色婷婷av久久久久久久| 欧美一区二区日韩一区二区| 中国色在线观看另类| 亚洲18影院在线观看| 成人黄色免费短视频| 91精品国产综合久久婷婷香蕉| 久久精品亚洲乱码伦伦中文| 午夜欧美大尺度福利影院在线看| 国产福利一区二区三区视频| 欧美视频在线观看一区| 国产精品国产a级| 乱一区二区av| 欧美日韩国产三级| 1000部国产精品成人观看| 久久精品国产99| 欧美日韩国产小视频在线观看| 国产欧美日韩综合精品一区二区| 亚洲电影你懂得| 91影视在线播放| 久久精品视频免费| 日韩av中文字幕一区二区| 波多野结衣一区二区三区| 日韩精品中文字幕在线一区| 亚洲一本大道在线| 91亚洲精品久久久蜜桃网站| 久久亚洲影视婷婷| 看片的网站亚洲| 91精品国产综合久久久久久漫画| **性色生活片久久毛片| 丁香六月久久综合狠狠色| 精品免费99久久| 日韩精品一级中文字幕精品视频免费观看 | 久久亚洲精品国产精品紫薇| 日韩激情一二三区| 欧美三区在线观看| 一区二区三区欧美视频| 99视频精品全部免费在线| 久久精品人人爽人人爽| 国内精品免费在线观看| 欧美电视剧在线观看完整版| 日韩精品国产精品| 欧美精品久久一区二区三区| 亚洲在线成人精品| 91国产福利在线| 亚洲电影视频在线| 欧美精品tushy高清| 日韩制服丝袜av| 9191久久久久久久久久久| 天天综合日日夜夜精品| 欧美日本韩国一区二区三区视频 | 国产成人综合自拍| 久久久国产精品不卡| 精品系列免费在线观看| 精品国产91九色蝌蚪| 国内精品写真在线观看| 久久久久久久电影| 懂色av一区二区三区免费看| 国产午夜精品一区二区三区嫩草| 国产91精品一区二区麻豆亚洲| 国产欧美日韩综合精品一区二区| 粉嫩蜜臀av国产精品网站| 中文字幕中文在线不卡住| 国产亚洲一区二区三区四区| 国产不卡视频一区| 亚洲视频小说图片| 欧美午夜在线观看| 青青青伊人色综合久久| 久久久精品国产免费观看同学| 国产成人福利片| 亚洲精品日韩综合观看成人91| 欧美伊人久久久久久久久影院 | 18欧美乱大交hd1984| 日本道色综合久久| 日日夜夜精品视频免费| 久久久久久久性| 色乱码一区二区三区88| 亚洲6080在线| xf在线a精品一区二区视频网站| 高清不卡在线观看av| 一区二区免费视频| 欧美精品一区二区三| 本田岬高潮一区二区三区| 亚洲午夜视频在线观看| 精品乱码亚洲一区二区不卡| 粉嫩欧美一区二区三区高清影视| 一二三四社区欧美黄| 亚洲精品一区二区在线观看|