void ParsingProcInternal() { while(true) { WString currentParsingText; { SpinLock::Scope scope(parsingTextLock); currentParsingText=parsingText; parsingText=L""; } if(currentParsingText==L"") { isParsingRunning=false; break; } List<Ptr<ParsingError>> errors; Ptr<ParsingTreeObject> node=grammarParser->Parse(currentParsingText, L"ParserDecl", errors).Cast<ParsingTreeObject>(); Ptr<ParserDecl> decl; if(node) { node->InitializeQueryCache(); decl=new ParserDecl(node); } { SpinLock::Scope scope(parsingTreeLock); parsingTreeNode=node; parsingTreeDecl=decl; node=0; } RestartColorizer(); } parsingRunningEvent.Leave(); }
~GrammarColorizer() { finalizing=true; parsingRunningEvent.Enter(); parsingRunningEvent.Leave(); }