implement contextual api for parser