Is it a bug of plugin? #645
Unanswered
UniquePerch
asked this question in
Q&A
Replies: 1 comment
-
Hi, In your current grammar, the input
But because the lexing phase happens before the parsing phase, ANTLR will match it to a I think you should rework your grammar to transform your |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example:
I have a parser defination of [seq]:
Notice the last defination of [seq] : seq_function SEMI?
It has been defined as followd:
I also have a lexer defination of [POINT_D] (defined in another g4 file):
![image](https://private-user-images.githubusercontent.com/92765498/248631511-578b3e70-9de6-47dc-b1e3-7c23595e1be8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTcwNjcsIm5iZiI6MTczOTYxNjc2NywicGF0aCI6Ii85Mjc2NTQ5OC8yNDg2MzE1MTEtNTc4YjNlNzAtOWRlNi00N2RjLWIxZTMtN2MyMzU5NWUxYmU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDEwNTI0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU0OGE0MzU0NzFkNzEzMGIxZjdjNzliOTZlOWU4YmM1NjUwNWZiYmI3NGNkOTEzMTY2NDQzMzljNjBjZGJmOGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.yq1lkDAkRwz_TvAojrehpy_uLVebIAbkVKH66xY73sg)
Then I import a whole lexer defination(However,if I use tokenVocab to associated lexer file, it also happens),use the plugin to generate parse tree(input:"seq(1,2)"), something unexpected happened , plugin regard my input "(1,2)" as a POINT_D lexer.
![image](https://private-user-images.githubusercontent.com/92765498/248632294-c0ed6460-69ec-4c52-a7ae-a36ab3f89b48.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTcwNjcsIm5iZiI6MTczOTYxNjc2NywicGF0aCI6Ii85Mjc2NTQ5OC8yNDg2MzIyOTQtYzBlZDY0NjAtNjllYy00YzUyLWE3YWUtYTM2YWIzZjg5YjQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDEwNTI0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU4NTA2NDgyMWExNzZiZTk0MTQ5NjAzYmRmMTA3MGE0YmZmZTQwMThhOGZkYWIxNjBhYzcxMTFiMzQwNzUzYWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wHnzl3kojmHZ18A-GQKT2P3T6-UCrLgYubC5LsZokgM)
I don't know whether it is my mistake or it is just a bug of this plugin?
Beta Was this translation helpful? Give feedback.
All reactions