I'm trying to implement polymorphism, as can be seen by the code below. I want vector of expressions of type class expression. these expressions will have a right and left parameter object of type Parameter class. As it may have been guessed, this could recurse until one hits a string "a_string" or "an_id." However, the compiler doesn't, first of all, know what type "Expression" is for the vector. Any help is needed. Thank you.
#ifndef PARAMETER_H
#define PARAMETER_H
#include <string>
#include <vector>
using namespace std;
class Parameter
{
private:
string a_string;
string an_id;
vector<Expression> expressions;
public:
Parameter(bool expr_stringID);
};
class Expression : public Parameter
{
private:
Parameter left_parameter;
Parameter right_parameter;
char op;
public:
};
#endif