Rule between different files with different extensions

Hi SonarSourcers !

I’ve developed my own plugin and have started writing custom rules for this language I analyze.

I was wondering if it was possible for a rule to use different files in order to raise issues, maybe even files with different extensions.

Edit for clarification: I don’t need to have a grammar for the other file. A basic string existence check is enough.

Example :

I see a variable being used in the file I’m analyzing, and I’d like to check if it is declared in another file with a different extension.

Is there any way I can do this ?

Have a nice day !