code: func (m *matcher) init(prog *syntax.Prog, n int) error {
  	m.prog = prog
  	m.dstate = make(map[uint32]*dstate)
  	m.numMatch = n
  	m.maxState = 10
  	m.allTail = &m.all
  	m.numByte = 256
  	for i := range m.undo {
  		m.undo[i] = byte(i)
  	}
  	m.h = fnv.New32()
  
  	m.z1.q.Init(uint32(len(prog.Inst)))
  	m.z2.q.Init(uint32(len(prog.Inst)))
  	m.z3.q.Init(uint32(len(prog.Inst)))
  	m.ids = make([]int, 0, len(prog.Inst))
  
  	m.addq(&m.z1.q, uint32(prog.Start), syntax.EmptyBeginLine|syntax.EmptyBeginText)
  	m.z1.flag = flagBOL | flagBOT
  	m.start = m.cache(&m.z1, nil, 0)
  
  	m.z1.q.Reset()
  	m.addq(&m.z1.q, uint32(prog.Start), syntax.EmptyBeginLine)
  	m.z1.flag = flagBOL
  	m.startLine = m.cache(&m.z1, nil, 0)
  
  	m.crunchProg()
  
  	return nil
  }
docs: // init initializes the matcher.