- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
if (sign_ch == 0) {
swp = val_if[0];
val_if[0] = val_if[1];
val_if[1] = swp;
}
mem_smp[count_cmd] = 2000 + (symbolTable + val_if[1])->location;
count_cmd++;
mem_smp[count_cmd] = 3100 + (symbolTable + val_if[0])->location;
count_cmd++;
if (goto_flag == 1) {
flags[count_cmd] = second_buf;
mem_smp[count_cmd] = rn_data[ab].data[0];
count_cmd++;
} else {
mem_smp[count_cmd] = rn_data[ab].data[0] + second_buf;
count_cmd++;
}
if (rn_data[ab].type == 2) {
mem_smp[count_cmd] = 2000 + (symbolTable + val_if[0])->location;
count_cmd++;
mem_smp[count_cmd] = 3100 + (symbolTable + val_if[1])->location;
count_cmd++;
if (goto_flag == 1) {
flags[count_cmd] = second_buf;
mem_smp[count_cmd] = rn_data[ab].data[1];
count_cmd++;
} else {
mem_smp[count_cmd] = rn_data[ab].data[1] + second_buf;
count_cmd++;
}
}
}
else if (my_strcmp(buffer, "goto") == 0) {
second_buf = 0;
goto_flag = 0;
intro_buffer = strtok(NULL, " ");
second_buf = goto_search(symbolTable, intro_buffer);
if (second_buf == 0) {
second_buf = atoi(intro_buffer);
goto_flag = 1;
}
if (goto_flag == 1) {
flags[count_cmd] = second_buf;
mem_smp[count_cmd] = 4000;
count_cmd++;
} else {
mem_smp[count_cmd] = 4000 + second_buf;
count_cmd++;
}
}
else if (my_strcmp(buffer, "print") == 0) {
intro_buffer = strtok(NULL, " ");
second_buf = search_in_table(symbolTable, intro_buffer);
mem_smp[count_cmd] = 1100 + (symbolTable + second_buf)->location;
count_cmd++;
}
else if (my_strcmp(buffer, "input") == 0) {
intro_buffer = strtok(NULL, " ");
past_in_table_cons_or_value(symbolTable, intro_buffer);
second_buf = search_in_table(symbolTable, intro_buffer);
mem_smp[count_cmd] = 1000 + (symbolTable + second_buf)->location;
count_cmd++;
} else if (my_strcmp(buffer, "end") == 0) {
mem_smp[count_cmd] = 4300;
}
////////////////////////////////////////////////////////////////////////
count_table_extra = count_cmd;
/////////////////////////////////////////////////////////////////////////
}
}
for (d = 0; mem_smp[d] != 0; d++) {
if (flags[d] != -1) {
sprintf(&postfix[0], "%d", flags[d]);
goto_flag = search_in_table(symbolTable, postfix);
mem_smp[d] += (symbolTable + goto_flag)->location;
}
}
Комментарии (0) RSS
Добавить комментарий