improve sloc (use yacc, move away generated greg.c)