initial program parsing logic