This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
My company used to use Schliemann in our RCP base on NetBeans 6.0. I added an ParserManagerListener to the parserManager to prevent switching to another panel if the ParserManager was still parsing. However, when my company switched to 6.1 I have noticed ParserManagerListener does not notify when the state becomes State.PARSING. This is because in the fire2() method of the org.netbeans.modules.languages.ParserManagerImpl class, the firing of the listeners is located after this check: " if (state == State.PARSING) return;". This is very important to me, because I have to work with the tokens generated by the parser. Moreover, it would be wonderful, if there were methods in the ParserManager interface to know if there are any parsing errors. Something like getSyntaxErrors() in ParseManagerImpl Thanks for your help!
Created attachment 71970 [details] Patch (untested) should reverse the code
Use ParserManager.hasSyntaxError () (in NetBeans 6.5), please.
Thanks a lot for the quick answer, but it only answers to the first part of the question. How do I know when it has finished parsing? Sorry I must use 6.1 because my company uses it.
Yes, we are not firing parsing state, and we do not want to fire it. Doing such change is dangerous, because other clients can fail in this case. I do not understand why you need to know, when parser starts. Why do you want to prevent switching to other panel? You should not depend on such event! This use case is just not supported.
The reason I need to know when the parser is parsing is this: I was asked to use Schliemann to define our company language and then to build an Object model around it (like jaxb or schema2Beans). By using the Object model I can modify Schliemann tokens. For instance: ASTNode node = ... MyObject obj = new MyObject(node); obj.setVariance(6.0); .... .... //(switch to textual view) editorPane.setText(obj.toString); I have a sort of MultiView application. When the user switch from the textual view to the gui view I take the AST from the textual view, I wrap it with my Object model and then I use the Object model in the gui panels. If The AST is not updated when the Object Model will contain un-updated data as well If you do not revert back the code we'll have to use a patched version of the module, or find some weird workaround. if I add my patch to the module, does it break anythig? thank you a lot and sorry for the nuisance