nawk use

I found a command who prints x lines before and after a line who contain a searched string in a text file.
The command is :
-------------------
nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=2 a=4 s="string" file1

...where "b" and "a" are the number of lines to print before and after string "s".
-------------------

It works very well but I can't understand the syntax, too difficult with "man nawk". Is that some one who will be able to comment this syntax ?

Thank's in advance, best regards and happy new year.

'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}'
has 3 pattern-action statements:
1) c-->0;
2) $0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}
3) b{r[NR%b]=$0}

The first one has no explicit action so the action is to simply print the entire record. But in this case the semicolon is needed so that it doesn't run in to the second staement. The second statement has an explicit action which is in braces and the braces are enough to separate it from the third. Now consider these statements in reverse order...

3) b{r[NR%b]=$0}
The pattern is b, which is asking if b is equal to zero. If b is non-zero we need to save records in case we need them later. But if b is zero, we can skip this since we do not want any "before" records displayed. If b is, say, 5, we will always have the last 5 records in the r array.

2) $0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}
The pattern $0~s simply asks if the record matches the search criteria we stored in s. If so and if b is non-zero, we print those records that we saved in step 3 above. Then we print the current record. Then c=a sets up the next step to be explained...

1) c-->0;
c gets set to a (number of "after" records) when we find a match. The c-- part decrements c after we use it. And we use it to see if it is greater than zero. This is how the "after" records are printed.

I understand better ! And maybe "NR%b" means "NR modulo b" ...

I will take more time to analyse but thank's a lot