Refactors parser traits to use abstract syntax classes.