refactored parser to use boolean token properties for type checks