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

LivePreview for Lexer #301

Open
ris58h opened this issue Nov 3, 2022 · 4 comments
Open

LivePreview for Lexer #301

ris58h opened this issue Nov 3, 2022 · 4 comments

Comments

@ris58h
Copy link

ris58h commented Nov 3, 2022

I would like to check what tokens are produced by a lexer that specified in a .flex file.
We have LivePreview for Parser. Could we have LivePreview for Lexer too? Without it developing a lexer is such a PITA.

@gregsh
Copy link
Collaborator

gregsh commented Nov 3, 2022

Without it developing a lexer is such a PITA.

A simple lexer test makes it quite tolerable IMO.

@gregsh
Copy link
Collaborator

gregsh commented Nov 3, 2022

JFlex is a state machine plus a user-defined java code that can also mess with states.

The user-defined code sections limit our possibilities to only one option - to reuse the generated lexer class.

So here's the idea of a quick way to do that without messing with javac:

If the lexer depends only on token-type constants and JDK then it is possible to load it as a groovy script into a javax.scripting groovy engine.

See also #44

@ris58h
Copy link
Author

ris58h commented Nov 3, 2022

A simple lexer test makes it quite tolerable IMO.

I need it for debug, not for verification. IDE should provide good UX IMO.

to reuse the generated lexer class

I believe so.

See also #44

I'm aware of #44, but it seems like a Parser LiveView improvement, although it's related to a lexer.

@thirteenthree
Copy link

any update;

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

No branches or pull requests

3 participants