left recursion program in c++
#include
#include
using namespace std;
int main()
{
int n, j, l, i, k;
int length[10] = {};
string d, a, b, flag;
char c;
cout<<"Enter Parent Non-Terminal: ";
cin >> c;
d.push_back(c);
a += d + "\'->";
d += "->";
b += d;
cout<<"Enter productions: ";
cin >> n;
for (int i = 0; i < n; i++)
{
cout<<"Enter Production ";
cout<> flag;
length[i] = flag.size();
d += flag;
if (i != n - 1)
{
d += "|";
}
}
cout<<"The Production Rule is: ";
cout<
|