Parser rewriten, FSM used.