parser fixes, scanner refractoring (part 2), some CodeGen code