This involves playing heavily with the parser pgen2. We use its stack to check for all possible tokens/keywords.