ASTNode.getText() return empty after addToken() in lexer?
Hello,
I am working on a language which has macro need to be expanded (It's like #define macroName other code in C++ language.)
Though adding expanded tokens in LookAheadLexer when came across macroName reference, the PSI structure builds up successful.
But for the added tokens, which are at the same position in lexer, their associated ASTNode.getText() return empty.
I want to build up an AST tree that would not feel the macro, because all the macro has been expanded in lexer. The method I tried:
1, add TokenWrapper in addToken function;
2, add TokenWrapper which implemented ILeafElementType in addToken function
Both of them failed.
Then I wrote some c++ language macro in CLion, it seems that CLion did not parse macro code to offer completion feature either.
So, Is it POSSIBLE to build such an AST tree? Do I have to rewrite PsiBuilder?
This might be a quite complex and high level question, any advice would be appreciated. Thanks in advance.
Please sign in to leave a comment.