Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to modify tokens tree programmatically with BaseListener? #25

Open
yasamprom opened this issue Jul 13, 2022 · 3 comments
Open

How to modify tokens tree programmatically with BaseListener? #25

yasamprom opened this issue Jul 13, 2022 · 3 comments
Labels

Comments

@yasamprom
Copy link

In my language I have TAB and UNTAB tokens (it is important like in Python). It is impossible to process TAB and UNTAB in grammar.g4 correctly so I need special class (I guess it is BaseListener) for processing TAB/UNTAB when I enter some rules.
How to make my BaseListener work in background? This class now is highlighted with grey color, it is not used. Where should I create it?

@parrt
Copy link
Member

parrt commented Jul 13, 2022

Do you mean's plugin's parse tree view or arbitrary antlr code altering parse tree? It's typically modified by constructing new parse tree or other from auto-generated tree.

@parrt parrt added the question label Jul 13, 2022
@yasamprom
Copy link
Author

Do you mean's plugin's parse tree view or arbitrary antlr code altering parse tree? It's typically modified by constructing new parse tree or other from auto-generated tree.

I guess I need ParseTreeView. My purpose is to add TAB and UNTUB in my PSI programmatically. And I want to do it in background, while user is typing characters. I didn't find examples how to do that

@parrt
Copy link
Member

parrt commented Jul 15, 2022

Hmm...ok, yeah, I'm afraid I just can't remember how all this works :( Sorry!
Ter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants