so I'm trying to build a vector recursively, as I look at this I begin to think I'm doing it quite wrong. Will the following code return a vector with each iterations results, or am I just creating new vectors on each iteration that actually wont build on each recursive call. If I'm wrong, how do I go about building a vector recursively... Thanks in advance for your constructive help!
std::vector<ParameterClass> recursiveParser :: parseParamList() { std::vector<ParameterClass> paramVector; if (lexicator->getCurrentToken()->getTokenType() == STRING) { paramVector.push_back(ParameterClass(*lexicator->getCurrentToken())); lexicator->advance(); parseParamList(); } else if (lexicator->getCurrentToken()->getTokenType() == ID) { paramVector.push_back(ParameterClass(*lexicator->getCurrentToken())); lexicator->advance(); parseParamList(); } else { // so as to not fail in Expression, i need to check to see that there is a // left paren indicating that there should be an expression if (lexicator->getCurrentToken()->getTokenType() == LEFT_PAREN) { paramVector.push_back(ParameterClass(parseExpression())); lexicator->advance(); parseParamList(); } } return paramVector; }