Reorganize lexer/parser in lib