[cfe-dev] What is the walk-through to add custom Identifier recognizer to clang ?

MohsenTi via cfe-dev cfe-dev at lists.llvm.org
Fri Nov 16 05:40:12 PST 2018


Hi,
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:

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

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?

--
Regards,
Mohsen Timar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20181116/e0a5a4c0/attachment.html>


More information about the cfe-dev mailing list