moved constants, implemented parser as generator