G

Inspire

Summary Included libraries Package variables Synopsis Description General documentation Methods

Summary
G::Inspire.pm G-language Inspire Core API
Package variables top
Globals (from use vars definitions)
@EXPORT
$VERSION
@EXPORT_OK
Privates (from my definitions)
%data;
$hsGCF;
Included modulestop
Cwd
G::Messenger
strict
Inherit top
AutoLoader Exporter
Synopsistop
  use G::Inspire;
Descriptiontop
  blah blah blah
Methodstop
OnExecuteNo descriptionCode
OnGenerateNo descriptionCode
OnSaveNo descriptionCode
SetScriptNo descriptionCode

Methods description


Methods code

OnExecutedescriptiontopprevnext
sub OnExecute {
  my $msg = '';

  G::Messenger::msg_error("Start Analysis:\n");

  {
	no strict 'refs';
        $msg = &{"G::System::" . $data{'engine'} . '::' 
		     . $data{'engine'} . '_engine'}($data{'script'}, -src=>"");
  }

  sleep(1);
  chdir('../') unless ($msg eq 'HOGE');

  G::Messenger::msg_error("Done.\n");
}
OnGeneratedescriptiontopprevnext
sub OnGenerate {
    my $str = shift;

    {
	no strict 'refs';
        &{"G::System::" . $data{'engine'} . '::' . $data{'engine'}
	  . '_engine'}($data{'script'}, -src=>"$str");
    }

    &G::Messenger::msg_error("Script generated.\n");
}
OnSavedescriptiontopprevnext
sub OnSave {
  my $script = shift;
  $hsGCF = shift;
  my $out = '';

  {
	no strict 'refs';
        $out = &{"G::System::" . $data{'engine'} . '::' . $data{'engine'} . 
		'_scripter'}($hsGCF);
  }

  open(OUT, '>' . $script) || G::Messenger::msg_error("Cannot open the file to save.\n");
  print OUT $out;
  close(OUT);

  &G::Messenger::msg_error("Saved GCF.\n");
}
SetScriptdescriptiontopprevnext
sub SetScript {
    my $script = shift;

    $data{'script'} = $script;

    unless(lstat $data{'script'}){
	G::Messenger::msg_error("Error: No such GCF script - " , $data{'script'}, "\n");
	return;
    }

    open(FILE,$data{'script'});
    while(<FILE>){
    	$data{'engine'} = $1 if(/>Engine:\s(.+)/);
    	$data{'configure'} = $1 if(/>Configure:\s(.+)/);
    }
    close(FILE);

    my $tmp = $data{'engine'};
    my $evalstr = 'G::System::' . $tmp . '::' . $tmp;
    $evalstr .= "\_parser";

    {
	no strict 'refs';
	$hsGCF = &{$evalstr}($script);
        G::Messenger::msg_error("Engines set from GCF.\n");
    }

    return $hsGCF;
}

General documentation

AUTHOR top
  Kazuharu Gaou Arakawa, gaou@g-language.org
SEE ALSO top
perl(1).