RegParser: make it stateless