# include "../lexgen1/ldefs.c"

start(s, fp)
	char *s;
	int *fp;
{
	char tp[30], *t;
	int k, *fi;
fi = fp;
switch(*s)
	{
	case '^': /* beginning of line state 2 */
		s++;
		*fp++ = 2;
		break;
	case '<':
		for(s++; *s && *s != '>'; )
			{
			t = tp;
			while (index(*s, ",>") < 0)
				*t++ = *s++;
			*t = 0;
			k = startnam(tp)->ii;
			if (k==0)
				warning("unknown start condition %s", tp);
			else
				*fp++ = k;
			if (*s==',') s++;
			}
		s++;
		if (*s == '^') /* combination of <> and ^ */
			{
			s++;
			while (fi < fp)
				(*fi++)++;
			}
		break;
	default: /* normal case, start state 1 */
		*fp++ = 1;
		break;
	}
*fp= 0;
return(s);
}
