Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I did a macro assembler in awk, but it was unsatisfactorily
complex. The key issue is having one input line from a source file
generate multiple lines that then should be processed by the main
loop.
For example:
<input file>
THISISAMACRO "test",2,xxx
</input file>
And after this I would like to process 2-to-n different $0 lines in my
main awk pattern testing loop. So THISISAMACRO might emit
$0 = command "test",2
then
$0 = command2 "test",xxx
etc.
So maybe my awk code is
/THISISAMACRO/ { for (i=0;i<3;i++) { $0="command" $i; next;} }
and this wont work because "next" will rip me out of the for loop and
at best I will get only the first line of the expansion, and maybe it
will not even get this if it overwrites my $0 with the next input
line.
Any ideas?
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.