What is the walk-through to add custom Identifier recognizer to clang ?

I want to add a custom Identifier recognizer to clang compiler that allows it access to the members of selected object, for example see the code below:

#include <iostream>
using namespace std;
class XY {
void printX() { cout << "X" << endl; }
void printY() { cout << "Y" << endl; }
int main() {
XY xy;
with(xy) {
return 0;

I’ve added “with” token(keyword), statement, parser, semantic, recursive ast visitor, tree transform and all other requirements to parse concept statement.
All parsing routine are fine follow by " use of undeclared identifier ‘printX’ " and " use of undeclared identifier ‘printX’ " errors.
What are the complement works which has to be done after what I have said so far to allow compiler detect selected object members?