Erlang lexing and parsing framework