%{

#include <stdio.h>
#include <string.h>

#define DEBUG

char sectname[256];

int filenum = 0;
int homefile = 1;

%}

%%

^"<@@sect>".*$		{ filenum++; homefile=0; }
^"<@@endsect>".*$	{ homefile=1; }

^"<@@label>".*$		{

strcpy( sectname, yytext+9 );
printf( "<@@labelp>%s#%d\n", sectname, homefile?0:filenum );

}

.|\n			;



