reworking static analysis to be based on tokens only