/// <summary> /// Extracts the name of the member being called from the base class. /// </summary> /// <param name="parentExpression">The expression containing the tokens.</param> /// <param name="baseToken">The 'base' keyword token.</param> /// <returns>Returns the name of the member or null if there is no member name.</returns> private static Token ExtractBaseClassMemberName(Expression parentExpression, Token baseToken) { Param.AssertNotNull(parentExpression, "parentExpression"); Param.AssertNotNull(baseToken, "baseTokenNode"); Debug.Assert(baseToken.TokenType == TokenType.Base, "Incorrect token type."); bool foundMemberAccessSymbol = false; for (Token next = baseToken.FindNextToken(); next != null; next = next.FindNextToken()) { if (foundMemberAccessSymbol) { if (next.TokenType == TokenType.Literal) { return next; } else { break; } } else { if (next.TokenType == TokenType.OperatorSymbol) { if (next.Is(OperatorType.MemberAccess)) { foundMemberAccessSymbol = true; } else { break; } } else { break; } } } return null; }