I need to be able to show an embedded instance of the source editor for an ad hoc expression from my custom language. This is very similar to the Evaluate Expression window from the Java debugger, though the usage is different. I've been looking at that code and trying to understand how it works, but it's pretty dense. As a result, I was hoping for guidance on how best to do this from the community. As I see it, there are two primary questions here...
The first question is whether I need to have my parser explicitly support these expressions as an entry point for parsing. Right now the only entry points are standard compilation units, e.g., classes, interfaces, enums, etc. I can obviously do this, but if it's possible to specify an alternative entry point for parsing for a specific purpose, that would be ideal. If it is possible to tell parsing to begin at some other non-terminal, how does that work? Is there some example out there for reference?
The second question is how I can host a fully-functional source editor in my own panel. I want the user experience to be just as if the expression were being edited in a file editor if possible...syntax highlighting, completion, references, etc. Then I just need to be able to get the source body and use it. Again, any pointers to existing code that does this is HUGELY appreciated!
Thanks much for any help!
UPDATE: It looks like LanguageTextField exists for exactly this purpose assuming your Language can handle the expression/block as an entry point for parsing. For the moment I think I'll proceed under the assumption that I'll need to allow that, but any tips on how to start parsing at alternative grammar rules are appreciated.