| | |
| | | typeFN4 = 70, //3个参数的函数
|
| | |
|
| | | typeCoil=99,
|
| | | typeEND = 255,
|
| | |
|
| | | };
|
| | | struct stCell
|
| | |
| | | stCell Cells[2000][16] = { 0 };
|
| | | struct stProgSection
|
| | | {
|
| | | int Prefix = 0;
|
| | | int Suffix = 0;
|
| | | int bModifyVal = 1;
|
| | | std::vector <CMTerm1Doc::stProg> Progs;
|
| | | int Append(CMTerm1Doc::stProg prog) {
|
| | | Progs.push_back(prog);
|
| | |
| | | };
|
| | | int operator+=(const struct stProgSection progsec) {
|
| | | Append(progsec);
|
| | | bModifyVal = bModifyVal | progsec.bModifyVal;
|
| | | return 0;
|
| | | };
|
| | |
|
| | |
| | | CString s1;
|
| | | CStringA s2A;
|
| | | int n = (int)Progs.size();
|
| | | s2A.Format(" +%d ", Prefix);
|
| | | for (int k = 0; k < n; k++) {
|
| | | CMTerm1Doc::stProg& prog0 = Progs.at(k);
|
| | | s2A = prog0.ToText();
|
| | |
| | | }
|
| | | return s1;
|
| | | }
|
| | | int reduce()
|
| | | {
|
| | | if (Prefix > 0) {
|
| | | int level = 0;
|
| | | int j = Progs.size();
|
| | | for (int i = 0; i < j; i++) {
|
| | | int nOp = Progs[i].nOpType1;
|
| | | if (nOp == OP_ST || nOp == OP_ST_) {
|
| | | level += 1;;
|
| | | }
|
| | | else if (nOp == OP_ORS) {
|
| | | level -= 1;
|
| | | }
|
| | | if (nOp == OP_ANS) {
|
| | | level -= 1;
|
| | | if (level == 0) {
|
| | | Progs.erase(Progs.begin() + i);
|
| | | Prefix -= 1;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | return Prefix;
|
| | | }
|
| | | };
|
| | | std::pair<int, int> popsPoint[100];
|
| | |
|