use shared pointers in lexerfactory, win32 patch