oowekyala / intellij-javacc

JavaCC and JJTree grammar support for the IntelliJ Platform
https://plugins.jetbrains.com/plugin/11431-javacc
MIT License
44 stars 6 forks source link

Undefined token errors with user token manager #20

Closed tmoonkey closed 1 year ago

tmoonkey commented 2 years ago

If USER_TOKEN_MANAGER=true option is used, i.e. if tokens are not defined in the jj file, then all tokens are highlighted in red and the corresponding Undefined lexical token name "..." problems are generated. It'd be nice if it instead highlighted all <FOO> instances as valid tokens. Even better if there was a way to define the list of valid tokens, but I don't see how it can be done in javacc grammar.

oowekyala commented 2 years ago

I'm not familiar with how Javacc handles external tokens. Don't you still have to declare their names in the file? Does it just allow any name with the syntax <TOK>?

If so, maybe this could be done via a comment... Like

// JAVACC_TOKENS A, B, C

with the valid token names