Esempio n. 1
0
    QList<char> productionRules(QVector<double> params)
    {
        switch((int)params[0])
        {
        case 0:
            return T1().symbol({0,0}) + T2().symbol({0,0});
            break;
        case -1:
            return T2().symbol({0,0});
            break;

        default:
            return r3.productionRules({params[0] - 1, 0}) + r2.productionRules({params[0],0});
        }
    }
Esempio n. 2
0
 QList<char> start(QVector<double> params)
 {
     return r1.productionRules({params[0]  + 3,0 }) + r2.productionRules({params[0]  + 2,0}) + r3.productionRules({params[0]  + 3, 0}) +
             T1().symbol({0,0}) + T2().symbol({0,0});
 }