Napawiony ser - musialem przerobic z powrotem te
na system w dwoch liniach.
(Wyglada na to, ze program uruchomiony w tych ` ` nie ma lacznosci z konsola) git-svn-id: svn://atos.wmid.amu.edu.pl/utt@20 e293616e-ec6a-49c2-aa92-f4a8b91c5d16
This commit is contained in:
parent
2fe08ac317
commit
e2bde98bb1
@ -96,6 +96,7 @@ END
|
|||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
die("$0: no pattern given.\n") unless $pattern;
|
die("$0: no pattern given.\n") unless $pattern;
|
||||||
|
|
||||||
die("$0: flex template file not found") unless
|
die("$0: flex template file not found") unless
|
||||||
@ -154,26 +155,32 @@ my $defaultaction = ($only_matching) ? '' : 'ECHO';
|
|||||||
(undef, my $tmpfile_c) = File::Temp::tempfile(SUFFIX=>'.c');
|
(undef, my $tmpfile_c) = File::Temp::tempfile(SUFFIX=>'.c');
|
||||||
(undef, my $tmpfile_x) = File::Temp::tempfile();
|
(undef, my $tmpfile_x) = File::Temp::tempfile();
|
||||||
|
|
||||||
|
# w tych `` nie dziala
|
||||||
|
#`m4 "--define=PATTERN=$flexpattern" "--define=DEFAULTACTION=$defaultaction" $flextemplate > $tmpfile_l`;
|
||||||
|
|
||||||
`m4 "--define=PATTERN=$flexpattern" "--define=DEFAULTACTION=$defaultaction" $flextemplate > $tmpfile_l`;
|
system "m4 \"--define=PATTERN=$flexpattern\" \"--define=DEFAULTACTION=$defaultaction\" $flextemplate > $tmpfile_l";
|
||||||
|
|
||||||
if($flex)
|
if($flex)
|
||||||
{
|
{
|
||||||
if(open(FLEX, $tmpfile_l)) {
|
# w tych `` nie dziala
|
||||||
while(<FLEX>) {
|
system "cat $tmpfile_l";
|
||||||
print @_;
|
# if(open(FLEX, $tmpfile_l)) {
|
||||||
}
|
# while(<FLEX>) {
|
||||||
close FLEX;
|
# print @_;
|
||||||
}
|
# }
|
||||||
else {
|
# close FLEX;
|
||||||
print "Unable to open file $tmpfile_l\n";
|
# }
|
||||||
}
|
# else {
|
||||||
exit 0;
|
# print "Unable to open file $tmpfile_l\n";
|
||||||
|
# }
|
||||||
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
`flex -o$tmpfile_c $tmpfile_l`;
|
`flex -o$tmpfile_c $tmpfile_l`;
|
||||||
`cc -O3 -o $tmpfile_x $tmpfile_c -lfl`;
|
`cc -O3 -o $tmpfile_x $tmpfile_c -lfl`;
|
||||||
`$tmpfile_x`;
|
#`$tmpfile_x`;
|
||||||
|
|
||||||
|
system "$tmpfile_x";
|
||||||
|
|
||||||
unlink $tmpfile_l;
|
unlink $tmpfile_l;
|
||||||
unlink $tmpfile_c;
|
unlink $tmpfile_c;
|
||||||
|
Loading…
Reference in New Issue
Block a user