From a572c0b728334e1990f15c7785b711c1f8164175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 6 Nov 2013 12:38:58 +0100 Subject: [PATCH] AST : cleanup unused functions --- lib/token.cpp | 38 -------------------------------------- lib/token.h | 2 -- 2 files changed, 40 deletions(-) diff --git a/lib/token.cpp b/lib/token.cpp index ede52f5cf..4c7496a5c 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -1143,44 +1143,6 @@ void Token::astOperand2(Token *tok) _astOperand2 = tok; } -void Token::astFunctionCall() -{ - _astOperand1 = _next; - _next->_astParent = this; -} - -void Token::astHandleParentheses() -{ - // Assumptions: - // * code is valid - // * _str is one of: ( ) ] - - Token *innerTop; - if (Token::Match(this, ")|]")) - innerTop = _previous; - else if (_next && _next->_str == ")") - return; - else { // _str = "(" - innerTop = _next; - while (Token::simpleMatch(innerTop->link(),") )")) - innerTop = innerTop->_next; - if (innerTop && innerTop->_str == "(") - innerTop = innerTop->_link->_next; - } - while (innerTop && innerTop->_astParent) - innerTop = innerTop->_astParent; - - if (_astParent) { - if (_astParent->_astOperand2 == this) - _astParent->_astOperand2 = innerTop; - else if (_astParent->_astOperand1 == this) - _astParent->_astOperand1 = innerTop; - innerTop->_astParent = _astParent; - _astParent = NULL; - } -} - - void Token::printAst() const { bool title = false; diff --git a/lib/token.h b/lib/token.h index e6e24741d..4e298c7b5 100644 --- a/lib/token.h +++ b/lib/token.h @@ -655,8 +655,6 @@ private: public: void astOperand1(Token *tok); void astOperand2(Token *tok); - void astFunctionCall(); - void astHandleParentheses(); const Token * astOperand1() const { return _astOperand1;