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;
|
||||
}
|
||||
|
||||
|
||||
die("$0: no pattern given.\n") unless $pattern;
|
||||
|
||||
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_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(open(FLEX, $tmpfile_l)) {
|
||||
while(<FLEX>) {
|
||||
print @_;
|
||||
}
|
||||
close FLEX;
|
||||
}
|
||||
else {
|
||||
print "Unable to open file $tmpfile_l\n";
|
||||
}
|
||||
exit 0;
|
||||
# w tych `` nie dziala
|
||||
system "cat $tmpfile_l";
|
||||
# if(open(FLEX, $tmpfile_l)) {
|
||||
# while(<FLEX>) {
|
||||
# print @_;
|
||||
# }
|
||||
# close FLEX;
|
||||
# }
|
||||
# else {
|
||||
# print "Unable to open file $tmpfile_l\n";
|
||||
# }
|
||||
exit(0);
|
||||
}
|
||||
|
||||
`flex -o$tmpfile_c $tmpfile_l`;
|
||||
`cc -O3 -o $tmpfile_x $tmpfile_c -lfl`;
|
||||
`$tmpfile_x`;
|
||||
#`$tmpfile_x`;
|
||||
|
||||
system "$tmpfile_x";
|
||||
|
||||
unlink $tmpfile_l;
|
||||
unlink $tmpfile_c;
|
||||
|
Loading…
Reference in New Issue
Block a user