-
Notifications
You must be signed in to change notification settings - Fork 125
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
Allow external lexer to be configured with Live Preview #44
Comments
"Existing lexer" is a program with any side-effects and 3rd party dependencies possible. |
To clarify, I meant a lexer created by JFlex using a separate (hand-made) *.flex file rather than one generated from Grammar-Kit's BNF. |
The point is that *.flex can contain arbitrary java code, states, imports... |
Naively, I would have thought it possible for Grammar-Kit to expose the requirements of any lexer that's going to work with it. Thus, if someone has a separately defined lexer then they could adapt it as appropriate. Perhaps you could provide some guidance on how I might explore this in code. If I had to guess, I'd start by extracting an interface from LivePreviewLexer and then I'd implement a class that delegates to a JFlex lexer. |
"JFlex lexer" can stand for 3 different entities: a flex file, a java file, a class file. How exactly the delegation to a JFlex lexer could look like in LivePreviewLexer.java ? The requirement for a lexer is already in IntelliJ Platform, it is Lexer interface (com.intellij.lexer). |
I don't know, that's why I was asking for guidance. I'd assume that one would prefer to develop a lexer via the flex file, and then be able to configure Grammar-Kit/LivePreview to use the generated java class; I'm confused about why you'd make a distinction between the java source and the compiled class file - are you asking about some more exotic reflection/bytecode/aspect approach? Anyway, I didn't expect this be a confusing feature request because on https://github.com/JetBrains/Grammar-Kit, I read:
Thus, I assumed it would be reasonable to ask that LivePreview be usable with such a provided lexer. |
Any news on this ? live-preview is a mighty tool, and it'd be unfortunate to not be using it becaus of this limitation |
Live Preview is a great feature; it'd be even more useful if you could configure an existing lexer rather than approximating an existing one within the BNF.
This issue was prompted by:
http://devnet.jetbrains.com/message/5521947#5521947
The text was updated successfully, but these errors were encountered: