void Syntaxer::CleanupOnFailure() { SyntaxTree tree; for (int i = 0; i < (int)stack_->symbols.size(); ++i) { if (stack_->symbols[i].SymbolType() == GrammarSymbolNonterminal) { tree.SetRoot((SyntaxNode*)stack_->values[i]); tree.Destroy(); } } stack_->clear(); }